fix: resolve user login shell environment and throttle gh API calls #48
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: Release | |
| on: | |
| push: | |
| branches: [main] | |
| release: | |
| types: [created] | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| release-please: | |
| if: github.event_name == 'push' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: googleapis/release-please-action@v4 | |
| with: | |
| token: ${{ secrets.RELEASE_PAT }} | |
| build: | |
| if: github.event_name == 'release' | |
| runs-on: macos-26 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Resolve version and tag | |
| id: meta | |
| run: | | |
| TAG="${{ github.event.release.tag_name }}" | |
| VERSION="${TAG#v}" | |
| echo "tag=$TAG" >> "$GITHUB_OUTPUT" | |
| echo "version=$VERSION" >> "$GITHUB_OUTPUT" | |
| - name: Build release binary | |
| run: swift build -c release | |
| - name: Create app bundle | |
| env: | |
| VERSION: ${{ steps.meta.outputs.version }} | |
| run: | | |
| ARCH=$(uname -m) | |
| BUNDLE_DIR=build/KanbanCode.app | |
| mkdir -p "$BUNDLE_DIR/Contents/MacOS" | |
| mkdir -p "$BUNDLE_DIR/Contents/Resources" | |
| cp ".build/${ARCH}-apple-macosx/release/KanbanCode" "$BUNDLE_DIR/Contents/MacOS/KanbanCode" | |
| cp Sources/KanbanCode/Resources/AppIcon.icns "$BUNDLE_DIR/Contents/Resources/AppIcon.icns" | |
| cat > "$BUNDLE_DIR/Contents/Info.plist" <<PLIST | |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
| <plist version="1.0"><dict> | |
| <key>CFBundleExecutable</key><string>KanbanCode</string> | |
| <key>CFBundleIdentifier</key><string>com.kanban-code.app</string> | |
| <key>CFBundleName</key><string>Kanban Code</string> | |
| <key>CFBundleVersion</key><string>${VERSION}</string> | |
| <key>CFBundleShortVersionString</key><string>${VERSION}</string> | |
| <key>CFBundlePackageType</key><string>APPL</string> | |
| <key>LSMinimumSystemVersion</key><string>15.0</string> | |
| <key>NSHighResolutionCapable</key><true/> | |
| <key>LSUIElement</key><false/> | |
| <key>CFBundleIconFile</key><string>AppIcon</string> | |
| <key>CFBundleIconName</key><string>AppIcon</string> | |
| </dict></plist> | |
| PLIST | |
| # Copy SPM bundle resources | |
| if [ -d ".build/${ARCH}-apple-macosx/release/KanbanCode_KanbanCode.bundle" ]; then | |
| cp -R ".build/${ARCH}-apple-macosx/release/KanbanCode_KanbanCode.bundle" "$BUNDLE_DIR/Contents/Resources/" | |
| fi | |
| codesign --force --sign - "$BUNDLE_DIR" | |
| cd build | |
| zip -ry "KanbanCode-${VERSION}-macos.zip" KanbanCode.app | |
| - name: Upload to release | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| gh release upload "${{ steps.meta.outputs.tag }}" \ | |
| "build/KanbanCode-${{ steps.meta.outputs.version }}-macos.zip" |