Skip to content

Release

Release #27

Workflow file for this run

name: Release
on:
push:
tags:
- 'v*'
jobs:
build-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
- name: Run the release build
run: cargo build --release --target=x86_64-unknown-linux-gnu
env:
RUSTFLAGS: -C target-feature=+crt-static
- name: Create the release archive
run: zip -9 "pbuildrs-${{ github.ref_name }}-x86_64-linux.zip" pbuildrs
working-directory: target/x86_64-unknown-linux-gnu/release/
- uses: actions/upload-artifact@v6
with:
name: x86_64-linux
path: "target/x86_64-unknown-linux-gnu/release/pbuildrs-${{ github.ref_name }}-x86_64-linux.zip"
if-no-files-found: error
retention-days: 1
compression-level: 0
build-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v6
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
- name: Run the release build
run: cargo build --release --target=aarch64-apple-darwin
env:
RUSTFLAGS: -C target-feature=+crt-static
- name: Create the release archive
run: zip -9 "pbuildrs-${{ github.ref_name }}-aarch64-darwin.zip" pbuildrs
working-directory: target/aarch64-apple-darwin/release/
- uses: actions/upload-artifact@v6
with:
name: aarch64-darwin
path: "target/aarch64-apple-darwin/release/pbuildrs-${{ github.ref_name }}-aarch64-darwin.zip"
if-no-files-found: error
retention-days: 1
compression-level: 0
release:
runs-on: ubuntu-latest
permissions:
contents: write
needs:
- build-linux
- build-macos
steps:
- uses: actions/download-artifact@v7
with:
name: aarch64-darwin
- uses: actions/download-artifact@v7
with:
name: x86_64-linux
- name: Create a GitHub release
run: |
gh release create ${{ github.ref_name }} --draft --generate-notes \
--prerelease --title "Release ${{ github.ref_name }} draft" \
--repo "${{ github.repository }}" \
"pbuildrs-${{ github.ref_name }}-aarch64-darwin.zip" \
"pbuildrs-${{ github.ref_name }}-x86_64-linux.zip"
env:
GH_TOKEN: ${{ github.token }}