Skip to content

Release

Release #30

Workflow file for this run

name: Binary Release
permissions: write-all
on:
workflow_run:
workflows: ["Cargo Check"]
types:
- completed
jobs:
build:
runs-on:
labels: movement-runner
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Checkout Repository
uses: actions/checkout@v2
with:
submodules: 'recursive' # Ensures submodules are fetched
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.69.0
- name: Install windows target
run: rustup target add x86_64-pc-windows-gnu
- name: Install mac target
run: rustup target add x86_64-apple-darwin
- name: Install aarch64 target
run: rustup target add aarch64-unknown-linux-gnu
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential
- name: Build binaries
run: |
cd "$GITHUB_WORKSPACE/m1"
RUSTFLAGS="--cfg tokio_unstable" cargo build --release
- name: Build binaries
run: |
cd "$GITHUB_WORKSPACE/m1"
ls -l $GITHUB_WORKSPACE/m1/target/release
- name: Archive binaries
uses: actions/upload-artifact@v3
with:
name: subnet
path: |
$GITHUB_WORKSPACE/m1/target/release/subnet
- name: Bump version and push tag
id: create_tag
uses: anothrNick/[email protected] # Don't use @master or @v1 unless you're happy to test the latest version
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # if you don't want to set write permissions use a PAT token
WITH_V: false
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ steps.create_tag.outputs.tag }}
release_name: Pre-release ${{ steps.create_tag.outputs.tag }}
body: Pre-release for ${{ steps.create_tag.outputs.tag }}
draft: false
prerelease: true
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this reference for more info: https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idstepsid
asset_path: $GITHUB_WORKSPACE/m1/target/release/subnet
asset_name: subnet
asset_content_type: application/octet-stream