Skip to content

Commit 9a05180

Browse files
authored
fix: ci release error (#15)
1 parent 2809563 commit 9a05180

1 file changed

Lines changed: 14 additions & 18 deletions

File tree

‎.github/workflows/release.yaml‎

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,31 +17,27 @@ on:
1717

1818
jobs:
1919
deploy:
20+
permissions:
21+
contents: write
2022
runs-on: ubuntu-latest
2123
environment: py-production
2224
steps:
23-
- uses: actions/checkout@v3
25+
- uses: actions/checkout@v4
2426
- name: Read current version
2527
id: version
26-
uses: ashley-taylor/read-json-property-action@v1.1
27-
with:
28-
path: ./release/package.json
29-
property: version
30-
- name: Read realease description
31-
id: description
32-
uses: juliangruber/read-file-action@v1.1.6
33-
with:
34-
path: ./release/description.md
28+
run: |
29+
python3 - <<'PY' >> "$GITHUB_OUTPUT"
30+
import json
31+
with open("release/package.json") as file:
32+
print("value=%s" % json.load(file)["version"])
33+
PY
3534
- name: Create GitHub Release
36-
uses: actions/create-release@latest
3735
env:
38-
GITHUB_TOKEN: ${{ secrets.PROJECT_RELEASE_TOKEN }}
39-
with:
40-
tag_name: v${{steps.version.outputs.value}}
41-
release_name: v${{steps.version.outputs.value}}
42-
body: ${{steps.description.outputs.content}}
43-
draft: false
44-
prerelease: false
36+
GH_TOKEN: ${{ github.token }}
37+
run: |
38+
gh release create "v${{ steps.version.outputs.value }}" \
39+
--title "v${{ steps.version.outputs.value }}" \
40+
--notes-file release/description.md
4541
- name: Set up Python
4642
uses: actions/setup-python@v4
4743
with:

0 commit comments

Comments
 (0)