Autolabel Windows and macOS changes #479
Workflow file for this run
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: CI | |
on: | |
push: | |
branches: | |
- master | |
release: | |
types: | |
- published | |
pull_request: | |
jobs: | |
build_win: | |
name: Build (Windows) | |
runs-on: windows-latest | |
steps: | |
- uses: microsoft/[email protected] | |
- uses: nuget/setup-nuget@v1 | |
- uses: actions/checkout@v3 | |
- name: Build | |
working-directory: ./windows | |
run: | | |
nuget restore | |
msbuild "QMK Toolbox.sln" /verbosity:minimal /p:Configuration=Release | |
- name: Create installer | |
working-directory: ./windows | |
run: | | |
iscc install_compiler.iss | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: qmk_toolbox.exe | |
path: windows/QMK Toolbox/bin/Release/qmk_toolbox.exe | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: qmk_toolbox_install.exe | |
path: windows/qmk_toolbox_install.exe | |
build_macos: | |
name: Build (macOS) | |
runs-on: macOS-latest | |
steps: | |
- uses: maxim-lobanov/setup-xcode@v1 | |
with: | |
xcode-version: latest-stable | |
- uses: actions/checkout@v3 | |
- name: Check binary permissions | |
working-directory: ./macos/QMK Toolbox/Resources | |
env: | |
QMK_BINARIES: avrdude bootloadHID dfu-programmer dfu-util mdloader teensy_loader_cli wb32-dfu-updater_cli | |
run: | | |
status=0 | |
for b in $QMK_BINARIES; do | |
perm=$(stat -f "%Lp" $b) | |
echo "$b: $perm" | |
[[ $perm == "755" ]] || status=1 | |
done | |
exit $status | |
- name: Build | |
working-directory: ./macos | |
run: | | |
mkdir build | |
xcodebuild CONFIGURATION_BUILD_DIR=build | |
ditto -ck --rsrc --sequesterRsrc -v --keepParent "build/QMK Toolbox.app" build/QMK.Toolbox.app.zip | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: QMK.Toolbox.app.zip | |
path: macos/build/QMK.Toolbox.app.zip | |
- name: Create installer | |
working-directory: ./macos | |
run: | | |
brew install packages | |
packagesbuild -v "QMK Toolbox.pkgproj" | |
mv "build/QMK Toolbox.pkg" build/QMK.Toolbox.pkg | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: QMK.Toolbox.pkg | |
path: macos/build/QMK.Toolbox.pkg | |
publish_release: | |
name: Publish (Release) | |
runs-on: ubuntu-latest | |
needs: [build_win, build_macos] | |
if: github.event.release.tag_name | |
steps: | |
- uses: actions/download-artifact@v3 | |
- uses: softprops/action-gh-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
name: ${{ github.event.release.name }} | |
files: | | |
./qmk_toolbox.exe/qmk_toolbox.exe | |
./qmk_toolbox_install.exe/qmk_toolbox_install.exe | |
./QMK.Toolbox.app.zip/QMK.Toolbox.app.zip | |
./QMK.Toolbox.pkg/QMK.Toolbox.pkg | |
publish_beta: | |
name: Publish (Beta) | |
runs-on: ubuntu-latest | |
needs: [build_win, build_macos] | |
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} | |
steps: | |
- uses: actions/download-artifact@v3 | |
- uses: marvinpinto/action-automatic-releases@latest | |
with: | |
repo_token: "${{ secrets.GITHUB_TOKEN }}" | |
automatic_release_tag: "beta" | |
prerelease: true | |
title: "Latest Beta" | |
files: | | |
./qmk_toolbox.exe/qmk_toolbox.exe | |
./qmk_toolbox_install.exe/qmk_toolbox_install.exe | |
./QMK.Toolbox.app.zip/QMK.Toolbox.app.zip | |
./QMK.Toolbox.pkg/QMK.Toolbox.pkg |