Skip to content

Commit

Permalink
Apple m1 scripting (#175)
Browse files Browse the repository at this point in the history
* Added Apple M1 Arm64 to the PR and Release flow (#174)

* Added Apple M1 Arm64 to the PR and Release flow

* Updated the name for macos m1 to aarch64

* Updated the compressed files to match the linux file name

* Added the Mac M1 build to the test-server (#176)
  • Loading branch information
tkmcmaster authored Nov 2, 2023
1 parent 782dfaf commit f2a53a8
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 9 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/pr-rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,17 @@ jobs:
target: aarch64-unknown-linux-musl
linker: gcc-aarch64-linux-gnu
cross: true
- build: macos-x86
os: macos-latest
cross: false
# https://docs.github.com/en/actions/using-github-hosted-runners/about-larger-runners/about-larger-runners
# macos-latest-xlarge or macos-13-xlarge are running on arm64 (m1)
- build: macos-aarch64
os: macos-latest-xlarge
cross: false
- build: windows
os: windows-latest
cross: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
Expand All @@ -106,6 +117,19 @@ jobs:
sudo apt update
sudo apt install ${{ matrix.linker }}
- name: Build for non-Linux # Windows and MacOS
uses: actions-rs/toolchain@v1
if: matrix.os != 'ubuntu-latest'
with:
profile: minimal
toolchain: stable
override: true
- uses: actions-rs/cargo@v1
if: matrix.os != 'ubuntu-latest'
with:
command: build
args: -q --release

# https://github.com/actions-rs/cargo#cross-compilation
- name: Build with cross # ARM builds
uses: actions-rs/toolchain@v1
Expand Down
20 changes: 16 additions & 4 deletions .github/workflows/release-test-server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,14 @@ jobs:
target: aarch64-unknown-linux-musl
linker: gcc-aarch64-linux-gnu
cross: true
- build: macos
- build: macos-x86
os: macos-latest
cross: false
# https://docs.github.com/en/actions/using-github-hosted-runners/about-larger-runners/about-larger-runners
# macos-latest-xlarge or macos-13-xlarge are running on arm64 (m1)
- build: macos-aarch64
os: macos-latest-xlarge
cross: false
- build: windows
os: windows-latest
cross: false
Expand Down Expand Up @@ -140,14 +145,21 @@ jobs:
if: matrix.os == 'windows-latest'
shell: bash
run: |
asset_name="test-server-$VERSION-windows-x86_64.zip"
asset_name="test-server-$VERSION-x86_64-windows.zip"
echo "ASSET_NAME=$asset_name" >> $GITHUB_ENV
7z a -mm=Deflate64 -mfb=258 -mpass=15 $asset_name ./target/release/test-server.exe
- name: Compress for macOS
- name: Compress for macOS x86
if: matrix.os == 'macos-latest'
run: |
asset_name="test-server-$VERSION-apple-darwin-x86_64.tar.xz"
asset_name="test-server-$VERSION-x86_64-apple-darwin.tar.xz"
echo "ASSET_NAME=$asset_name" >> $GITHUB_ENV
XZ_OPT=-9 tar -C ./target/release/ -cJf $asset_name test-server
- name: Compress for macOS aarch64
if: matrix.os == 'macos-latest-xlarge'
run: |
asset_name="test-server-$VERSION-aarch64-apple-darwin.tar.xz"
echo "ASSET_NAME=$asset_name" >> $GITHUB_ENV
XZ_OPT=-9 tar -C ./target/release/ -cJf $asset_name test-server
Expand Down
22 changes: 17 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
strategy:
matrix:
binary: ["pewpew", "pewpew-config-updater"]
build: ["linux", "arm-v7", "aarch64", "macos", "windows"]
build: ["linux", "arm-v7", "aarch64", "macos-x86", "macos-aarch64", "windows"]
include:
- binary: "pewpew"
build_param: "--bin"
Expand All @@ -78,9 +78,14 @@ jobs:
target: aarch64-unknown-linux-musl
linker: gcc-aarch64-linux-gnu
cross: true
- build: macos
- build: macos-x86
os: macos-latest
cross: false
# https://docs.github.com/en/actions/using-github-hosted-runners/about-larger-runners/about-larger-runners
# macos-latest-xlarge or macos-13-xlarge are running on arm64 (m1)
- build: macos-aarch64
os: macos-latest-xlarge
cross: false
- build: windows
os: windows-latest
cross: false
Expand Down Expand Up @@ -166,14 +171,21 @@ jobs:
if: matrix.os == 'windows-latest'
shell: bash
run: |
asset_name="${{ matrix.binary }}-$VERSION-windows-x86_64.zip"
asset_name="${{ matrix.binary }}-$VERSION-x86_64-windows.zip"
echo "ASSET_NAME=$asset_name" >> $GITHUB_ENV
7z a -mm=Deflate64 -mfb=258 -mpass=15 $asset_name ./target/release/${{ matrix.binary }}.exe
- name: Compress for macOS
- name: Compress for macOS x86
if: matrix.os == 'macos-latest'
run: |
asset_name="${{ matrix.binary }}-$VERSION-apple-darwin-x86_64.tar.xz"
asset_name="${{ matrix.binary }}-$VERSION-x86_64-apple-darwin.tar.xz"
echo "ASSET_NAME=$asset_name" >> $GITHUB_ENV
XZ_OPT=-9 tar -C ./target/release/ -cJf $asset_name ${{ matrix.binary }}
- name: Compress for macOS aarch64
if: matrix.os == 'macos-latest-xlarge'
run: |
asset_name="${{ matrix.binary }}-$VERSION-aarch64-apple-darwin.tar.xz"
echo "ASSET_NAME=$asset_name" >> $GITHUB_ENV
XZ_OPT=-9 tar -C ./target/release/ -cJf $asset_name ${{ matrix.binary }}
Expand Down

0 comments on commit f2a53a8

Please sign in to comment.