Skip to content

Commit 3acf932

Browse files
authored
Merge pull request #23 from mutating/develop
Update release workflow to publish to PyPI on main push
2 parents da4003d + ec40ad8 commit 3acf932

File tree

1 file changed

+27
-16
lines changed

1 file changed

+27
-16
lines changed

.github/workflows/release.yml

Lines changed: 27 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,34 @@
1-
name: Create Release on Merge
1+
name: Release
22

33
on:
4-
pull_request:
5-
types: [closed]
4+
push:
5+
branches:
6+
- main
67

78
jobs:
8-
release:
9-
if: >
10-
github.event.pull_request.merged == true &&
11-
github.base_ref == 'main' &&
12-
github.head_ref == 'develop'
9+
pypi-publish:
10+
name: upload release to PyPI
1311
runs-on: ubuntu-latest
14-
12+
# Specifying a GitHub environment is optional, but strongly encouraged
13+
environment: release
14+
permissions:
15+
# IMPORTANT: this permission is mandatory for trusted publishing
16+
id-token: write
1517
steps:
16-
- name: Create Release
17-
uses: actions/create-release@v1
18-
env:
19-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18+
- uses: actions/checkout@v4
19+
20+
- name: Set up Python ${{ matrix.python-version }}
21+
uses: actions/setup-python@v5
2022
with:
21-
tag_name: ${{ github.event.pull_request.title }}
22-
release_name: ${{ github.event.pull_request.title }}
23-
body: ${{ github.event.pull_request.body }}
23+
python-version: ${{ matrix.python-version }}
24+
25+
- name: Install dependencies
26+
shell: bash
27+
run: pip install -r requirements_dev.txt
28+
29+
- name: Build the project
30+
shell: bash
31+
run: python -m build .
32+
33+
- name: Publish package distributions to PyPI
34+
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)