Skip to content

Commit 8c15651

Browse files
committed
fix: 🐛 🎡 go back to python-semantic-release (sigh)
1 parent f9c8ae0 commit 8c15651

File tree

5 files changed

+67
-7000
lines changed

5 files changed

+67
-7000
lines changed

.github/workflows/release.yml

Lines changed: 45 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,9 @@ jobs:
1616
concurrency: release
1717
if: github.repository == 'darvid/python-hyperscan'
1818
permissions:
19-
contents: write
20-
issues: write
21-
pull-requests: write
2219
id-token: write
20+
pull-requests: write
21+
contents: write
2322
env:
2423
RELEASE_PR_BRANCH: create-pull-request/patch
2524
steps:
@@ -31,34 +30,61 @@ jobs:
3130

3231
- uses: chainguard-dev/actions/setup-gitsign@main
3332

34-
- name: Setup Node.js
35-
uses: actions/setup-node@v3
33+
- name: Check if release needed
34+
id: release
35+
uses: python-semantic-release/python-semantic-release@v8.7.2
3636
with:
37-
node-version: "lts/*"
38-
39-
- name: Install semantic-release dependencies
40-
run: npm clean-install
37+
github_token: ${{ secrets.GITHUB_TOKEN }}
38+
root_options: "-vv --noop"
39+
# python-semantic-release displays what it would have
40+
# committed if commit is true and noop is set
41+
commit: "true"
4142

4243
- name: Download artifacts
4344
uses: actions/download-artifact@v4
44-
if: github.event_name == 'workflow_dispatch'
45+
if: github.event_name == 'workflow_dispatch' || steps.release.outputs.released == 'true'
4546

4647
- name: Prepare dist
47-
if: github.event_name == 'workflow_dispatch'
48+
if: github.event_name == 'workflow_dispatch' || steps.release.outputs.released == 'true'
4849
run: |
4950
mkdir dist
5051
mv --backup=numbered ./wheel-*/*.whl -t dist/
5152
mv --backup=numbered ./sdist/*.tar.gz -t dist/
5253
ls -ahl dist/
5354
rm -rf dist/*~
5455
55-
- name: Set up Python
56-
uses: actions/setup-python@v4
56+
- name: Create release branch
57+
if: steps.release.outputs.released == 'true'
58+
run: |
59+
# use the same default branch name that create-pull-request uses
60+
git checkout -b ${RELEASE_PR_BRANCH}
61+
git branch --set-upstream-to=${RELEASE_PR_BRANCH}
62+
63+
- name: Semantic release
64+
uses: python-semantic-release/python-semantic-release@v8.7.2
65+
if: steps.release.outputs.released == 'true'
66+
with:
67+
github_token: ${{ secrets.GITHUB_TOKEN }}
68+
root_options: "-vv"
69+
70+
- name: Create PR
71+
uses: peter-evans/create-pull-request@v4.0.2
72+
if: steps.release.outputs.released == 'true'
5773
with:
58-
python-version: 3.12
74+
base: main
75+
assignees: ${{ github.repository_owner }}
76+
title: "Release ${{ steps.release.outputs.version }}"
5977

60-
- name: Release
61-
env:
62-
GH_TOKEN: ${{ secrets.GH_TOKEN }}
63-
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
64-
run: npx semantic-release
78+
- name: Publish package distributions to GitHub Releases
79+
if: github.event_name == 'workflow_dispatch' || steps.release.outputs.released == 'true'
80+
uses: python-semantic-release/upload-to-gh-release@main
81+
with:
82+
github_token: ${{ secrets.GITHUB_TOKEN }}
83+
tag: ${{ steps.release.outputs.tag }}
84+
85+
- name: Publish package distributions to PyPI
86+
if: github.event_name == 'workflow_dispatch' || steps.release.outputs.released == 'true'
87+
uses: pypa/gh-action-pypi-publish@release/v1
88+
with:
89+
skip-existing: true
90+
verbose: true

.releaserc

Lines changed: 0 additions & 38 deletions
This file was deleted.

0 commit comments

Comments
 (0)