|
17 | 17 | runs-on: ubuntu-latest |
18 | 18 | permissions: |
19 | 19 | contents: write |
20 | | - actions: write |
21 | 20 | steps: |
22 | 21 | - uses: actions/checkout@v7 |
23 | 22 | with: |
@@ -79,29 +78,14 @@ jobs: |
79 | 78 |
|
80 | 79 | - name: Commit, tag, push |
81 | 80 | if: steps.diff.outputs.changed == 'true' || github.event_name == 'workflow_dispatch' |
82 | | - env: |
83 | | - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
84 | 81 | run: | |
85 | 82 | git config user.name "github-actions[bot]" |
86 | 83 | git config user.email "github-actions[bot]@users.noreply.github.com" |
87 | 84 | VERSION="${{ steps.bump.outputs.version }}" |
88 | 85 | git add composer.json package.json src/Version.php specs/openapi.json src/Roxy.php src/Generated tests/Generated README.md AGENTS.md |
89 | 86 | git commit -m "release: v$VERSION" |
90 | 87 | git tag "v$VERSION" |
91 | | - # Protected main requires the ci-ok context green on every pushed SHA, and a direct push can never carry one. So park the commit on a temp branch, run the real CI there via workflow_dispatch (GITHUB_TOKEN pushes trigger no workflows on their own), and push to main only after it reports green. |
92 | | - SHA=$(git rev-parse HEAD) |
93 | | - git push --force origin "HEAD:refs/heads/release-checks" |
94 | | - gh workflow run ci.yml --ref release-checks |
95 | | - RUN_ID="" |
96 | | - for _ in $(seq 1 24); do |
97 | | - sleep 5 |
98 | | - RUN_ID=$(gh run list --workflow=ci.yml --branch=release-checks --limit 5 --json databaseId,headSha --jq "[.[] | select(.headSha == \"$SHA\")][0].databaseId // empty") |
99 | | - [ -n "$RUN_ID" ] && break |
100 | | - done |
101 | | - [ -n "$RUN_ID" ] || { echo "dispatched CI run never appeared for $SHA"; exit 1; } |
102 | | - gh run watch "$RUN_ID" --exit-status |
103 | 88 | git push --follow-tags |
104 | | - git push origin --delete release-checks || true |
105 | 89 |
|
106 | 90 | - name: Create GitHub release |
107 | 91 | if: steps.diff.outputs.changed == 'true' || github.event_name == 'workflow_dispatch' |
|
0 commit comments