Skip to content

Commit c9760ee

Browse files
committed
Attempt to create automatic release workflow
1 parent bb5a120 commit c9760ee

2 files changed

Lines changed: 41 additions & 16 deletions

File tree

.github/workflows/build.yml

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Build
22

3-
on: [push, pull_request]
3+
on: [push, pull_request, workflow_call]
44

55
jobs:
66
build_wheels:
@@ -41,18 +41,3 @@ jobs:
4141
- uses: actions/upload-artifact@v3
4242
with:
4343
path: dist/*.tar.gz
44-
45-
upload_pypi:
46-
needs: [build_wheels, build_sdist]
47-
runs-on: ubuntu-latest
48-
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
49-
steps:
50-
- uses: actions/download-artifact@v3
51-
with:
52-
name: artifact
53-
path: dist
54-
55-
- uses: pypa/gh-action-pypi-publish@v1.5.2
56-
with:
57-
user: __token__
58-
password: ${{ secrets.pypi_password }}

.github/workflows/release.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*.*.*"
7+
8+
jobs:
9+
build:
10+
uses: ./.github/workflows/build.yml
11+
create_release:
12+
needs: [build]
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v2
17+
- name: Download wheels
18+
uses: actions/download-artifact@v3
19+
with:
20+
name: artifact
21+
path: dist
22+
- name: Release
23+
uses: softprops/action-gh-release@v1
24+
with:
25+
body_path: ./CHANGELOG.md
26+
files: "dist/*"
27+
upload_pypi:
28+
needs: [build, create_release]
29+
runs-on: ubuntu-latest
30+
steps:
31+
- name: Download wheels
32+
uses: actions/download-artifact@v3
33+
with:
34+
name: artifact
35+
path: dist
36+
- name: Publish to pipy
37+
uses: pypa/gh-action-pypi-publish@v1.5.2
38+
with:
39+
user: __token__
40+
password: ${{ secrets.pypi_password }}

0 commit comments

Comments
 (0)