Release new version #37
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release new version | |
on: | |
workflow_dispatch: | |
jobs: | |
check-formatting: | |
uses: ./.github/workflows/check-formatting.yml | |
fork-test: | |
uses: ./.github/workflows/fork-test.yml | |
test-contracts: | |
uses: ./.github/workflows/test-contracts.yml | |
test: | |
uses: ./.github/workflows/test.yml | |
try-runtime: | |
uses: ./.github/workflows/try-runtime.yml | |
build_binary: | |
# use old ubuntu for GLIBC compatibility | |
runs-on: ubuntu-20.04 | |
env: | |
RUST_BACKTRACE: 1 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install dependencies | |
run: sudo apt-get update && sudo apt-get install -y build-essential git clang curl libssl-dev llvm libudev-dev make protobuf-compiler pkg-config git-restore-mtime | |
# this is needed to make sure that cargo uses the cached target files, | |
# which will have an older date than the checked out source code. | |
- name: Restore files timestamps | |
run: | | |
# set all dirs and files mtime to the fixed timestamp, this one was chosen | |
# symbolically as polkadot genesis block date | |
find . -exec touch -t 202005260100 {} + | |
# restore mtime based on git commit log | |
git restore-mtime | |
- name: Setup caching for rust/cargo | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.os }}-cargo-rust-${{ hashFiles('**/Cargo.lock') }} | |
- name: Build | |
run: cargo build --release | |
- name: Rename binary | |
run: cp target/release/substrate-node linux_x86_build | |
- name: Upload binary | |
uses: actions/upload-artifact@v3 | |
with: | |
name: linux_x86_build | |
path: linux_x86_build | |
build_runtimes: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Srtool build mainnet runtime | |
id: srtool_build | |
uses: chevdor/srtool-actions@v0.8.0 | |
with: | |
chain: liberland | |
package: kitchensink-runtime | |
runtime_dir: ./substrate/bin/node/runtime | |
tag: "1.74.0" | |
- name: Check version | |
id: version | |
run: echo "version=v$(cargo pkgid -p node-cli | cut -d'@' -f2)" >> "$GITHUB_OUTPUT" | |
- name: Mainnet Summary | |
run: | | |
echo '${{ steps.srtool_build.outputs.json }}' | jq . > liberland-srtool-digest.mainnet.json | |
cat liberland-srtool-digest.mainnet.json | |
cp "${{ steps.srtool_build.outputs.wasm_compressed }}" ./mainnet-${{ steps.version.outputs.version }}.wasm | |
ls | |
- name: Upload mainnet runtime | |
uses: actions/upload-artifact@v3 | |
with: | |
name: mainnet-${{ steps.version.outputs.version }}.wasm | |
path: mainnet-${{ steps.version.outputs.version }}.wasm | |
- name: Srtool build bastiat runtime | |
id: srtool_build_bastiat | |
uses: chevdor/srtool-actions@v0.8.0 | |
env: | |
BUILD_OPTS: "--features testnet-runtime" | |
with: | |
chain: liberland | |
package: kitchensink-runtime | |
runtime_dir: ./substrate/bin/node/runtime | |
tag: "1.74.0" | |
- name: Bastiat Summary | |
run: | | |
echo '${{ steps.srtool_build_bastiat.outputs.json }}' | jq . > liberland-srtool-digest.bastiat.json | |
cat liberland-srtool-digest.bastiat.json | |
cp "${{ steps.srtool_build_bastiat.outputs.wasm_compressed }}" ./bastiat-${{ steps.version.outputs.version }}.wasm | |
ls | |
- name: Upload Bastiat runtime | |
uses: actions/upload-artifact@v3 | |
with: | |
name: bastiat-${{ steps.version.outputs.version }}.wasm | |
path: bastiat-${{ steps.version.outputs.version }}.wasm | |
release: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
needs: | |
- build_runtimes | |
- build_binary | |
- check-formatting | |
- fork-test | |
- test-contracts | |
- test | |
- try-runtime | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Check version | |
id: version | |
run: echo "version=v$(cargo pkgid -p node-cli | cut -d'@' -f2)" >> "$GITHUB_OUTPUT" | |
- name: Download binary | |
uses: actions/download-artifact@v3 | |
with: | |
name: linux_x86_build | |
- name: Download Bastiat runtime | |
uses: actions/download-artifact@v3 | |
with: | |
name: bastiat-${{ steps.version.outputs.version }}.wasm | |
- name: Download mainnet runtime | |
uses: actions/download-artifact@v3 | |
with: | |
name: mainnet-${{ steps.version.outputs.version }}.wasm | |
- name: Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
generate_release_notes: true | |
tag_name: ${{ steps.version.outputs.version }} | |
target_commitish: "${{ github.sha }}" | |
files: | | |
linux_x86_build | |
mainnet-${{ steps.version.outputs.version }}.wasm | |
bastiat-${{ steps.version.outputs.version }}.wasm |