release: v2.2.1 — fix app icon not showing in DMG/Finder #25
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 & Test | |
| permissions: | |
| contents: write | |
| on: | |
| push: | |
| branches: [main] | |
| tags: ['v*'] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| build-cli: | |
| name: Build CLI | |
| runs-on: macos-15 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Build CLI (Release) | |
| run: swift build -c release | |
| - name: Run CLI smoke tests | |
| run: | | |
| .build/release/dx --version | |
| .build/release/dx uuid | |
| .build/release/dx hash "test" | |
| .build/release/dx base64 encode "hello" | |
| .build/release/dx epoch now | |
| - name: Upload CLI binary | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: dx-cli | |
| path: .build/release/dx | |
| build-app: | |
| name: Build macOS App | |
| runs-on: macos-15 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install XcodeGen | |
| run: brew install xcodegen | |
| - name: Generate Xcode Project | |
| run: xcodegen generate | |
| - name: Build App (Release) | |
| run: | | |
| xcodebuild -project DXTools.xcodeproj \ | |
| -scheme DXTools \ | |
| -configuration Release \ | |
| -derivedDataPath build/DerivedData \ | |
| build | |
| - name: Run Tests | |
| run: | | |
| xcodebuild -project DXTools.xcodeproj \ | |
| -scheme DXToolsTests \ | |
| -configuration Debug \ | |
| -derivedDataPath build/DerivedData \ | |
| CI_ENVIRONMENT=YES \ | |
| test | |
| release: | |
| name: Create Release | |
| needs: [build-cli, build-app] | |
| runs-on: macos-15 | |
| if: startsWith(github.ref, 'refs/tags/v') || (github.ref == 'refs/heads/main' && startsWith(github.event.head_commit.message, 'release:')) | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install XcodeGen | |
| run: brew install xcodegen | |
| - name: Build CLI | |
| run: swift build -c release | |
| - name: Build App | |
| run: | | |
| xcodegen generate | |
| xcodebuild -project DXTools.xcodeproj \ | |
| -scheme DXTools \ | |
| -configuration Release \ | |
| -derivedDataPath build/DerivedData \ | |
| build | |
| - name: Build .icns from asset catalog | |
| run: | | |
| ICONSET="build/AppIcon.iconset" | |
| mkdir -p "$ICONSET" | |
| SRC="DXTools/Assets.xcassets/AppIcon.appiconset" | |
| for f in icon_16x16.png [email protected] icon_32x32.png [email protected] \ | |
| icon_128x128.png [email protected] icon_256x256.png [email protected] \ | |
| icon_512x512.png [email protected]; do | |
| cp "$SRC/$f" "$ICONSET/$f" | |
| done | |
| iconutil --convert icns "$ICONSET" --output build/AppIcon.icns | |
| - name: Package DMG | |
| run: | | |
| APP_PATH="build/DerivedData/Build/Products/Release/DX Tools.app" | |
| mkdir -p build/dmg-staging | |
| cp -R "$APP_PATH" build/dmg-staging/ | |
| ln -s /Applications build/dmg-staging/Applications | |
| # Set volume icon | |
| cp build/AppIcon.icns build/dmg-staging/.VolumeIcon.icns | |
| SetFile -a C build/dmg-staging 2>/dev/null || true | |
| hdiutil create -volname "DX Tools" \ | |
| -srcfolder build/dmg-staging \ | |
| -ov -format UDZO \ | |
| build/DXTools.dmg | |
| rm -rf build/dmg-staging | |
| - name: Extract version | |
| id: version | |
| run: echo "version=$(grep 'MARKETING_VERSION' project.yml | head -1 | awk '{print $2}' | tr -d '\"')" >> $GITHUB_OUTPUT | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: v${{ steps.version.outputs.version }} | |
| name: DX Tools v${{ steps.version.outputs.version }} | |
| make_latest: true | |
| body: | | |
| ## DX Tools v${{ steps.version.outputs.version }} | |
| ### Downloads | |
| - **DXTools.dmg** — macOS app (drag to Applications) | |
| - **dx** — CLI binary (copy to `~/bin/` or `/usr/local/bin/`) | |
| ### Install via Homebrew | |
| ``` | |
| brew tap openstruct/tap && brew install dx-tools | |
| ``` | |
| ### What's Included | |
| - 33 developer tools in one native macOS app | |
| - CLI with 10 subcommands: json, jwt, epoch, env, hash, base64, uuid, color, pass, port | |
| - 300 tests, zero dependencies, ~3 MB | |
| files: | | |
| build/DXTools.dmg | |
| .build/release/dx | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |