|
19 | 19 | permissions: |
20 | 20 | contents: write |
21 | 21 | id-token: write |
22 | | - actions: write |
23 | 22 | steps: |
24 | 23 | - uses: actions/checkout@v7 |
25 | 24 | with: |
@@ -96,29 +95,14 @@ jobs: |
96 | 95 |
|
97 | 96 | - name: Commit, tag, push |
98 | 97 | if: steps.diff.outputs.changed == 'true' || github.event_name == 'workflow_dispatch' |
99 | | - env: |
100 | | - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
101 | 98 | run: | |
102 | 99 | git config user.name "github-actions[bot]" |
103 | 100 | git config user.email "github-actions[bot]@users.noreply.github.com" |
104 | 101 | VERSION=${{ steps.bump.outputs.version }} |
105 | 102 | git add specs/openapi.json src/ README.md AGENTS.md docs/llms-full.txt tests/RoxyApi.Tests/Generated |
106 | 103 | git commit -m "release: v$VERSION" |
107 | 104 | git tag "v$VERSION" |
108 | | - # 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. |
109 | | - SHA=$(git rev-parse HEAD) |
110 | | - git push --force origin "HEAD:refs/heads/release-checks" |
111 | | - gh workflow run ci.yml --ref release-checks |
112 | | - RUN_ID="" |
113 | | - for _ in $(seq 1 24); do |
114 | | - sleep 5 |
115 | | - RUN_ID=$(gh run list --workflow=ci.yml --branch=release-checks --limit 5 --json databaseId,headSha --jq "[.[] | select(.headSha == \"$SHA\")][0].databaseId // empty") |
116 | | - [ -n "$RUN_ID" ] && break |
117 | | - done |
118 | | - [ -n "$RUN_ID" ] || { echo "dispatched CI run never appeared for $SHA"; exit 1; } |
119 | | - gh run watch "$RUN_ID" --exit-status |
120 | 105 | git push --follow-tags |
121 | | - git push origin --delete release-checks || true |
122 | 106 |
|
123 | 107 | - name: Create GitHub release |
124 | 108 | if: steps.diff.outputs.changed == 'true' || github.event_name == 'workflow_dispatch' |
|
0 commit comments