build universal app #17
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
pull_request: | |
types: [closed] | |
branches: [main] | |
workflow_dispatch: | |
jobs: | |
build-artifacts: | |
if: github.event_name == 'workflow_dispatch' || github.head_ref == 'release' && github.event.pull_request.merged == true | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4.1.7 | |
- name: Install .NET SDK | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: '9.0.x' | |
- name: Build for Apple Silicon | |
run: | | |
dotnet publish -c Release -r osx-arm64 --self-contained -o osx-arm64 -p:AssemblyName=qc-osx-arm64 | |
- name: Build for Intel Macs | |
run: | | |
dotnet publish -c Release -r osx-x64 --self-contained -o osx-x64 -p:AssemblyName=qc-osx-x64 | |
- name: Create Universal Binary | |
run: | | |
mkdir qc-universal | |
lipo -create -output universal/qc-universal \ | |
osx-arm64/qc-osx-arm64 \ | |
osx-x64/qc-osx-x64 | |
- name: Create Tarball | |
run: | | |
tar -czf qc.tar.gz -C universal . | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v4.3.3 | |
with: | |
name: qc.tar.qz | |
path: universal | |
if-no-files-found: error | |
release: | |
needs: [build-artifacts] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4.1.7 | |
- uses: actions/download-artifact@v4.1.7 | |
with: | |
path: artifacts | |
merge-multiple: true | |
- name: sdf | |
run: ls -R artifacts | |
- uses: knope-dev/action@v2.1.0 | |
with: | |
version: 0.18.2 | |
- run: knope release | |
env: | |
GITHUB_TOKEN: ${{ secrets.PAT }} |