CI- Switch to using gh release instead of abandonded release action. … #15
Workflow file for this run
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 | |
# Do this on every push | |
on: | |
push: | |
tags: | |
- "v*" | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build-linux-release: | |
name: Build release for Linux | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Install Rust, stable minimal toolchain | |
uses: dtolnay/rust-toolchain@v1 | |
with: | |
toolchain: stable | |
- name: Build | |
run: .github/workflows/build.sh | |
- name: Upload tarball | |
uses: actions/upload-artifact@v4 | |
with: | |
name: linux.tar.gz | |
path: "*.tar.gz" | |
if-no-files-found: error | |
build-macos-13-release: | |
name: Build release for MacOS x86_64 | |
runs-on: macos-13 | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Install Rust, stable minimal toolchain | |
uses: dtolnay/rust-toolchain@v1 | |
with: | |
toolchain: stable | |
- name: Build | |
run: .github/workflows/build.sh | |
- name: Upload tarball | |
uses: actions/upload-artifact@v4 | |
with: | |
name: macos13.tar.gz | |
path: "*.tar.gz" | |
if-no-files-found: error | |
build-macos-14-release: | |
name: Build release for MacOS arm64 | |
runs-on: macos-14 | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Install Rust, stable minimal toolchain | |
uses: dtolnay/rust-toolchain@v1 | |
with: | |
toolchain: stable | |
- name: Build | |
run: .github/workflows/build.sh | |
- name: Upload tarball | |
uses: actions/upload-artifact@v4 | |
with: | |
name: macos14.tar.gz | |
path: "*.tar.gz" | |
if-no-files-found: error | |
create-release: | |
name: Create a new release | |
runs-on: ubuntu-latest | |
needs: [build-linux-release, build-macos-13-release, build-macos-14-release] | |
steps: | |
- name: Create release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
tag: ${{ github.ref_name }} | |
shell: bash | |
run: | | |
gh release create "$tag" \ | |
--repo="$GITHUB_REPOSITORY" \ | |
--title="${GITHUB_REPOSITORY#*/} ${tag#v}" \ | |
--generate-notes *.tar.gz | |
create-rust-release: | |
name: Publish to crates.io | |
runs-on: ubuntu-latest | |
needs: [create-release] | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v4 | |
- name: Install stable, minimal toolchain | |
uses: dtolnay/rust-toolchain@v1 | |
with: | |
toolchain: stable | |
- name: Run tests on latest stable rust | |
run: cargo build --release | |
- uses: katyo/publish-crates@v2 | |
with: | |
registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }} | |
args: --no-verify |