From 670544cfb12ced16d67261c8456c6adebc8ff862 Mon Sep 17 00:00:00 2001 From: Tindy X <49061470+tindy2013@users.noreply.github.com> Date: Wed, 3 Apr 2024 18:50:35 +0800 Subject: [PATCH] Add macOS ARM build --- .github/workflows/build.yml | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9a4fd152a..50db6c3db 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -112,9 +112,9 @@ jobs: files: subconverter_aarch64.tar.gz draft: true - macos_build: - name: macOS Build - runs-on: macos-latest + macos_x86_build: + name: macOS x86 Build + runs-on: macos-13 steps: - uses: actions/checkout@v3 - uses: actions/setup-python@v4 @@ -140,6 +140,34 @@ jobs: files: subconverter_darwin64.tar.gz draft: true + macos_arm_build: + name: macOS ARM Build + runs-on: macos-14 + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: '3.11' + - name: Add commit id into version + if: ${{ !startsWith(github.ref, 'refs/tags/') }} + run: SHA=$(git rev-parse --short HEAD) && sed -i -e 's/\(v[0-9]\.[0-9]\.[0-9]\)/\1-'"$SHA"'/' src/version.h + - name: Build + run: bash scripts/build.macos.release.sh + - name: Upload + uses: actions/upload-artifact@v3 + with: + name: subconverter_darwinarm + path: subconverter/ + - name: Package Release + if: ${{ github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') }} + run: tar czf subconverter_darwinarm.tar.gz subconverter + - name: Draft Release + uses: softprops/action-gh-release@v1 + if: ${{ github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') }} + with: + files: subconverter_darwinarm.tar.gz + draft: true + windows64_build: name: Windows x86_64 Build runs-on: windows-latest