permissions:
pull-requests: write
contents: write
on:
push:
branches:
- main
jobs:
update-versions:
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-latest
concurrency:
group: release-plz-${{ github.ref }}
cancel-in-progress: false
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
- uses: dtolnay/rust-toolchain@stable
- uses: release-plz/action@v0.5
with:
command: release-pr
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
release-plz:
permissions:
contents: write
runs-on: ubuntu-latest
outputs:
releases_created: ${{ steps.release.outputs.releases_created }}
releases: ${{ steps.release.outputs.releases }}
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
- uses: dtolnay/rust-toolchain@stable
- id: release
uses: release-plz/action@v0.5
with:
command: release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
build-binaries:
runs-on: ubuntu-latest
needs: release-plz
if: needs.release-plz.outputs.releases_created == 'true'
permissions:
contents: write
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- run: cargo build --locked --release
- shell: bash
run: |
mkdir -p assets
mapfile -t BINARIES < <(find target/release -maxdepth 1 -type f -executable)
strip "${BINARIES[@]}"
LATEST_TAG=$(git describe --tags --abbrev=0)
RELEASE_NAME=autofoam-${LATEST_TAG}-linux-x86_64
tar czvf assets/"$RELEASE_NAME".tar.gz -C target/release "${BINARIES[@]##*/}"
shasum -a 256 assets/"$RELEASE_NAME".tar.gz >assets/"$RELEASE_NAME".sha256
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: softprops/action-gh-release@v2
with:
files: assets/*
tag_name: ${{ fromJson(needs.release-plz.outputs.releases)[0].tag }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}