Release XCFramework #3
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 XCFramework | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: "Version tag (e.g., 0.1.0)" | |
| required: true | |
| type: string | |
| jobs: | |
| build-and-release: | |
| runs-on: macos-latest | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: "1.25.0" | |
| cache: true | |
| - name: Show Xcode version | |
| run: xcodebuild -version | |
| - name: Build XCFramework | |
| env: | |
| CI: true | |
| run: ./scripts/build-xcframework.sh | |
| - name: Read checksum | |
| id: checksum | |
| run: | | |
| CHECKSUM=$(cat release/TSCBridge.xcframework.zip.sha256) | |
| echo "checksum=${CHECKSUM}" >> $GITHUB_OUTPUT | |
| - name: Create draft release | |
| id: create_release | |
| env: | |
| GH_TOKEN: ${{ secrets.TYPESCRIPT_GO_SWIFT_RELEASE_TOKEN }} | |
| run: | | |
| RELEASE_URL=$(gh release create ${{ inputs.version }} \ | |
| --repo zshannon/typescript-go-swift \ | |
| --draft \ | |
| --title "Release ${{ inputs.version }}" \ | |
| --notes "## TSCBridge XCFramework Release ${{ inputs.version }} | |
| Binary distribution of the TypeScript-Go bridge framework. | |
| ### Checksum | |
| \`\`\` | |
| ${{ steps.checksum.outputs.checksum }} | |
| \`\`\` | |
| ### Usage in Package.swift | |
| \`\`\`swift | |
| .binaryTarget( | |
| name: \"TSCBridgeLib\", | |
| url: \"https://github.com/zshannon/typescript-go-swift/releases/download/${{ inputs.version }}/TSCBridge.xcframework.zip\", | |
| checksum: \"${{ steps.checksum.outputs.checksum }}\" | |
| ) | |
| \`\`\`" \ | |
| ./release/TSCBridge.xcframework.zip \ | |
| ./release/TSCBridge.xcframework.zip.sha256) | |
| echo "html_url=${RELEASE_URL}" >> $GITHUB_OUTPUT | |
| - name: Checkout typescript-go-swift repo | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: zshannon/typescript-go-swift | |
| token: ${{ secrets.TYPESCRIPT_GO_SWIFT_RELEASE_TOKEN }} | |
| path: typescript-go-swift | |
| - name: Update Package.swift with new version | |
| run: | | |
| cd typescript-go-swift | |
| sed -i '' "s|releases/download/[^/]*/|releases/download/${{ inputs.version }}/|g" Package.swift | |
| sed -i '' "s|checksum: \"[^\"]*\"|checksum: \"${{ steps.checksum.outputs.checksum }}\"|g" Package.swift | |
| - name: Create Pull Request | |
| uses: peter-evans/create-pull-request@v7 | |
| with: | |
| token: ${{ secrets.TYPESCRIPT_GO_SWIFT_RELEASE_TOKEN }} | |
| path: typescript-go-swift | |
| commit-message: | | |
| Update Package.swift for release ${{ inputs.version }} | |
| - Update release URL to ${{ inputs.version }} | |
| - Update checksum to ${{ steps.checksum.outputs.checksum }} | |
| 🤖 Generated with [Claude Code](https://claude.com/claude-code) | |
| Co-Authored-By: Claude <[email protected]> | |
| branch: release/${{ inputs.version }} | |
| delete-branch: true | |
| title: "Release TSCBridge ${{ inputs.version }}" | |
| body: | | |
| ## Release TSCBridge ${{ inputs.version }} | |
| This PR updates Package.swift to reference the new XCFramework release. | |
| ### Changes | |
| - Updated release URL to version ${{ inputs.version }} | |
| - Updated checksum to `${{ steps.checksum.outputs.checksum }}` | |
| ### Draft Release | |
| A draft release has been created at: ${{ steps.create_release.outputs.html_url }} | |
| ### Workflow | |
| 1. Review this PR | |
| 2. Merge when ready | |
| 3. The release will be automatically published upon merge | |
| 🤖 Generated with [Claude Code](https://claude.com/claude-code) |