Publish release #3
Workflow file for this run
This file contains hidden or 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: Publish release | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| build-linux: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| with: | |
| submodules: recursive | |
| - name: Install Dependencies | |
| run: sudo apt update && sudo apt install -y libdbus-1-dev libhidapi-dev libusb-1.0-0-dev libudev-dev | |
| - name: Build release binaries | |
| run: | | |
| cargo build --release --bin hyper_headset_cli | |
| cargo build --release --bin hyper_headset | |
| - name: Create zip | |
| run: | | |
| mkdir -p dist | |
| cp target/release/hyper_headset dist/ | |
| cp target/release/hyper_headset_cli dist/ | |
| cd dist && zip hyper_headset_Linux.zip hyper_headset hyper_headset_cli | |
| - name: Upload zip artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: hyper_headset_Linux | |
| path: dist/hyper_headset_Linux.zip | |
| build-macos: | |
| runs-on: macos-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| with: | |
| submodules: recursive | |
| - name: Build release binaries | |
| run: cargo build --release --bin hyper_headset_cli | |
| - name: Create zip | |
| run: | | |
| mkdir -p dist | |
| cp target/release/hyper_headset_cli dist/ | |
| cd dist && zip hyper_headset_MacOS.zip hyper_headset_cli | |
| - name: Upload zip artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: hyper_headset_MacOS | |
| path: dist/hyper_headset_MacOS.zip | |
| publish-aur: | |
| runs-on: ubuntu-latest | |
| needs: [build-linux, build-macos] | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Download Linux zip artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: hyper_headset_Linux | |
| path: dist/ | |
| - name: Download MacOS zip artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: hyper_headset_MacOS | |
| path: dist/ | |
| - name: Create GitHub Release and upload zip | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| prerelease: true | |
| files: | | |
| dist/hyper_headset_Linux.zip | |
| dist/hyper_headset_MacOS.zip | |
| - name: Get tag version | |
| id: version | |
| run: echo "tag=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT | |
| - name: Clone AUR bin repo | |
| run: git clone https://aur.archlinux.org/hyperheadset-bin.git aur-bin-pkg | |
| - name: Update pkgver and pkgrel | |
| run: | | |
| sed -i "s/^pkgver=.*/pkgver=${{ steps.version.outputs.tag }}/" aur-bin-pkg/PKGBUILD | |
| sed -i "s/^pkgrel=.*/pkgrel=1/" aur-bin-pkg/PKGBUILD | |
| - name: Publish to AUR | |
| uses: KSXGitHub/github-actions-deploy-aur@v4.1.1 | |
| with: | |
| pkgname: hyper-headset-bin | |
| pkgbuild: ./aur-bin-pkg/PKGBUILD | |
| commit_username: ${{ secrets.AUR_USERNAME }} | |
| commit_email: ${{ secrets.AUR_EMAIL }} | |
| ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }} | |
| commit_message: Update to ${{ steps.version.outputs.tag }} | |
| updpkgsums: true | |
| allow_empty_commits: false |