Skip to content

Commit fcc68a1

Browse files
committed
simplified release process
1 parent 07ad96b commit fcc68a1

File tree

1 file changed

+7
-26
lines changed

1 file changed

+7
-26
lines changed

.github/workflows/main.yml

Lines changed: 7 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -53,33 +53,14 @@ jobs:
5353
run: |
5454
echo ::set-output name=version::$(python3 setup.py --version)
5555
56-
- name: Create Tag
56+
- name: Create Release
5757
uses: actions/github-script@v6
5858
with:
5959
github-token: ${{ github.token }}
6060
script: |
61-
try {
62-
await github.rest.git.updateRef({
63-
owner: context.repo.owner,
64-
repo: context.repo.repo,
65-
ref: "tags/v${{ steps.py_version.outputs.version }}",
66-
sha: context.sha,
67-
force: true
68-
})
69-
} catch (e) {
70-
await github.rest.git.createRef({
71-
owner: context.repo.owner,
72-
repo: context.repo.repo,
73-
ref: "refs/tags/v${{ steps.py_version.outputs.version }}",
74-
sha: context.sha
75-
})
76-
}
77-
78-
- name: Create Release
79-
run: |
80-
curl \
81-
-X POST \
82-
-H "Accept: application/vnd.github+json" \
83-
-H "Authorization: token ${{ secrets.GH_RELEASE_TOKEN }}" \
84-
https://api.github.com/repos/${GITHUB_REPOSITORY}/releases \
85-
-d '{"tag_name":"v${{ steps.py_version.outputs.version }}","target_commitish":"${{ github.sha }}","name":"v${{ steps.py_version.outputs.version }}","body":"${{ github.event.head_commit.message }}","draft":false,"prerelease":false,"generate_release_notes":false}'
61+
github.rest.repos.createRelease({
62+
owner: context.repo.owner,
63+
repo: context.repo.repo,
64+
tag_name: "v${{ steps.py_version.outputs.version }}",
65+
tag_commitish: "${{ github.sha }}"
66+
})

0 commit comments

Comments
 (0)