Skip to content

Commit c60e97b

Browse files
committed
🔧 fix: add support for both macOS and linux builds
1 parent 8d96a7d commit c60e97b

2 files changed

Lines changed: 23 additions & 7 deletions

File tree

.github/workflows/release.yml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,17 @@ env:
1010

1111
jobs:
1212
build:
13-
name: Publish Binaries
14-
runs-on: ubuntu-latest
13+
name: Publish for ${{ matrix.os }}
14+
runs-on: ${{ matrix.os }}
15+
strategy:
16+
matrix:
17+
include:
18+
- os: ubuntu-latest
19+
artifact_name: heimdall
20+
asset_name: heimdall-linux-amd64
21+
- os: macos-latest
22+
artifact_name: heimdall
23+
asset_name: heimdall-macos-amd64
1524

1625
steps:
1726
- uses: actions/checkout@v2
@@ -21,7 +30,7 @@ jobs:
2130
- name: Upload Binaries
2231
uses: svenstaro/upload-release-action@v2
2332
with:
24-
file: ./heimdall/target/release/heimdall
25-
asset_name: heimdall
33+
file: ./heimdall/target/release/${{ matrix.artifact_name }}
34+
asset_name: ${{ matrix.asset_name }}
2635
tag: ${{ github.ref }}
2736
overwrite: true

bifrost/bifrost

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,18 @@ main() {
8484
fi
8585

8686
if [ -n "$USE_BINARY" ]; then
87-
88-
echo "bifrost: fetching binary."
8987

9088
ensure cd $BIFROST_BIN_DIR
91-
ensure curl -k -L -s --compressed "https://github.com/Jon-Becker/heimdall-rs/releases/download/$TARGET_VERSION/heimdall" -o heimdall
89+
echo "bifrost: fetching binary."
90+
91+
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
92+
ensure curl -k -L -s --compressed "https://github.com/Jon-Becker/heimdall-rs/releases/download/$TARGET_VERSION/heimdall-linux-amd64" -o heimdall
93+
elif [[ "$OSTYPE" == "darwin"* ]]; then
94+
ensure curl -k -L -s --compressed "https://github.com/Jon-Becker/heimdall-rs/releases/download/$TARGET_VERSION/heimdall-macos-amd64" -o heimdall
95+
else
96+
echo "bifrost: unsupported operating system: $OSTYPE"
97+
exit 1
98+
fi
9299

93100
echo "bifrost: installing binary."
94101

0 commit comments

Comments
 (0)