Fix false job failure: use GITHUB_ENV instead of step outputs
The act runner has a Go format bug that evaluates step outputs at cleanup time and crashes with %!t(string=...), marking the job as failed even though all steps succeeded. Replaced steps.bump.outputs.* with GITHUB_ENV variables which persist across steps without triggering the runner's output evaluation bug. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -36,9 +36,6 @@ jobs:
|
|||||||
name: Bump version and tag
|
name: Bump version and tag
|
||||||
needs: test
|
needs: test
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
outputs:
|
|
||||||
new_version: ${{ steps.bump.outputs.new_version }}
|
|
||||||
tag: ${{ steps.bump.outputs.tag }}
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
@@ -50,7 +47,6 @@ jobs:
|
|||||||
git config user.email "actions@gitea.local"
|
git config user.email "actions@gitea.local"
|
||||||
|
|
||||||
- name: Bump patch version
|
- name: Bump patch version
|
||||||
id: bump
|
|
||||||
run: |
|
run: |
|
||||||
CURRENT=$(grep '"version"' package.json | head -1 | sed 's/.*"version": *"\([^"]*\)".*/\1/')
|
CURRENT=$(grep '"version"' package.json | head -1 | sed 's/.*"version": *"\([^"]*\)".*/\1/')
|
||||||
echo "Current version: ${CURRENT}"
|
echo "Current version: ${CURRENT}"
|
||||||
@@ -68,35 +64,34 @@ jobs:
|
|||||||
sed -i "s/__version__ = \"${CURRENT}\"/__version__ = \"${NEW_VERSION}\"/" version.py
|
sed -i "s/__version__ = \"${CURRENT}\"/__version__ = \"${NEW_VERSION}\"/" version.py
|
||||||
sed -i "s/__version_info__ = .*/__version_info__ = (${MAJOR}, ${MINOR}, ${NEW_PATCH})/" version.py
|
sed -i "s/__version_info__ = .*/__version_info__ = (${MAJOR}, ${MINOR}, ${NEW_PATCH})/" version.py
|
||||||
|
|
||||||
echo "new_version=${NEW_VERSION}" >> $GITHUB_OUTPUT
|
# Write to env file instead of step outputs (avoids act runner bug)
|
||||||
echo "tag=v${NEW_VERSION}" >> $GITHUB_OUTPUT
|
echo "NEW_VERSION=${NEW_VERSION}" >> $GITHUB_ENV
|
||||||
|
echo "RELEASE_TAG=v${NEW_VERSION}" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Commit and tag
|
- name: Commit and tag
|
||||||
env:
|
env:
|
||||||
BUILD_TOKEN: ${{ secrets.BUILD_TOKEN }}
|
BUILD_TOKEN: ${{ secrets.BUILD_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
NEW_VERSION="${{ steps.bump.outputs.new_version }}"
|
|
||||||
git add package.json src-tauri/tauri.conf.json src-tauri/Cargo.toml version.py
|
git add package.json src-tauri/tauri.conf.json src-tauri/Cargo.toml version.py
|
||||||
git commit -m "chore: bump version to ${NEW_VERSION} [skip ci]"
|
git commit -m "chore: bump version to ${NEW_VERSION} [skip ci]"
|
||||||
git tag "v${NEW_VERSION}"
|
git tag "${RELEASE_TAG}"
|
||||||
|
|
||||||
REMOTE_URL=$(git remote get-url origin | sed "s|://|://gitea-actions:${BUILD_TOKEN}@|")
|
REMOTE_URL=$(git remote get-url origin | sed "s|://|://gitea-actions:${BUILD_TOKEN}@|")
|
||||||
git pull --rebase "${REMOTE_URL}" main || true
|
git pull --rebase "${REMOTE_URL}" main || true
|
||||||
git push "${REMOTE_URL}" HEAD:main
|
git push "${REMOTE_URL}" HEAD:main
|
||||||
git push "${REMOTE_URL}" "v${NEW_VERSION}"
|
git push "${REMOTE_URL}" "${RELEASE_TAG}"
|
||||||
|
|
||||||
- name: Create Gitea release
|
- name: Create Gitea release
|
||||||
env:
|
env:
|
||||||
BUILD_TOKEN: ${{ secrets.BUILD_TOKEN }}
|
BUILD_TOKEN: ${{ secrets.BUILD_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
REPO_API="${GITHUB_SERVER_URL}/api/v1/repos/${GITHUB_REPOSITORY}"
|
REPO_API="${GITHUB_SERVER_URL}/api/v1/repos/${GITHUB_REPOSITORY}"
|
||||||
TAG="${{ steps.bump.outputs.tag }}"
|
RELEASE_NAME="Local Transcription ${RELEASE_TAG}"
|
||||||
RELEASE_NAME="Local Transcription ${TAG}"
|
|
||||||
|
|
||||||
curl -s -X POST \
|
curl -s -X POST \
|
||||||
-H "Authorization: token ${BUILD_TOKEN}" \
|
-H "Authorization: token ${BUILD_TOKEN}" \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-d "{\"tag_name\": \"${TAG}\", \"name\": \"${RELEASE_NAME}\", \"body\": \"Automated build.\", \"draft\": false, \"prerelease\": false}" \
|
-d "{\"tag_name\": \"${RELEASE_TAG}\", \"name\": \"${RELEASE_NAME}\", \"body\": \"Automated build.\", \"draft\": false, \"prerelease\": false}" \
|
||||||
"${REPO_API}/releases"
|
"${REPO_API}/releases"
|
||||||
echo "Created release: ${RELEASE_NAME}"
|
echo "Created release: ${RELEASE_NAME}"
|
||||||
|
|
||||||
@@ -105,18 +100,14 @@ jobs:
|
|||||||
BUILD_TOKEN: ${{ secrets.BUILD_TOKEN }}
|
BUILD_TOKEN: ${{ secrets.BUILD_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
REPO_API="${GITHUB_SERVER_URL}/api/v1/repos/${GITHUB_REPOSITORY}"
|
REPO_API="${GITHUB_SERVER_URL}/api/v1/repos/${GITHUB_REPOSITORY}"
|
||||||
TAG="${{ steps.bump.outputs.tag }}"
|
|
||||||
|
|
||||||
for workflow in build-app-linux.yml build-app-windows.yml build-app-macos.yml; do
|
for workflow in build-app-linux.yml build-app-windows.yml build-app-macos.yml; do
|
||||||
echo "Dispatching ${workflow} for ${TAG}..."
|
echo "Dispatching ${workflow} for ${RELEASE_TAG}..."
|
||||||
HTTP_CODE=$(curl -s -w "%{http_code}" -o /tmp/dispatch_resp.txt -X POST \
|
HTTP_CODE=$(curl -s -w "%{http_code}" -o /tmp/dispatch_resp.txt -X POST \
|
||||||
-H "Authorization: token ${BUILD_TOKEN}" \
|
-H "Authorization: token ${BUILD_TOKEN}" \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-d "{\"ref\": \"main\", \"inputs\": {\"tag\": \"${TAG}\"}}" \
|
-d "{\"ref\": \"main\", \"inputs\": {\"tag\": \"${RELEASE_TAG}\"}}" \
|
||||||
"${REPO_API}/actions/workflows/${workflow}/dispatches")
|
"${REPO_API}/actions/workflows/${workflow}/dispatches")
|
||||||
echo " -> HTTP ${HTTP_CODE}"
|
echo " -> HTTP ${HTTP_CODE}"
|
||||||
[ "$HTTP_CODE" != "204" ] && cat /tmp/dispatch_resp.txt && echo ""
|
[ "$HTTP_CODE" != "204" ] && cat /tmp/dispatch_resp.txt && echo ""
|
||||||
done
|
done
|
||||||
|
|
||||||
# NOTE: Automatic cleanup disabled -- it races with async builds.
|
|
||||||
# Clean up old releases manually from the Gitea UI when needed.
|
|
||||||
|
|||||||
Reference in New Issue
Block a user