diff --git a/.github/actions/prepare-example-app/action.yml b/.github/actions/prepare-example-app/action.yml deleted file mode 100644 index 40a39c7..0000000 --- a/.github/actions/prepare-example-app/action.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: 'Prepare Example app' -description: 'Does necessary pre-work for the example app to compile natively' - -runs: - using: 'composite' - steps: - - name: 'Build plugin' - shell: bash - run: npm run build - - name: 'Install example app dependencies' - working-directory: ./example-app - shell: bash - run: npm i - - name: 'Build Web example app' - working-directory: ./example-app - shell: bash - run: npm run build - - name: 'Sync example app native platforms' - working-directory: ./example-app - shell: bash - run: npx cap sync diff --git a/.github/actions/setup-tools/action.yml b/.github/actions/setup-tools/action.yml deleted file mode 100644 index addab50..0000000 --- a/.github/actions/setup-tools/action.yml +++ /dev/null @@ -1,13 +0,0 @@ -name: 'Setup Tools' -description: 'Setup tools needed in repo' - -runs: - using: 'composite' - steps: - - name: Install Node.js - uses: actions/setup-node@v7 - with: - node-version: 24 - - name: Install dependencies - shell: bash - run: npm i diff --git a/.github/workflows/continuous_integration.yml b/.github/workflows/continuous_integration.yml index 1adfe81..ebe2572 100644 --- a/.github/workflows/continuous_integration.yml +++ b/.github/workflows/continuous_integration.yml @@ -5,67 +5,50 @@ on: types: [opened, synchronize, reopened] jobs: - setup: - uses: ./.github/workflows/reusable_setup.yml - lint: - needs: 'setup' - uses: ./.github/workflows/reusable_lint.yml + runs-on: "ubuntu-latest" + timeout-minutes: 30 + steps: + - uses: ionic-team/capacitor-actions/lint-plugin@v1.0.0 + with: + working-directory: . + gh-token: ${{ github.token }} build: - needs: 'setup' - uses: ./.github/workflows/reusable_build.yml + runs-on: "ubuntu-latest" + timeout-minutes: 30 + steps: + - uses: ionic-team/capacitor-actions/build-plugin@v1.0.0 + with: + working-directory: . + gh-token: ${{ github.token }} verify-plugin-android: - needs: ['setup', 'lint', 'build'] + needs: ['lint', 'build'] runs-on: 'xcode-27' timeout-minutes: 30 steps: - uses: actions/checkout@v7 - name: 'Setup Tools' - uses: ./.github/actions/setup-tools + uses: ionic-team/capacitor-actions/setup-tools@v1.0.0 + with: + working-directory: . + gh-token: ${{ github.token }} - name: 'Verify Android' + working-directory: . run: npm run verify:android verify-plugin-ios: - needs: ['setup', 'lint', 'build'] + needs: ['lint', 'build'] runs-on: 'xcode-27' timeout-minutes: 30 steps: - uses: actions/checkout@v7 - name: 'Setup Tools' - uses: ./.github/actions/setup-tools - - name: 'Set Xcode version' - run: sudo xcode-select -s /Applications/Xcode_27.0.app/Contents/Developer + uses: ionic-team/capacitor-actions/setup-tools@v1.0.0 + with: + working-directory: . + gh-token: ${{ github.token }} - name: 'Verify iOS' + working-directory: . run: npm run verify:ios - - build-example-app-android: - needs: ['verify-plugin-ios', 'verify-plugin-android'] - runs-on: 'xcode-27' - timeout-minutes: 30 - steps: - - uses: actions/checkout@v7 - - name: 'Setup Tools' - uses: ./.github/actions/setup-tools - - name: 'Prepare example app' - uses: ./.github/actions/prepare-example-app - - name: 'Build Android example app' - working-directory: ./example-app/android - run: ./gradlew clean assembleDebug - - build-example-app-ios: - needs: ['verify-plugin-ios', 'verify-plugin-android'] - runs-on: 'xcode-27' - timeout-minutes: 30 - steps: - - uses: actions/checkout@v7 - - name: 'Setup Tools' - uses: ./.github/actions/setup-tools - - name: 'Set Xcode version' - run: sudo xcode-select -s /Applications/Xcode_27.0.app/Contents/Developer - - name: 'Prepare example app' - uses: ./.github/actions/prepare-example-app - - name: 'Build iOS example app' - working-directory: ./example-app/ios/App - run: xcodebuild clean build -workspace App.xcworkspace -scheme App CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO diff --git a/.github/workflows/create_release_pr.yml b/.github/workflows/create_release_pr.yml new file mode 100644 index 0000000..9984806 --- /dev/null +++ b/.github/workflows/create_release_pr.yml @@ -0,0 +1,49 @@ +name: "Release Plugin" + +on: + workflow_dispatch: + +permissions: + contents: write + issues: write + deployments: write + +jobs: + lint: + runs-on: "ubuntu-latest" + timeout-minutes: 30 + steps: + - uses: ionic-team/capacitor-actions/lint-plugin@v1.0.0 + with: + working-directory: . + gh-token: ${{ github.token }} + + build: + runs-on: "ubuntu-latest" + timeout-minutes: 30 + steps: + - uses: ionic-team/capacitor-actions/build-plugin@v1.0.0 + with: + working-directory: . + gh-token: ${{ github.token }} + + release-please: + needs: ['build', 'lint'] + runs-on: ubuntu-latest + outputs: + release_created: ${{ steps.release.outputs.release_created }} + steps: + - name: 'Setup Environment' + id: setup + uses: ionic-team/capacitor-actions/setup-tools@v1.0.0 + with: + working-directory: . + gh-token: ${{ github.token }} + - name: Run release-please + id: release + uses: googleapis/release-please-action@v5 + with: + token: ${{ github.token }} + config-file: ${{ github.ref_name == 'next' && 'release-please-config-next.json' || 'release-please-config.json' }} + manifest-file: .release-please-manifest.json + target-branch: ${{ github.ref_name }} diff --git a/.github/workflows/release_plugin.yml b/.github/workflows/release_plugin.yml index 5b5b954..2053a26 100644 --- a/.github/workflows/release_plugin.yml +++ b/.github/workflows/release_plugin.yml @@ -1,11 +1,9 @@ name: "Release Plugin" on: - push: - branches: - - development - - next workflow_dispatch: + release: + types: published permissions: contents: write @@ -14,55 +12,31 @@ permissions: id-token: write # to enable use of OIDC for npm provenance and trusted publishing jobs: - setup: - uses: ./.github/workflows/reusable_setup.yml - secrets: - THE_GH_RELEASE_TOKEN: ${{ secrets.CAP_GH_RELEASE_TOKEN }} - lint: - needs: 'setup' - uses: ./.github/workflows/reusable_lint.yml - secrets: - THE_GH_RELEASE_TOKEN: ${{ secrets.CAP_GH_RELEASE_TOKEN }} + runs-on: "ubuntu-latest" + timeout-minutes: 30 + steps: + - uses: ionic-team/capacitor-actions/lint-plugin@v1.0.0 + with: + working-directory: . + gh-token: ${{ github.token }} - build-packages: - needs: 'setup' - uses: ./.github/workflows/reusable_build.yml - secrets: - THE_GH_RELEASE_TOKEN: ${{ secrets.CAP_GH_RELEASE_TOKEN }} + build: + runs-on: "ubuntu-latest" + timeout-minutes: 30 + steps: + - uses: ionic-team/capacitor-actions/build-plugin@v1.0.0 + with: + working-directory: . + gh-token: ${{ github.token }} release: - needs: ['setup','lint','build-packages'] - runs-on: 'ubuntu-24.04' + needs: [ 'lint', 'build'] + runs-on: 'ubuntu-latest' timeout-minutes: 30 steps: - - uses: actions/checkout@v7 + - uses: ionic-team/capacitor-actions/release-plugin-npm@v1.0.0 with: - fetch-depth: 0 - token: ${{ secrets.CAP_GH_RELEASE_TOKEN }} - - name: 'Setup Tools' - uses: ./.github/actions/setup-tools - - name: Release - env: - GITHUB_TOKEN: ${{ secrets.CAP_GH_RELEASE_TOKEN }} - GH_TOKEN: ${{ secrets.CAP_GH_RELEASE_TOKEN }} - run: npx semantic-release - - publish-pod: - needs: release - uses: ./.github/workflows/publish_pod.yml - secrets: - COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }} - CAP_GH_RELEASE_TOKEN: ${{ secrets.CAP_GH_RELEASE_TOKEN }} - - publish-android: - needs: release - uses: ./.github/workflows/publish_maven_central.yml - secrets: - ANDROID_CENTRAL_USERNAME: ${{ secrets.ANDROID_CENTRAL_USERNAME }} - ANDROID_CENTRAL_PASSWORD: ${{ secrets.ANDROID_CENTRAL_PASSWORD }} - ANDROID_SIGNING_KEY_ID: ${{ secrets.ANDROID_SIGNING_KEY_ID }} - ANDROID_SIGNING_KEY: ${{ secrets.ANDROID_SIGNING_KEY }} - ANDROID_SIGNING_PASSWORD: ${{ secrets.ANDROID_SIGNING_PASSWORD }} - ANDROID_SONATYPE_STAGING_PROFILE_ID: ${{ secrets.ANDROID_SONATYPE_STAGING_PROFILE_ID }} - CAP_GH_RELEASE_TOKEN: ${{ secrets.CAP_GH_RELEASE_TOKEN }} + working-directory: . + gh-token: ${{ github.token }} + npm-tag: ${{ github.ref_name == 'next' && 'next' || 'latest' }} diff --git a/.github/workflows/reusable_build.yml b/.github/workflows/reusable_build.yml deleted file mode 100644 index c1f9659..0000000 --- a/.github/workflows/reusable_build.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: "Build Plugin" - -on: - workflow_call: - secrets: - THE_GH_RELEASE_TOKEN: - required: false - -jobs: - build: - runs-on: 'ubuntu-24.04' - timeout-minutes: 30 - steps: - - uses: actions/checkout@v7 - with: - fetch-depth: 0 - token: ${{ secrets.THE_GH_RELEASE_TOKEN || github.token }} - - - name: 'Setup Tools' - uses: ./.github/actions/setup-tools - - - name: 'Copy README.md in root' - run: cp README.md README.md.original - - - name: 'Build Packages' - run: npm run build - - - name: 'Check README.md changes' - run: | - if ! cmp --silent README.md README.md.original; then - echo "Detected README.md changes; Do 'npm run build' to update the docs." - exit 1 - fi diff --git a/.github/workflows/reusable_lint.yml b/.github/workflows/reusable_lint.yml deleted file mode 100644 index ed1f8dd..0000000 --- a/.github/workflows/reusable_lint.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: "Lint Plugin" - -on: - workflow_call: - secrets: - THE_GH_RELEASE_TOKEN: - required: false - -jobs: - lint: - runs-on: 'xcode-27' - timeout-minutes: 30 - steps: - - uses: actions/checkout@v7 - with: - token: ${{ secrets.THE_GH_RELEASE_TOKEN || github.token }} - - - name: 'Setup Tools' - uses: ./.github/actions/setup-tools - - - name: 'Lint Packages' - run: npm run lint diff --git a/.github/workflows/reusable_setup.yml b/.github/workflows/reusable_setup.yml deleted file mode 100644 index ea837cc..0000000 --- a/.github/workflows/reusable_setup.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: "Setup" - -on: - workflow_call: - secrets: - THE_GH_RELEASE_TOKEN: - required: false - -jobs: - setup: - strategy: - matrix: - os: ['ubuntu-24.04', 'xcode-27'] - runs-on: ${{ matrix.os }} - timeout-minutes: 30 - steps: - - uses: actions/checkout@v7 - with: - token: ${{ secrets.THE_GH_RELEASE_TOKEN || github.token }} - - - name: 'Setup Tools' - uses: ./.github/actions/setup-tools \ No newline at end of file diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 0000000..14df239 --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "9.0.0-beta.0" +} diff --git a/release-please-config-next.json b/release-please-config-next.json new file mode 100644 index 0000000..537c924 --- /dev/null +++ b/release-please-config-next.json @@ -0,0 +1,16 @@ +{ + "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json", + "release-type": "node", + "prerelease-type": "beta", + "prerelease": true, + "packages": { + ".": { + "package-name": "@capacitor/geolocation", + "changelog-path": "CHANGELOG.md", + "include-component-in-tag": false, + "bump-minor-pre-major": true, + "bump-patch-for-minor-pre-major": true, + "versioning": "prerelease" + } + } +} diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 0000000..b44acba --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,13 @@ +{ + "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json", + "release-type": "node", + "packages": { + ".": { + "package-name": "@capacitor/geolocation", + "changelog-path": "CHANGELOG.md", + "include-component-in-tag": false, + "bump-minor-pre-major": true, + "bump-patch-for-minor-pre-major": true + } + } +}