Skip to content

Commit

Permalink
fix: install macos sha256sum (#4489)
Browse files Browse the repository at this point in the history
  • Loading branch information
LesnyRumcajs authored Jul 5, 2024
1 parent 5030d36 commit 9d6a7fb
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 3 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ jobs:
steps:
- name: Checkout Sources
uses: actions/checkout@v4
- name: Homebrew Utils
if: contains(matrix.os, 'macos')
run: |
brew install --verbose coreutils
- name: Rust Cache
uses: Swatinem/rust-cache@v2
timeout-minutes: 5
Expand All @@ -30,9 +34,6 @@ jobs:
mkdir -p forest-${{ github.ref_name }}
cp -v target/release/forest target/release/forest-cli target/release/forest-tool forest-${{ github.ref_name }}
cp -rv CHANGELOG.md LICENSE-APACHE LICENSE-MIT README.md documentation forest-${{ github.ref_name }}
# If `sha256sum` is not defined, then we're likely running MacOS. Use an alias.
# An alternative is to install `coreutils`.
type sha256sum >/dev/null 2>&1 || alias sha256sum='shasum -a 256'
sha256sum forest-${{ github.ref_name }}/forest > forest-${{ github.ref_name }}/forest.sha256
sha256sum forest-${{ github.ref_name }}/forest-cli > forest-${{ github.ref_name }}/forest-cli.sha256
sha256sum forest-${{ github.ref_name }}/forest-tool > forest-${{ github.ref_name }}/forest-tool.sha256
Expand Down
53 changes: 53 additions & 0 deletions .github/workflows/release_dispatch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# This workflow is used for emergency artifact releases, e.g., when the release tag can not be created by the linked release workflow.
name: Release (manual)

on:
workflow_dispatch:
inputs:
tag:
description: 'Tag to release'
required: true
type: string

jobs:
build:
name: Build
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
file: forest-${{ github.event.inputs.tag }}-linux-amd64.zip
- os: macos-latest
file: forest-${{ github.event.inputs.tag }}-macos-amd64.zip
steps:
- name: Checkout Sources
uses: actions/checkout@v4
- name: Homebrew Utils
if: contains(matrix.os, 'macos')
run: |
brew install --verbose coreutils
- name: Rust Cache
uses: Swatinem/rust-cache@v2
timeout-minutes: 5
continue-on-error: true
- name: Cargo Build
run: cargo build --release --bin forest --bin forest-cli --bin forest-tool
- name: Compress Binary
run: |
mkdir -p forest-${{ github.event.inputs.tag }}
cp -v target/release/forest target/release/forest-cli target/release/forest-tool forest-${{ github.event.inputs.tag }}
cp -rv CHANGELOG.md LICENSE-APACHE LICENSE-MIT README.md documentation forest-${{ github.event.inputs.tag }}
sha256sum forest-${{ github.event.inputs.tag }}/forest > forest-${{ github.event.inputs.tag }}/forest.sha256
sha256sum forest-${{ github.event.inputs.tag }}/forest-cli > forest-${{ github.event.inputs.tag }}/forest-cli.sha256
sha256sum forest-${{ github.event.inputs.tag }}/forest-tool > forest-${{ github.event.inputs.tag }}/forest-tool.sha256
zip -r ${{ matrix.file }} forest-${{ github.event.inputs.tag }}
- name: Upload Binary
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ github.token }}
file: ${{ matrix.file }}
asset_name: ${{ matrix.file }}
tag: ${{ github.event.inputs.tag }}
overwrite: true
prerelease: true

0 comments on commit 9d6a7fb

Please sign in to comment.