Skip to content

Commit 7757a0c

Browse files
committed
Publish workflow
1 parent 29d2ae1 commit 7757a0c

File tree

2 files changed

+84
-1
lines changed

2 files changed

+84
-1
lines changed

.github/workflows/publish.yml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
name: "Build, release and publish"
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
test:
13+
name: Test
14+
uses: ./.github/workflows/action-test.yml
15+
with:
16+
python-version: "3.8"
17+
environment: "cloud"
18+
secrets:
19+
NOCO_URL: ${{ secrets.NOCO_URL }}
20+
NOCO_API_KEY: ${{ secrets.NOCO_API_KEY }}
21+
NOCO_BASE_ID: ${{ secrets.NOCO_BASE_ID }}
22+
23+
build:
24+
name: Build
25+
runs-on: ubuntu-latest
26+
needs: test
27+
28+
steps:
29+
- uses: actions/checkout@v4
30+
name: Checkout
31+
- name: Set up Python
32+
uses: actions/setup-python@v5
33+
with:
34+
python-version: "3.x"
35+
36+
- name: Build release distributions
37+
run: |
38+
python -m pip install --upgrade pip
39+
python -m pip install build
40+
python -m build
41+
42+
- name: Upload distributions
43+
uses: actions/upload-artifact@v4
44+
with:
45+
name: release-dists
46+
path: dist/
47+
48+
publish:
49+
name: Publish
50+
runs-on: ubuntu-latest
51+
needs: build
52+
53+
permissions:
54+
id-token: write
55+
56+
environment:
57+
name: pypi
58+
59+
steps:
60+
- name: Retrieve release distributions
61+
uses: actions/download-artifact@v4
62+
with:
63+
name: release-dists
64+
path: dist/
65+
66+
- name: Publish release distributions to PyPI
67+
uses: pypa/gh-action-pypi-publish@release/v1
68+
69+
release:
70+
name: Release
71+
runs-on: ubuntu-latest
72+
needs: publish
73+
steps:
74+
- name: Build Changelog
75+
id: github_release
76+
uses: mikepenz/release-changelog-builder-action@v5
77+
env:
78+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
79+
80+
- name: Create Release
81+
uses: softprops/action-gh-release@v2
82+
with:
83+
body: ${{steps.github_release.outputs.changelog}}

.github/workflows/unittests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
strategy:
1717
max-parallel: 1
1818
matrix:
19-
python-version: ["3.8", "3.9", "3.12"]
19+
python-version: ["3.8", "3.12"]
2020
environment: ["cloud"]
2121

2222
uses: ./.github/workflows/action-test.yml

0 commit comments

Comments
 (0)