diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 50d2cdc..7346c35 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -49,41 +49,6 @@ jobs: exit 0 fi "${{ runner.temp }}/wfctl-bin/wfctl" plugin verify-capabilities --binary "$BIN" . - - name: Sync manifest to registry - if: success() && env.GH_TOKEN != '' - continue-on-error: true - env: - GH_TOKEN: ${{ secrets.REGISTRY_PAT }} - run: | - git clone "https://x-access-token:${GH_TOKEN}@github.com/GoCodeAlone/workflow-registry.git" /tmp/registry - mkdir -p /tmp/registry/plugins/openlms - TAG=${GITHUB_REF#refs/tags/} - VERSION=${TAG#v} - jq --arg v "$VERSION" '.version = $v' plugin.json > /tmp/registry/plugins/openlms/manifest.json - cd /tmp/registry - git config user.name "github-actions[bot]" - git config user.email "github-actions[bot]@users.noreply.github.com" - git add plugins/openlms/manifest.json - git diff --cached --quiet || git commit -m "chore: sync openlms plugin manifest v${VERSION}" - git push - - notify-registry: - if: startsWith(github.ref, 'refs/tags/v') - needs: [release] - runs-on: ubuntu-latest - steps: - - name: Notify workflow-registry - if: env.GH_TOKEN != '' - uses: peter-evans/repository-dispatch@v3 - with: - token: ${{ secrets.REGISTRY_PAT }} - repository: GoCodeAlone/workflow-registry - event-type: plugin-release - client-payload: >- - {"plugin": "${{ github.repository }}", "tag": "${{ github.ref_name }}"} - env: - GH_TOKEN: ${{ secrets.REGISTRY_PAT }} - continue-on-error: true - name: Publish GitHub release uses: actions/github-script@v7 with: @@ -112,3 +77,23 @@ jobs: draft: false, }); } + + notify-workflow-registry: + name: Notify workflow-registry + runs-on: ubuntu-latest + permissions: + contents: read + needs: release + if: >- + !github.event.deleted + && !contains(github.ref_name, '-') + && github.repository == 'GoCodeAlone/workflow-plugin-openlms' + steps: + - name: Trigger registry manifest sync + uses: peter-evans/repository-dispatch@28959ce8df70de7be546dd1250a005dd32156697 # v4 + with: + token: ${{ secrets.repo_dispatch_token }} + repository: GoCodeAlone/workflow-registry + event-type: plugin-release + client-payload: |- + {"plugin": "openlms", "tag": "${{ github.ref_name }}"}