Update main.yml #3
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: | |
pull_request: | |
workflow_dispatch: | |
release: | |
types: [published] | |
jobs: | |
build: | |
name: Build | |
runs-on: macos-latest | |
env: | |
JOB_TYPE: BUILD | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Xcodebuild Debug | |
uses: sersoft-gmbh/xcodebuild-action@v3 | |
with: | |
project: PinConfigurator.xcodeproj | |
scheme: PinConfigurator | |
destination: platform=macOS | |
configuration: Debug | |
action: build | |
- name: Xcodebuild Release | |
uses: sersoft-gmbh/xcodebuild-action@v3 | |
with: | |
project: PinConfigurator.xcodeproj | |
scheme: PinConfigurator | |
destination: platform=macOS | |
configuration: Release | |
action: build | |
- name: Prepare release image | |
run: | | |
mkdir build/Release-App | |
mv build/Release/PinConfigurator.app build/Release-App/ | |
- name: Prepare debug image | |
run: | | |
mkdir build/Debug-App | |
mv build/Debug/PinConfigurator.app build/Debug-App/ | |
- name: Create DMG image | |
run: | | |
brew install create-dmg | |
export VERSION=$(/usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" build/Release-App/PinConfigurator.app/Contents/Info.plist) | |
echo $VERSION | |
create-dmg --no-internet-enable --sandbox-safe --window-size 450 450 build/PinConfigurator-${VERSION}-Debug.dmg build/Debug-App/ | |
create-dmg --no-internet-enable --sandbox-safe --window-size 450 450 build/PinConfigurator-${VERSION}-Release.dmg build/Release-App/ | |
- name: Upload app | |
uses: actions/upload-artifact@v4 | |
with: | |
path: build/*.dmg | |
- name: Upload to Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Artifacts | |
path: build/*/*.zip | |
- name: Upload to Release | |
if: github.event_name == 'release' | |
uses: svenstaro/upload-release-action@e74ff71f7d8a4c4745b560a485cc5fdb9b5b999d | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: build/*.dmg | |
tag: ${{ github.ref }} | |
file_glob: true |