mask v0.11.6 #24
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: New Release | |
on: | |
release: | |
types: [released] | |
permissions: | |
contents: write | |
jobs: | |
release-crate-mask: | |
if: ${{ startsWith(github.ref_name, 'mask/') }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: "Publish crate" | |
env: | |
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} | |
run: cargo publish -p mask | |
release-crate-mask-parser: | |
if: ${{ startsWith(github.ref_name, 'mask-parser/') }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: "Publish crate" | |
env: | |
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} | |
run: cargo publish -p mask-parser | |
release-linux: | |
if: ${{ startsWith(github.ref_name, 'mask/') }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Fetch dependencies | |
run: cargo fetch | |
- name: Build in release mode | |
run: cargo build --release --frozen --target x86_64-unknown-linux-gnu | |
- name: Add the version tag to the binary name | |
run: | | |
VERSION_TAG="$(echo ${{ github.ref_name }} | cut -d/ -f2)" | |
TARGET=x86_64-unknown-linux-gnu | |
NAME=mask-$VERSION_TAG-$TARGET | |
mkdir $NAME | |
mv ./target/$TARGET/release/mask ./$NAME/mask | |
chmod +x ./$NAME/mask | |
zip -r $NAME.zip $NAME | |
shasum -a 256 $NAME.zip > $NAME.zip.sha256 | |
# TODO: replace with https://cli.github.com/manual/gh_release_upload | |
- name: Attach the binary to the release | |
uses: ./.github/actions/attach-release-assets | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
assets: ./*.zip ./*.sha256 | |
release-linux-musl: | |
if: ${{ startsWith(github.ref_name, 'mask/') }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Fetch dependencies | |
run: cargo fetch | |
- name: Build in release mode | |
run: | | |
rustup target add x86_64-unknown-linux-musl | |
cargo build --release --frozen --target x86_64-unknown-linux-musl | |
- name: Add the version tag to the binary name | |
run: | | |
VERSION_TAG="$(echo ${{ github.ref_name }} | cut -d/ -f2)" | |
TARGET=x86_64-unknown-linux-musl | |
NAME=mask-$VERSION_TAG-$TARGET | |
mkdir $NAME | |
mv ./target/$TARGET/release/mask ./$NAME/mask | |
chmod +x ./$NAME/mask | |
zip -r $NAME.zip $NAME | |
shasum -a 256 $NAME.zip > $NAME.zip.sha256 | |
# TODO: replace with https://cli.github.com/manual/gh_release_upload | |
- name: Attach the binary to the release | |
uses: ./.github/actions/attach-release-assets | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
assets: ./*.zip ./*.sha256 | |
release-macos-aarch64: | |
if: ${{ startsWith(github.ref_name, 'mask/') }} | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Fetch dependencies | |
run: cargo fetch | |
- name: Build in release mode | |
run: | | |
SDKROOT=$(xcrun -sdk macosx --show-sdk-path) | |
MACOSX_DEPLOYMENT_TARGET=$(xcrun -sdk macosx --show-sdk-platform-version) | |
rustup target add aarch64-apple-darwin | |
cargo build --release --frozen --target aarch64-apple-darwin | |
- name: Add the version tag to the binary name | |
run: | | |
VERSION_TAG="$(echo ${{ github.ref_name }} | cut -d/ -f2)" | |
TARGET=aarch64-apple-darwin | |
NAME=mask-$VERSION_TAG-$TARGET | |
mkdir $NAME | |
mv ./target/$TARGET/release/mask ./$NAME/mask | |
chmod +x ./$NAME/mask | |
zip -r $NAME.zip $NAME | |
shasum -a 256 $NAME.zip > $NAME.zip.sha256 | |
# TODO: replace with https://cli.github.com/manual/gh_release_upload | |
# NOTE: cannot use the attach-release-assets action because macOS doesn't support docker-based actions. | |
# Luckily we can just run the bash script directly. | |
- name: Attach the binary to the release | |
run: ./.github/actions/attach-release-assets/run.sh "./*.zip ./*.sha256" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
release-macos-x86-64: | |
if: ${{ startsWith(github.ref_name, 'mask/') }} | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Fetch dependencies | |
run: cargo fetch | |
- name: Build in release mode | |
run: | | |
rustup target add x86_64-apple-darwin | |
cargo build --release --frozen --target x86_64-apple-darwin | |
- name: Add the version tag to the binary name | |
run: | | |
VERSION_TAG="$(echo ${{ github.ref_name }} | cut -d/ -f2)" | |
TARGET=x86_64-apple-darwin | |
NAME=mask-$VERSION_TAG-$TARGET | |
mkdir $NAME | |
mv ./target/$TARGET/release/mask ./$NAME/mask | |
chmod +x ./$NAME/mask | |
zip -r $NAME.zip $NAME | |
shasum -a 256 $NAME.zip > $NAME.zip.sha256 | |
# TODO: replace with https://cli.github.com/manual/gh_release_upload | |
# NOTE: cannot use the attach-release-assets action because macOS doesn't support docker-based actions. | |
# Luckily we can just run the bash script directly. | |
- name: Attach the binary to the release | |
run: ./.github/actions/attach-release-assets/run.sh "./*.zip ./*.sha256" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
release-homebrew: | |
if: ${{ startsWith(github.ref_name, 'mask/') }} | |
needs: release-macos-x86-64 | |
runs-on: ubuntu-latest | |
steps: | |
- name: Bump homebrew-core formula | |
uses: mislav/bump-homebrew-formula-action@v3 | |
env: | |
COMMITTER_TOKEN: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }} | |
with: | |
# Sends a PR to homebrew-core to update the formula | |
formula-name: mask | |
release-windows: | |
if: ${{ startsWith(github.ref_name, 'mask/') }} | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Fetch dependencies | |
run: cargo fetch | |
- name: Build in release mode | |
run: cargo build --release --frozen --target x86_64-pc-windows-msvc | |
- name: Add the version tag to the binary name | |
shell: bash | |
run: | | |
VERSION_TAG="$(echo ${{ github.ref_name }} | cut -d/ -f2)" | |
TARGET=x86_64-pc-windows-msvc | |
NAME=mask-$VERSION_TAG-$TARGET | |
mkdir $NAME | |
mv ./target/$TARGET/release/mask.exe ./$NAME/mask.exe | |
7z a $NAME.zip $NAME | |
certutil -hashfile $NAME.zip sha256 | grep -E [A-Fa-f0-9]{64} > $NAME.zip.sha256 | |
# TODO: replace with https://cli.github.com/manual/gh_release_upload | |
# NOTE: cannot use the attach-release-assets action because windows doesn't support docker-based actions. | |
# Luckily we can just run the bash script directly. | |
- name: Attach the binary to the release | |
shell: bash | |
run: ./.github/actions/attach-release-assets/run.sh "./*.zip ./*.sha256" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |