v0.1.2 #15
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: Build and upload release | |
| permissions: | |
| contents: write | |
| on: | |
| release: | |
| types: [published] | |
| env: | |
| CARGO_INCREMENTAL: 0 | |
| CARGO_NET_GIT_FETCH_WITH_CLI: true | |
| CARGO_NET_RETRY: 10 | |
| CARGO_TERM_COLOR: always | |
| CARGO_PROFILE_RELEASE_LTO: true | |
| RUST_BACKTRACE: 1 | |
| RUSTFLAGS: -D warnings | |
| RUSTUP_MAX_RETRIES: 10 | |
| defaults: | |
| run: | |
| shell: bash | |
| jobs: | |
| upload-assets: | |
| name: ${{ matrix.target }} | |
| runs-on: ${{ matrix.os }} | |
| timeout-minutes: 60 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - target: aarch64-unknown-linux-gnu | |
| os: ubuntu-22.04-arm | |
| - target: x86_64-unknown-linux-gnu | |
| os: ubuntu-22.04 | |
| - target: aarch64-apple-darwin | |
| os: macos-13 | |
| - target: x86_64-apple-darwin | |
| os: macos-13 | |
| - target: aarch64-pc-windows-msvc | |
| os: windows-2022 | |
| - target: x86_64-pc-windows-msvc | |
| os: windows-2022 | |
| steps: | |
| - name: Install Linux system dependencies | |
| if: startsWith(matrix.os, 'ubuntu') | |
| run: sudo apt-get install libxcb1-dev libdbus-1-dev | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| - uses: taiki-e/setup-cross-toolchain-action@v1 | |
| with: | |
| target: ${{ matrix.target }} | |
| if: startsWith(matrix.os, 'ubuntu') | |
| - run: echo "RUSTFLAGS=${RUSTFLAGS} -C target-feature=+crt-static" >> "${GITHUB_ENV}" | |
| if: endsWith(matrix.target, 'windows-msvc') | |
| - uses: taiki-e/upload-rust-binary-action@v1 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| bin: tattoy | |
| target: ${{ matrix.target }} | |
| locked: true | |
| tar: unix | |
| zip: windows | |
| checksum: sha256 | |
| publish-deb: | |
| name: Publish Debian package | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - name: Install Linux system dependencies | |
| run: sudo apt-get install libxcb1-dev libdbus-1-dev | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: x86_64-unknown-linux-gnu | |
| - name: Install `cargo-deb` | |
| uses: taiki-e/install-action@v2 | |
| with: | |
| tool: cargo-deb | |
| - name: Build Debian package | |
| run: | | |
| cargo build --release --locked --package tattoy | |
| cargo-deb \ | |
| --deb-revision="" \ | |
| --strip \ | |
| --package tattoy \ | |
| --verbose \ | |
| --output tattoy-${{ github.ref_name }}.deb | |
| - name: Upload .deb to the release | |
| uses: svenstaro/upload-release-action@v2 | |
| with: | |
| repo_token: ${{ secrets.GITHUB_TOKEN }} | |
| file: tattoy-${{ github.ref_name }}.deb | |
| tag: ${{ github.ref_name }} | |
| publish-rpm: | |
| name: Publish RPM package | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - name: Install Linux system dependencies | |
| run: sudo apt-get install libxcb1-dev libdbus-1-dev | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: x86_64-unknown-linux-gnu | |
| - name: Install `cargo-deb` | |
| uses: taiki-e/install-action@v2 | |
| with: | |
| tool: cargo-generate-rpm | |
| - name: Build RPM package | |
| run: | | |
| cargo build --release --locked --package tattoy | |
| cargo generate-rpm \ | |
| --package crates/tattoy \ | |
| --output tattoy-${{ github.ref_name }}.x86_64.rpm | |
| - name: Upload the release | |
| uses: svenstaro/upload-release-action@v2 | |
| with: | |
| repo_token: ${{ secrets.GITHUB_TOKEN }} | |
| file: tattoy-${{ github.ref_name }}.x86_64.rpm | |
| tag: ${{ github.ref }} | |
| publish-aur: | |
| name: Publish to AUR | |
| runs-on: ubuntu-latest | |
| needs: [upload-assets] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v2 | |
| - name: Write release version | |
| run: | | |
| TATTOY_VERSION=${GITHUB_REF_NAME#v} | |
| echo Tattoy version: $TATTOY_VERSION | |
| echo "TATTOY_VERSION=$TATTOY_VERSION" >> $GITHUB_ENV | |
| - name: Update AUR package files | |
| uses: heyhusen/archlinux-package-action@v2 | |
| with: | |
| pkgver: ${{ env.TATTOY_VERSION }} | |
| path: scripts/aur | |
| namcap: true | |
| srcinfo: true | |
| updpkgsums: true | |
| update_archlinux_keyring: false | |
| - name: Publish to the AUR | |
| uses: KSXGitHub/[email protected] | |
| with: | |
| pkgname: tattoy-bin | |
| pkgbuild: scripts/aur/PKGBUILD | |
| commit_username: ${{ secrets.AUR_USERNAME }} | |
| commit_email: ${{ secrets.AUR_EMAIL }} | |
| ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }} | |
| commit_message: Update to ${{ github.ref_name }} | |
| publish-homebrew: | |
| name: Publish Homebrew formula | |
| runs-on: ubuntu-22.04 | |
| needs: [upload-assets] | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Bump formula | |
| uses: mislav/[email protected] | |
| with: | |
| homebrew-tap: tattoy-org/homebrew-tap | |
| formula-name: tattoy | |
| formula-path: tattoy.rb | |
| download-url: https://github.com/tattoy-org/tattoy/releases/download/${{ github.ref_name }}/tattoy-aarch64-apple-darwin.tar.gz | |
| env: | |
| COMMITTER_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }} |