Skip to content

Commit 4850ee3

Browse files
authored
Fixed release workflow (#33)
1 parent 3deba24 commit 4850ee3

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

.github/workflows/release.yaml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@ on:
1313
jobs:
1414
release:
1515
runs-on: ubuntu-latest
16+
permissions:
17+
contents: write # Required for creating releases
1618
environment: release-workflow-env
1719
env:
18-
GH_TOKEN: ${{ github.token }}
20+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1921
COMMIT_SHA: ${{ github.sha }}
2022
REPOSITORY: ${{ github.repository }}
2123
VERSION_NUM: ${{ github.event.inputs.version || github.ref_name }}
@@ -90,10 +92,22 @@ jobs:
9092
\"prerelease\": false
9193
}")
9294
95+
echo "Release API response: $RELEASE_RESPONSE"
96+
97+
if echo "$RELEASE_RESPONSE" | jq -e '.message' > /dev/null; then
98+
echo "Error creating release: $(echo "$RELEASE_RESPONSE" | jq -r '.message')"
99+
exit 1
100+
fi
101+
93102
UPLOAD_URL=$(echo "$RELEASE_RESPONSE" | jq -r '.upload_url' | sed 's/{?name,label}//')
94103
RELEASE_ID=$(echo "$RELEASE_RESPONSE" | jq -r '.id')
95-
96-
echo UPLOAD_URL $UPLOAD_URL, RELEASE_ID $RELEASE_ID
104+
105+
if [ "$UPLOAD_URL" = "null" ] || [ "$RELEASE_ID" = "null" ]; then
106+
echo "Failed to extract upload URL or release ID from response"
107+
exit 1
108+
fi
109+
110+
echo "UPLOAD_URL: $UPLOAD_URL, RELEASE_ID: $RELEASE_ID"
97111
98112
# Upload each tar.gz file
99113
for file in *.tar.gz; do

RELEASE.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ We use major.minor branches (e.g., `1.0`, `1.1`, `2.1`) for releases.
2525
git tag 1.0.0
2626
git push origin 1.0.0
2727
```
28-
- **GitHub UI**: Go to Releases → Create a new release
2928
- **GitHub Actions**: Manually run "Create release" workflow from Actions tab
3029

3130
3. **Release notes**: Include code-oss version information in the release description

0 commit comments

Comments
 (0)