Skip to content

Add rust-build action to dependencies and update metadata in `Cargo… #126

Add rust-build action to dependencies and update metadata in `Cargo…

Add rust-build action to dependencies and update metadata in `Cargo… #126

Workflow file for this run

name: CD
on:
push:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: write
env:
CARGO_TERM_COLOR: always
jobs:
build-x86:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Add target
run: rustup target add x86_64-unknown-linux-gnu
- name: Compile
id: compile-x86
uses: rust-build/rust-build.action@v1.4.5
with:
RUSTTARGET: x86_64-unknown-linux-gnu
UPLOAD_MODE: none
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: Binary-x86
path: |
${{ steps.compile-x86.outputs.BUILT_ARCHIVE }}
${{ steps.compile-x86.outputs.BUILT_CHECKSUM }}
build-arm:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Add target
run: rustup target add aarch64-apple-darwin
- name: Compile
id: compile-arm
uses: rust-build/rust-build.action@v1.4.5
with:
RUSTTARGET: aarch64-apple-darwin
UPLOAD_MODE: none
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: Binary-arm
path: |
${{ steps.compile-arm.outputs.BUILT_ARCHIVE }}
${{ steps.compile-arm.outputs.BUILT_CHECKSUM }}
release:
needs: [build-x86, build-arm]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Git
run: |
git config user.name "Linus Oleander"
git config user.email "oleander@users.noreply.github.com"
- name: Install cargo-bump
run: cargo install cargo-bump
- name: Bump version
run: |
git stash
cargo bump patch --git-tag
git diff-index --quiet HEAD -- || git commit -a --amend --no-edit
git push origin HEAD --tags
- name: Download all artifacts
uses: actions/download-artifact@v4
- name: Create Release
uses: softprops/action-gh-release@v2
with:
tag_name: "0.2.26"
files: |
Binary-x86
Binary-arm
- name: Publish to crates.io
run: cargo publish --allow-dirty
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}