Skip to content

Commit

Permalink
👷 Add macOS platform to binary release workflow
Browse files Browse the repository at this point in the history
This builds off of the work from #369 to close #310
  • Loading branch information
aaronleopold committed Jul 29, 2024
1 parent 6bba9f9 commit 4f8fe43
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
7 changes: 6 additions & 1 deletion .github/actions/build-server/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,17 @@ runs:
- name: Setup rust
uses: ./.github/actions/setup-rust

# This action can be called to build in a Linux or Windows runner
# This action can be called to build in a Linux, macOS, or Windows runner
# This step only runs when using Linux
- name: Compile server (Linux)
if: runner.os == 'Linux'
shell: bash
run: cargo build --package stump_server --release
- name: Compile server (macOS)
# Alternatively, when running macOS
if: runner.os == 'macOS'
shell: bash
run: cargo build --package stump_server --release
- name: Compile server (Windows)
# Alternatively, when running Windows
if: runner.os == 'Windows'
Expand Down
16 changes: 14 additions & 2 deletions .github/workflows/release_binary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,14 @@ jobs:
needs: build-webapp
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
os: [ubuntu-latest, macos-latest, windows-latest]
include:
- os: ubuntu-latest
artifact_name: linux-artifact
artifact_filename: stump_server
- os: macos-latest
artifact_name: macos-artifact
artifact_filename: stump_server
- os: windows-latest
artifact_name: windows-artifact
artifact_filename: stump_server.exe
Expand Down Expand Up @@ -71,6 +74,12 @@ jobs:
name: linux-artifact
path: StumpServer-linux

- name: Download artifact (macOS)
uses: actions/download-artifact@v4
with:
name: macos-artifact
path: StumpServer-macos

- name: Download artifact (Windows)
uses: actions/download-artifact@v4
with:
Expand All @@ -84,6 +93,8 @@ jobs:
run: |
cd StumpServer-linux
zip -r ../linux-build-results.zip *
cd ../StumpServer-macos
zip -r ../macos-build-results.zip *
cd ../StumpServer-windows
zip -r ../windows-build-results.zip *
cd ..
Expand All @@ -93,7 +104,8 @@ jobs:
gh release create v${{ github.event.inputs.version }} \
--draft \
--target main \
--title 'Release ${{ github.event.inputs.version }}' \
--title 'v${{ github.event.inputs.version }}' \
--generate-notes \
linux-build-results.zip#StumpServer-${{ github.event.inputs.version }}-x64-Linux.zip \
macos-build-results.zip#StumpServer-${{ github.event.inputs.version }}-x64-macOS.zip \
windows-build-results.zip#StumpServer-${{ github.event.inputs.version }}-x64-Windows.zip

0 comments on commit 4f8fe43

Please sign in to comment.