Skip to content

Commit ace4949

Browse files
committed
ci: make cd job
Signed-off-by: Henry Schreiner <[email protected]>
1 parent b77ce53 commit ace4949

File tree

2 files changed

+47
-47
lines changed

2 files changed

+47
-47
lines changed

.github/workflows/cd.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: CD
2+
3+
on:
4+
workflow_dispatch:
5+
release:
6+
types:
7+
- published
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
env:
14+
FORCE_COLOR: 3
15+
16+
jobs:
17+
dist:
18+
needs: [pre-commit]
19+
name: Distribution build
20+
runs-on: ubuntu-latest
21+
22+
steps:
23+
- uses: actions/checkout@v3
24+
with:
25+
fetch-depth: 0
26+
27+
- name: Build sdist and wheel
28+
uses: hynek/build-and-inspect-python-package@v1
29+
30+
publish:
31+
needs: [dist]
32+
name: Publish to PyPI
33+
environment:
34+
name: pypi
35+
url: https://pypi.org/p/dynamic-metadata
36+
permissions:
37+
id-token: write
38+
runs-on: ubuntu-latest
39+
if: github.event_name == 'release' && github.event.action == 'published'
40+
41+
steps:
42+
- uses: actions/download-artifact@v3
43+
with:
44+
name: Packages
45+
path: dist
46+
47+
- uses: pypa/gh-action-pypi-publish@release/v1

.github/workflows/ci.yml

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,7 @@ on:
55
pull_request:
66
push:
77
branches:
8-
- master
98
- main
10-
- develop
11-
release:
12-
types:
13-
- published
149

1510
concurrency:
1611
group: ${{ github.workflow }}-${{ github.ref }}
@@ -72,45 +67,3 @@ jobs:
7267
7368
- name: Upload coverage report
7469
uses: codecov/[email protected]
75-
76-
dist:
77-
needs: [pre-commit]
78-
name: Distribution build
79-
runs-on: ubuntu-latest
80-
81-
steps:
82-
- uses: actions/checkout@v3
83-
with:
84-
fetch-depth: 0
85-
86-
- name: Build sdist and wheel
87-
run: pipx run build
88-
89-
- uses: actions/upload-artifact@v3
90-
with:
91-
path: dist
92-
93-
- name: Check products
94-
run: pipx run twine check dist/*
95-
96-
publish:
97-
needs: [dist]
98-
name: Publish to PyPI
99-
environment: pypi
100-
permissions:
101-
id-token: write
102-
runs-on: ubuntu-latest
103-
if: github.event_name == 'release' && github.event.action == 'published'
104-
105-
steps:
106-
- uses: actions/download-artifact@v3
107-
with:
108-
name: artifact
109-
path: dist
110-
111-
- uses: pypa/gh-action-pypi-publish@release/v1
112-
if: github.event_name == 'release' && github.event.action == 'published'
113-
with:
114-
# Remember to tell (test-)pypi about this repo before publishing
115-
# Remove this line to publish to PyPI
116-
repository-url: https://test.pypi.org/legacy/

0 commit comments

Comments
 (0)