diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index edccba2..ae4b205 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -164,14 +164,11 @@ jobs: prerelease: ${{ needs.prepare.outputs.is_prerelease == 'true' }} trigger-publisher: - name: Trigger Release Publisher + name: Publish Release Packages needs: [prepare, release] - # Dispatch the techprimate/publisher workflow that publishes this GitHub - # Release through packages.techprimate.com. Replaces the in-repo Homebrew tap - # automation. if: startsWith(github.ref, 'refs/tags/v') runs-on: ubuntu-latest - timeout-minutes: 5 + timeout-minutes: 55 steps: - name: Generate GitHub App token id: app-token @@ -181,16 +178,42 @@ jobs: private-key: ${{ secrets.TECHPRIMATE_RELEASE_BOT_PRIVATE_KEY }} repositories: publisher owner: techprimate + permission-actions: write - name: Dispatch publish workflow + id: dispatch + uses: actions/github-script@v9 + env: + SOURCE_REPO: ${{ github.repository }} + TAG: ${{ needs.prepare.outputs.publish_tag }} + with: + github-token: ${{ steps.app-token.outputs.token }} + script: | + const { data } = await github.rest.actions.createWorkflowDispatch({ + owner: 'techprimate', + repo: 'publisher', + workflow_id: 'publish.yml', + ref: 'main', + inputs: { + source_repo: process.env.SOURCE_REPO, + tag: process.env.TAG, + }, + return_run_details: true, + headers: { 'X-GitHub-Api-Version': '2022-11-28' }, + }); + core.setOutput('run-id', data.workflow_run_id); + core.info(`Publisher run: ${data.html_url}`); + await core.summary.addRaw(`Publisher run: ${data.html_url}\n`).write(); + + - name: Wait for publisher env: GH_TOKEN: ${{ steps.app-token.outputs.token }} + RUN_ID: ${{ steps.dispatch.outputs.run-id }} run: | - gh workflow run publish.yml \ + gh run watch "$RUN_ID" \ --repo techprimate/publisher \ - --ref main \ - -f source_repo="${{ github.repository }}" \ - -f tag="${{ needs.prepare.outputs.publish_tag }}" + --interval 15 \ + --exit-status release-required-check: name: Release - Required Check