Build and Release macOS App #24
This file contains hidden or 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: Build and Release macOS App | |
| on: | |
| release: | |
| types: [published] | |
| workflow_dispatch: | |
| inputs: | |
| uploadUrl: | |
| description: "Upload URL for the build output. If not provided, the action will fail." | |
| required: false | |
| type: string | |
| jobs: | |
| build: | |
| name: Build and Release macOS App | |
| runs-on: macos-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Xcode | |
| uses: maxim-lobanov/setup-xcode@v1 | |
| with: | |
| xcode-version: "16.1" | |
| - name: Build the app | |
| run: | | |
| xcodebuild -project Taskito.xcodeproj \ | |
| -scheme Taskito \ | |
| -configuration Release \ | |
| -derivedDataPath build \ | |
| CODE_SIGN_IDENTITY="" \ | |
| CODE_SIGNING_REQUIRED=NO \ | |
| CODE_SIGNING_ALLOWED=NO | |
| - name: Verify App Existence | |
| run: ls -la build/Build/Products/Release/ | |
| - name: Install appdmg | |
| run: npm install -g appdmg | |
| - name: Create Dist Directory | |
| run: mkdir -p dist | |
| - name: Create DMG with appdmg | |
| run: | | |
| appdmg appdmg.json dist/Taskito.dmg | |
| - name: Validate DMG | |
| run: hdiutil verify dist/Taskito.dmg | |
| - name: Upload Release Asset | |
| if: github.event_name == 'release' | |
| uses: actions/upload-release-asset@v1 | |
| with: | |
| upload_url: ${{ github.event.release.upload_url }} | |
| asset_path: dist/Taskito.dmg | |
| asset_name: Taskito.dmg | |
| asset_content_type: application/x-apple-diskimage | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Upload DMG as Artifact | |
| if: github.event_name == 'workflow_dispatch' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: Taskito-DMG | |
| path: dist/Taskito.dmg | |
| retention-days: 30 |