Add automated release builds for tagged versions
Make sure that building for macOS actually produces an arm64 binary, not an x64 binary on the GitHub action runner.
Bonus: interested people can use Github's "watch" feature to be notified of new releases (Watch->Custom->Releases)
@noahlias I noticed your fork has basic CI setup, if it works well, would you like to make a PR?
@noahlias I noticed your fork has basic CI setup, if it works well, would you like to make a PR?
It benefits from the recent release of github action container containing macos14, but my CI is too simple, if I want to distribute it, I probably need to set the dmg format, and also set the application icon, etc.
DMGdistributeAPP Icon- Release version or some tag to trigger the workflow
- or Linux build
It's my simple build.yaml. Since I am a fork's project, I must configure a personal access token
name: Build and Release
on:
push:
branches:
- main
jobs:
macos-build:
runs-on: macos-14
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup CMake and Ninja
uses: lukka/get-cmake@latest
with:
cmakeVersion: 3.25.2
ninjaVersion: 1.11.1
# https://github.com/actions/runner-images/blob/main/images/macos/macos-14-arm64-Readme.md
- name: Build project
run: |
export DEVELOPER_DIR=/Applications/Xcode_14.3.1.app/Contents/Developer
sudo xcode-select -s $DEVELOPER_DIR
cmake -G "Ninja" -DCMAKE_BUILD_TYPE=Release -S . -B build
cmake --build build
- name: Create tarball
run: tar czvf awirt.tar.gz -C build awrit/Release
- name: Create GitHub Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.PAT }}
with:
tag_name: v0.1.2
release_name: Release v0.1.2
draft: false
prerelease: false
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.PAT }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./awirt.tar.gz
asset_name: awrit.tar.gz
asset_content_type: application/gzip
I made it because it didn't work on M1 pro(the switch Xcode version didn't work), so I used actions to build it for my personal use.
macOS releases are now built automatically and are available by using brew