v0.8.4 #30
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: Release | |
on: | |
push: | |
tags: ["v[0-9]+.[0-9]+.[0-9]+"] | |
jobs: | |
release: | |
name: ${{ matrix.target }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- os: ubuntu-latest | |
target: x86_64-unknown-linux-musl | |
- os: ubuntu-latest | |
target: arm-unknown-linux-musleabihf | |
- os: ubuntu-latest | |
target: armv7-unknown-linux-musleabihf | |
- os: ubuntu-latest | |
target: aarch64-unknown-linux-musl | |
- os: macos-latest | |
target: x86_64-apple-darwin | |
- os: macos-latest | |
target: aarch64-apple-darwin | |
- os: windows-latest | |
target: x86_64-pc-windows-msvc | |
- os: windows-latest | |
target: aarch64-pc-windows-msvc | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set artifact name | |
shell: bash | |
run: | | |
version="$(git describe --tags --match='v*.*.*' --always)" | |
name="mailbox-$version-${{ matrix.target }}" | |
echo "ARTIFACT_NAME=$name" >> $GITHUB_ENV | |
echo "version: $version" | |
echo "artifact: $name" | |
- name: Install Rust | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
target: ${{ matrix.target }} | |
- name: Install cross | |
if: matrix.os == 'ubuntu-latest' | |
uses: taiki-e/install-action@cross | |
- name: Build binary [Cross] | |
if: matrix.os == 'ubuntu-latest' | |
run: cross build --release --locked --target ${{ matrix.target }} --color=always --verbose | |
- name: Build binary [Cargo] | |
if: matrix.os != 'ubuntu-latest' | |
run: cargo build --release --locked --target ${{ matrix.target }} --color=always --verbose | |
- name: Package [*nix] | |
if: runner.os != 'Windows' | |
run: > | |
tar -cv | |
LICENSE README.md | |
man/ | |
-C contrib/ completions/ -C ../ | |
-C target/${{ matrix.target }}/release/ mailbox mailbox-server | |
| gzip --best > '${{ env.ARTIFACT_NAME }}.tar.gz' | |
- name: Package [Windows] | |
if: runner.os == 'Windows' | |
run: > | |
7z a ${{ env.ARTIFACT_NAME }}.zip | |
LICENSE README.md | |
./man/ | |
./contrib/completions/ | |
./target/${{ matrix.target }}/release/mailbox.exe | |
./target/${{ matrix.target }}/release/mailbox-server.exe | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.target }} | |
path: | | |
*.zip | |
*.tar.gz | |
- name: Create release | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: | | |
*.zip | |
*.tar.gz | |
update_brew_formula: | |
name: Publish to Homebrew tap | |
runs-on: ubuntu-latest | |
needs: release | |
steps: | |
- uses: mislav/bump-homebrew-formula-action@v3 | |
with: | |
formula-name: mailbox | |
homebrew-tap: canac/homebrew-tap | |
create-pullrequest: true | |
env: | |
COMMITTER_TOKEN: ${{ secrets.COMMITTER_TOKEN }} |