Fix window management bugs and file dialog issues #6
Workflow file for this run
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 | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: 'Version tag (e.g., 1.0.0)' | |
| required: true | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| runs-on: macos-14 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Xcode | |
| uses: maxim-lobanov/setup-xcode@v1 | |
| with: | |
| xcode-version: latest-stable | |
| - name: Get version | |
| id: version | |
| run: | | |
| if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then | |
| VERSION="${{ github.event.inputs.version }}" | |
| elif [[ "${{ github.ref }}" == refs/tags/* ]]; then | |
| VERSION="${GITHUB_REF#refs/tags/v}" | |
| else | |
| echo "Error: Version is required. Use a tag (v*) or workflow_dispatch with version input." | |
| exit 1 | |
| fi | |
| echo "VERSION=$VERSION" >> $GITHUB_ENV | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| - name: Build app | |
| run: | | |
| xcodebuild \ | |
| -scheme Shark \ | |
| -configuration Release \ | |
| -derivedDataPath build \ | |
| -destination 'platform=macOS' \ | |
| CODE_SIGN_IDENTITY="" \ | |
| CODE_SIGNING_REQUIRED=NO \ | |
| CODE_SIGNING_ALLOWED=NO \ | |
| clean build | |
| - name: Create DMG | |
| run: | | |
| APP_PATH=$(find build -name "Shark.app" -type d | head -n 1) | |
| if [ -z "$APP_PATH" ]; then | |
| echo "Error: Could not find built app" | |
| exit 1 | |
| fi | |
| # Create temporary directory | |
| TMP_DIR=$(mktemp -d) | |
| cp -R "$APP_PATH" "$TMP_DIR/" | |
| ln -s /Applications "$TMP_DIR/Applications" | |
| DMG_NAME="Shark-${VERSION}.dmg" | |
| # Create DMG using hdiutil | |
| hdiutil create -volname "Shark" -srcfolder "$TMP_DIR" -ov -format UDZO "$DMG_NAME" | |
| # Clean up | |
| rm -rf "$TMP_DIR" | |
| # Calculate checksum | |
| shasum -a 256 "$DMG_NAME" > "${DMG_NAME}.sha256" | |
| echo "DMG_NAME=$DMG_NAME" >> $GITHUB_ENV | |
| - name: Upload DMG artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: Shark-${{ env.VERSION }}-dmg | |
| path: | | |
| Shark-${{ env.VERSION }}.dmg | |
| Shark-${{ env.VERSION }}.dmg.sha256 | |
| retention-days: 30 | |
| - name: Create Release | |
| if: startsWith(github.ref, 'refs/tags/') | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| files: | | |
| Shark-${{ env.VERSION }}.dmg | |
| Shark-${{ env.VERSION }}.dmg.sha256 | |
| draft: false | |
| prerelease: false | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |