Release #27
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: Binary Release | ||
permissions: write | ||
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: 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: ${{ github.ref }} | ||
release_name: Release ${{ github.ref }} | ||
body: Release for ${{ github.ref }} | ||
draft: false | ||
prerelease: false | ||
- 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 | ||