handle module thread errors #4
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: Deployment | |
on: | |
push: | |
tags: | |
- v* | |
jobs: | |
test: | |
uses: ./.github/workflows/test.yml | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
needs: test | |
env: | |
ARTIFACT_DIR: artifact | |
outputs: | |
sha256: ${{ steps.gen_sha256.outputs.sha256 }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install Rust toolchain | |
uses: dtolnay/rust-toolchain@stable | |
- name: Install dependencies | |
run: sudo apt-get install libnl-3-dev libnl-genl-3-dev libnl-route-3-dev libpulse-dev | |
- name: Build | |
run: cargo build --release --locked | |
- name: Prepare artifact | |
run: | | |
mkdir $ARTIFACT_DIR | |
mv -f target/release/baru $ARTIFACT_DIR/ | |
- name: Gen sha256 | |
id: gen_sha256 | |
working-directory: ${{ env.ARTIFACT_DIR }} | |
run: | | |
sha256=$(sha256sum baru) | |
echo "$sha256" | |
echo "sha256=$sha256" >> "$GITHUB_OUTPUT" | |
echo "$sha256" > baru.sha256sum | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: baru | |
path: ${{ env.ARTIFACT_DIR }} | |
retention-days: 2 | |
release: | |
name: Release | |
needs: build | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
env: | |
SHA256: ${{ needs.build.outputs.sha256 }} | |
steps: | |
- name: Download binary artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: baru | |
- name: Integrity check | |
run: | | |
sha256sum -c baru.sha256sum | |
[ "$SHA256" == "$(cat baru.sha256sum)" ] && echo "sha256 OK" | |
- name: Create release | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: | | |
baru | |
baru.sha256sum | |
aur-packaging: | |
name: Publish AUR package | |
needs: release | |
runs-on: ubuntu-latest | |
env: | |
PKGNAME: baru | |
PKGBUILD: ./.pkg/aur/PKGBUILD | |
RELEASE_TAG: ${{ github.ref_name }} | |
REPOSITORY: ${{ github.repository }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Download sources | |
run: curl -LfsSo "$PKGNAME-$RELEASE_TAG".tar.gz "https://github.com/$REPOSITORY/archive/refs/tags/$RELEASE_TAG.tar.gz" | |
- name: Update PKGBUILD | |
run: ./.pkg/aur/update.sh | |
- name: Show PKGBUILD | |
run: cat "$PKGBUILD" | |
- name: Publish | |
uses: KSXGitHub/[email protected] | |
with: | |
pkgname: ${{ env.PKGNAME }} | |
pkgbuild: ${{ env.PKGBUILD }} | |
commit_username: ${{ secrets.AUR_USERNAME }} | |
commit_email: ${{ secrets.AUR_EMAIL }} | |
ssh_private_key: ${{ secrets.AUR_SSH_KEY }} | |
commit_message: ${{ github.ref_name }} |