diff --git a/.github/workflows/build-and-release.yaml b/.github/workflows/build-and-release.yaml new file mode 100644 index 0000000..842f33c --- /dev/null +++ b/.github/workflows/build-and-release.yaml @@ -0,0 +1,42 @@ +name: Build and Release + +on: + workflow_call: + inputs: + release-version: + required: true + type: string + draft-flag: + type: string + default: -draft + secrets: + XCFRAMEWORK_SIGNING_TOKEN: + required: true + +jobs: + build: + runs-on: macos-14 + timeout-minutes: 30 + steps: + - run: sudo xcode-select --switch /Applications/Xcode_15.1.app + - uses: actions/checkout@v4 + - name: Install dependencies + run: brew install ghr + - name: Build Capacitor and Cordova + run: ./build-cap ${{ inputs.release-version }} + - name: Sign Capacitor xcframework + uses: ionic-team/sign-xcframework@main + with: + cert-token: ${{ secrets.XCFRAMEWORK_SIGNING_TOKEN }} + xcframework-path: Capacitor.xcframework + - name: Sign Cordova xcframework + uses: ionic-team/sign-xcframework@main + with: + cert-token: ${{ secrets.XCFRAMEWORK_SIGNING_TOKEN }} + xcframework-path: Cordova.xcframework + - name: Package Capacitor and Cordova + run: ./package-cap ${{ inputs.release-version }} + - name: Push manifest update + uses: EndBug/add-and-commit@v9 + - name: Create Release + run: ghr -token ${{ secrets.GITHUB_TOKEN }} -name ${{ inputs.release-version }} ${{ inputs.draft-flag }} -replace ${{ inputs.release-version }} frameworks diff --git a/.github/workflows/dispatch-release.yaml b/.github/workflows/dispatch-release.yaml new file mode 100644 index 0000000..be89b95 --- /dev/null +++ b/.github/workflows/dispatch-release.yaml @@ -0,0 +1,24 @@ +name: Dispatch Release + +on: + workflow_dispatch: + inputs: + release-version: + description: The version to release + required: true + type: string + draft-flag: + description: "Create a Draft Release or Immediately Release" + type: choice + default: -draft + options: + - -draft + - "" + +jobs: + create-release: + uses: ./.github/workflows/build-and-release.yaml + with: + release-version: ${{ inputs.release-version }} + draft-flag: ${{ inputs.draft-flag }} + secrets: inherit diff --git a/.github/workflows/pre-release.yml b/.github/workflows/pre-release.yml index 8591455..761270f 100644 --- a/.github/workflows/pre-release.yml +++ b/.github/workflows/pre-release.yml @@ -6,33 +6,16 @@ on: - "release/**" jobs: - build: - runs-on: macos-14 - timeout-minutes: 30 + release-version: + runs-on: ubuntu-latest + outputs: + release-version: ${{ steps.step1.outputs.release_version }} steps: - - run: sudo xcode-select --switch /Applications/Xcode_15.1.app - - uses: actions/checkout@v4 - - name: Install build dependencies - run: | - gem install cocoapods xcpretty - brew install ghr - - name: Assign version to RELEASE_VERSION environment variable - run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/*/}" >> $GITHUB_ENV - - name: Build Capacitor and Cordova - run: ./build-cap $RELEASE_VERSION - - name: Sign Capacitor xcframework - uses: ionic-team/sign-xcframework@main - with: - cert-token: ${{ secrets.XCFRAMEWORK_SIGNING_TOKEN }} - xcframework-path: Capacitor.xcframework - - name: Sign Cordova xcframework - uses: ionic-team/sign-xcframework@main - with: - cert-token: ${{ secrets.XCFRAMEWORK_SIGNING_TOKEN }} - xcframework-path: Cordova.xcframework - - name: Package Capacitor and Cordova - run: ./package-cap $RELEASE_VERSION - - name: Push manifest update - uses: EndBug/add-and-commit@v9 - - name: Create Draft Release - run: ghr -token ${{ secrets.GITHUB_TOKEN }} -name ${{ env.RELEASE_VERSION }} -draft -replace ${{ env.RELEASE_VERSION }} frameworks + - id: step1 + run: echo "release_version=${GITHUB_REF#refs/*/*/}" >> $GITHUB_OUTPUT + create-pre-release: + needs: release-version + uses: ./.github/workflows/build-and-release.yaml + with: + release-version: ${{ needs.release-version.outputs.release-version }} + secrets: inherit diff --git a/Package.swift b/Package.swift index 01cc7f7..612bf59 100644 --- a/Package.swift +++ b/Package.swift @@ -18,13 +18,13 @@ let package = Package( targets: [ .binaryTarget( name: "Capacitor", - url: "https://github.com/ionic-team/capacitor-swift-pm/releases/download/5.7.4/Capacitor.xcframework.zip", - checksum: "3fe57f27e8b578518d0e3bd3ef08046297ff71a0af9610f16c4a7e6bbb5dc033" + url: "https://github.com/ionic-team/capacitor-swift-pm/releases/download/6.0.0-rc.1/Capacitor.xcframework.zip", + checksum: "d539c13cc2dd18aba58e5dd14becbd921831249d76eedfa294f6cbca3bd2c0c1" ), .binaryTarget( name: "Cordova", - url: "https://github.com/ionic-team/capacitor-swift-pm/releases/download/5.7.4/Cordova.xcframework.zip", - checksum: "c5638dab59595073d6ca72a8f0faf844d4097a2c873efe07b2781bc92c6057c3" + url: "https://github.com/ionic-team/capacitor-swift-pm/releases/download/6.0.0-rc.1/Cordova.xcframework.zip", + checksum: "dfbd22684bca35cea5e9849d2f2b2f13ab419132cb5c6e681e300b80f1546971" ) ] )