Fix release script invocation #110
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: Release | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - fix-release | |
| jobs: | |
| fetch_prebuilts: | |
| uses: ./.github/workflows/prebuild_assets.yml | |
| draft_release: | |
| if: false | |
| permissions: | |
| contents: write | |
| name: Create Draft Release on GitHub | |
| runs-on: ubuntu-latest | |
| outputs: | |
| tag: ${{ steps.tag.outputs.tag }} | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set tag name | |
| id: tag | |
| run: | | |
| tag=$(basename "${{ github.ref }}") | |
| echo "tag=$tag" >> $GITHUB_OUTPUT | |
| - name: Create Release | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| GH_REPO: ${{ github.repository }} | |
| run: | | |
| tag="${{ steps.tag.outputs.tag }}" | |
| body="Pending release for XCFramework, $tag" | |
| gh release create --draft "$tag" --title "$tag" --notes "$body" | |
| maven_publish: | |
| runs-on: macos-latest | |
| needs: | |
| - fetch_prebuilts | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Validate Gradle Wrapper | |
| uses: gradle/wrapper-validation-action@v1 | |
| - uses: actions/cache@v3 | |
| with: | |
| path: ~/.konan | |
| key: ${{ runner.os }}-${{ hashFiles('**/.lock') }} | |
| - name: Set up JDK 25 | |
| uses: actions/setup-java@v3 | |
| with: | |
| java-version: '25' | |
| distribution: 'temurin' | |
| - name: Set up Gradle | |
| uses: gradle/actions/setup-gradle@v4 | |
| - name: Download prebuilts | |
| uses: actions/download-artifact@v5 | |
| with: | |
| artifact-ids: ${{ needs.fetch_prebuilts.outputs.artifact_id }} | |
| path: internal/prebuild-binaries/build/output/ | |
| - name: Gradle publish | |
| run: | | |
| ./gradlew \ | |
| --no-configuration-cache \ | |
| -PhasPrebuiltAssets=true \ | |
| -PGITHUB_PUBLISH_TOKEN="${{ secrets.GITHUB_TOKEN }}" \ | |
| -PsigningInMemoryKey="${{ secrets.SIGNING_KEY }}" \ | |
| -PsigningInMemoryKeyId="${{ secrets.SIGNING_KEY_ID }}" \ | |
| -PsigningInMemoryKeyPassword="${{ secrets.SIGNING_PASSWORD }}" \ | |
| -PcentralPortal.username="${{secrets.SONATYPE_USERNAME}}" \ | |
| -PcentralPortal.password="${{secrets.SONATYPE_PASSWORD}}" \ | |
| -Ppowersync.binaries.allPlatforms="true" \ | |
| publishAllPublicationsToSonatypeRepository | |
| shell: bash | |
| build_xcframeworks: | |
| name: Build XCFrameworks | |
| if: false | |
| needs: | |
| - fetch_prebuilts | |
| runs-on: macos-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Validate Gradle Wrapper | |
| uses: gradle/wrapper-validation-action@v1 | |
| - uses: actions/cache@v3 | |
| with: | |
| path: ~/.konan | |
| key: ${{ runner.os }}-${{ hashFiles('**/.lock') }} | |
| - name: Set up JDK 25 | |
| uses: actions/setup-java@v3 | |
| with: | |
| java-version: '25' | |
| distribution: 'temurin' | |
| - name: Set up Gradle | |
| uses: gradle/actions/setup-gradle@v4 | |
| with: | |
| cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }} | |
| - name: Download prebuilts | |
| uses: actions/download-artifact@v5 | |
| with: | |
| artifact-ids: ${{ needs.fetch_prebuilts.outputs.artifact_id }} | |
| path: internal/prebuild-binaries/build/output/ | |
| - name: Build frameworks | |
| run: "./gradlew -PhasPrebuiltAssets=true internal:PowerSyncKotlin:buildRelease" | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: XCFramework | |
| retention-days: 1 # Only used temporarily | |
| compression-level: 0 # We're already uploading a compressed file | |
| path: internal/PowerSyncKotlin/build/FrameworkArchives/PowersyncKotlinRelease.zip | |
| if-no-files-found: error | |
| add_assets: | |
| permissions: | |
| contents: write | |
| needs: [draft_release, build_xcframeworks, fetch_prebuilts] | |
| if: false | |
| name: Add assets to pending release | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: XCFramework | |
| - name: Download prebuilts | |
| uses: actions/download-artifact@v5 | |
| with: | |
| artifact-ids: ${{ needs.fetch_prebuilts.outputs.artifact_id }} | |
| path: internal/prebuild-binaries/build/output/ | |
| - name: Archive prebuilts | |
| run: | | |
| find internal/prebuild-binaries/build/output | |
| zip -r prebuilt_libraries.zip internal/prebuild-binaries/build/output/ | |
| - name: Upload XCFramework | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| GH_REPO: ${{ github.repository }} | |
| run: | | |
| gh release upload "${{ needs.draft_release.outputs.tag }}" PowersyncKotlinRelease.zip | |
| gh release upload "${{ needs.draft_release.outputs.tag }}" prebuilt_libraries.zip | |
| - name: "Update release description" | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| GH_REPO: ${{ github.repository }} | |
| shell: bash | |
| run: | | |
| checksums=$(sha256sum PowersyncKotlinRelease.zip) | |
| cat > RELEASE_NOTES <<- NOTES_END | |
| File hashes: | |
| \`\`\` | |
| $checksums | |
| \`\`\` | |
| NOTES_END | |
| gh release edit "${{ needs.draft_release.outputs.tag }}" -F RELEASE_NOTES |