Skip to content

Commit 522dbc7

Browse files
uipreligaclaude
andauthored
ci: make Azure feed + GHCR best-effort; tag only after PyPI publishes (#9)
The release reached publishing but failed at the private Azure feed step (401 Unauthorized - expired PAT), which skipped the public PyPI publish (publish-pypi needs: release). The Azure feed and GHCR image are UiPath-internal targets and must not gate the public release. - continue-on-error on the Azure feed + the three GHCR steps, so their failure no longer blocks the release job (and thus PyPI). - Move the `v<version>` tag push into a dedicated tag-release job that needs [release, publish-pypi], so the tag lands only after PyPI has actually published -- a failed publish no longer leaves a tag that the re-release guard would block on retry. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 4bd3c6a commit 522dbc7

1 file changed

Lines changed: 31 additions & 12 deletions

File tree

.github/workflows/release.yml

Lines changed: 31 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,9 @@ jobs:
9393
if-no-files-found: error
9494

9595
- name: Publish to coder_eval feed
96+
# Best-effort: the private Azure feed is a UiPath-internal target; its
97+
# failure (e.g. an expired PAT) must NOT block the public PyPI publish.
98+
continue-on-error: true
9699
if: steps.release.outputs.version != ''
97100
env:
98101
# Azure Artifacts accepts any non-empty username when paired with a
@@ -113,10 +116,12 @@ jobs:
113116
run: echo "owner_lc=$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" >> "$GITHUB_OUTPUT"
114117

115118
- name: Set up Docker Buildx
119+
continue-on-error: true # GHCR image is internal/best-effort; don't block PyPI
116120
if: steps.release.outputs.version != ''
117121
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0
118122

119123
- name: Log in to GHCR
124+
continue-on-error: true # GHCR image is internal/best-effort; don't block PyPI
120125
if: steps.release.outputs.version != ''
121126
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3.7.0
122127
with:
@@ -125,6 +130,7 @@ jobs:
125130
password: ${{ secrets.GITHUB_TOKEN }}
126131

127132
- name: Build and push versioned agent image
133+
continue-on-error: true # GHCR image is internal/best-effort; don't block PyPI
128134
if: steps.release.outputs.version != ''
129135
uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6.19.2
130136
with:
@@ -143,18 +149,6 @@ jobs:
143149
# back from here, to avoid two concurrent writers racing the cache tag.
144150
cache-from: type=registry,ref=ghcr.io/${{ steps.img.outputs.owner_lc }}/coder-eval-agent:buildcache
145151

146-
# Tag LAST, once the artifacts are built + the feeds/image published, so a
147-
# `v<version>` tag reliably marks a completed release. Only the tag is
148-
# pushed -- never a commit to main (which the branch ruleset forbids).
149-
- name: Push v<version> tag
150-
if: steps.release.outputs.version != ''
151-
run: |
152-
set -euo pipefail
153-
git config user.email "github-actions[bot]@users.noreply.github.com"
154-
git config user.name "github-actions[bot]"
155-
git tag -a "v${{ steps.release.outputs.version }}" -m "Release v${{ steps.release.outputs.version }}"
156-
git push origin "v${{ steps.release.outputs.version }}"
157-
158152
# Publish the SAME wheel+sdist to public PyPI (pkgs live alongside the private
159153
# Azure Artifacts feed, which the release job above still populates). This runs
160154
# as its own job so OIDC Trusted Publishing is scoped to a dedicated,
@@ -185,3 +179,28 @@ jobs:
185179
# Trusted Publisher is configured on pypi.org for this repo +
186180
# workflow (release.yml) + environment (pypi); no password needed.
187181
packages-dir: dist/
182+
183+
# Tag the release ONLY after PyPI has published, so a `v<version>` tag marks a
184+
# completed public release and the re-release guard never blocks retrying a
185+
# failed publish. Tags are outside the branch ruleset, so GITHUB_TOKEN suffices.
186+
tag-release:
187+
name: Push release tag
188+
needs: [release, publish-pypi]
189+
if: needs.release.outputs.version != ''
190+
runs-on: ubuntu-latest
191+
timeout-minutes: 5
192+
permissions:
193+
contents: write # push the v<version> tag
194+
steps:
195+
- name: Checkout code
196+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
197+
198+
- name: Push v<version> tag
199+
env:
200+
VERSION: ${{ needs.release.outputs.version }}
201+
run: |
202+
set -euo pipefail
203+
git config user.email "github-actions[bot]@users.noreply.github.com"
204+
git config user.name "github-actions[bot]"
205+
git tag -a "v${VERSION}" -m "Release v${VERSION}"
206+
git push origin "v${VERSION}"

0 commit comments

Comments
 (0)