Skip to content

Commit 7945a85

Browse files
authored
chore: refresh GHA pipelines (#45)
1 parent 7e5b824 commit 7945a85

File tree

5 files changed

+102
-95
lines changed

5 files changed

+102
-95
lines changed

.github/release-drafter.yml

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
# Format and labels used aim to match those used by Ansible project
2+
name-template: '$RESOLVED_VERSION'
3+
tag-template: '$RESOLVED_VERSION'
24
categories:
35
- title: 'Major Changes'
46
labels:
@@ -7,6 +9,7 @@ categories:
79
labels:
810
- 'feature' # 006b75
911
- 'enhancement' # ededed
12+
- 'refactoring'
1013
- title: 'Bugfixes'
1114
labels:
1215
- 'bug' # fbca04
@@ -15,7 +18,34 @@ categories:
1518
- 'deprecated' # fef2c0
1619
exclude-labels:
1720
- 'skip-changelog'
21+
version-resolver:
22+
major:
23+
labels:
24+
- 'major'
25+
minor:
26+
labels:
27+
- 'minor'
28+
- 'feature'
29+
- 'enhancement'
30+
- 'refactoring'
31+
patch:
32+
labels:
33+
- 'patch'
34+
- 'bug'
35+
- 'deprecated'
36+
default: patch
37+
autolabeler:
38+
- label: 'skip-changelog'
39+
title: '/chore/i'
40+
- label: 'bug'
41+
title: '/fix/i'
42+
- label: 'enhancement'
43+
title: '/(enhance|improve)/i'
44+
- label: 'feature'
45+
title: '/feature/i'
46+
- label: 'dreprecated'
47+
title: '/deprecat/i'
1848
template: |
19-
## Changes
20-
2149
$CHANGES
50+
51+
Kudos goes to: $CONTRIBUTORS

.github/workflows/labels.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# See https://github.com/jesusvasquez333/verify-pr-label-action
2+
name: labels
3+
on:
4+
pull_request_target:
5+
types: [opened, labeled, unlabeled, synchronize]
6+
7+
jobs:
8+
check_pr_labels:
9+
runs-on: ubuntu-latest
10+
name: verify
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v2
14+
- name: Verify PR label action
15+
uses: jesusvasquez333/[email protected]
16+
with:
17+
github-token: '${{ secrets.GITHUB_TOKEN }}'
18+
valid-labels: 'bug, enhancement, feature, refactoring, major, deprecated, skip-changelog'
19+
invalid-labels: 'help wanted, invalid, feedback-needed, incomplete'
20+
pull-request-number: '${{ github.event.pull_request.number }}'
21+
disable-reviews: true

.github/workflows/release-drafter.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,15 @@ on:
44
push:
55
# branches to consider in the event; optional, defaults to all
66
branches:
7-
- $default-branch
87
- main
9-
- master
108
- 'releases/**'
119
- 'stable/**'
1210

1311
jobs:
1412
update_release_draft:
1513
runs-on: ubuntu-20.04
1614
steps:
17-
# Drafts your next Release notes as Pull Requests are merged into "master"
15+
# Drafts your next Release notes as Pull Requests are merged into "main"
1816
- uses: release-drafter/release-drafter@v5
1917
env:
2018
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/release.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: release
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
pypi:
9+
name: Publish to PyPI registry
10+
environment: release
11+
runs-on: ubuntu-20.04
12+
13+
env:
14+
FORCE_COLOR: 1
15+
PY_COLORS: 1
16+
TOXENV: packaging
17+
TOX_PARALLEL_NO_SPINNER: 1
18+
19+
steps:
20+
- name: Switch to using Python 3.8 by default
21+
uses: actions/setup-python@v2
22+
with:
23+
python-version: 3.8
24+
- name: Install tox
25+
run: >-
26+
python3 -m
27+
pip install
28+
--user
29+
tox
30+
- name: Check out src from Git
31+
uses: actions/checkout@v2
32+
with:
33+
fetch-depth: 0 # needed by setuptools-scm
34+
- name: Build dists
35+
run: python -m tox
36+
- name: Publish to test.pypi.org
37+
if: >- # "create" workflows run separately from "push" & "pull_request"
38+
github.event_name == 'release'
39+
uses: pypa/gh-action-pypi-publish@master
40+
with:
41+
password: ${{ secrets.testpypi_password }}
42+
repository_url: https://test.pypi.org/legacy/
43+
- name: Publish to pypi.org
44+
if: >- # "create" workflows run separately from "push" & "pull_request"
45+
github.event_name == 'release'
46+
uses: pypa/gh-action-pypi-publish@master
47+
with:
48+
password: ${{ secrets.pypi_password }}

.github/workflows/tox.yml

Lines changed: 0 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -173,93 +173,3 @@ jobs:
173173
- name: Run tox -e ${{ matrix.tox_env }}
174174
run: |
175175
tox -e ${{ matrix.tox_env }}
176-
publish:
177-
name: Publish to PyPI registry
178-
needs:
179-
- linters
180-
- unit
181-
runs-on: ubuntu-latest
182-
183-
env:
184-
PY_COLORS: 1
185-
TOXENV: packaging
186-
TOX_PARALLEL_NO_SPINNER: 1
187-
188-
steps:
189-
- name: Switch to using Python 3.8 by default
190-
uses: actions/setup-python@v2
191-
with:
192-
python-version: 3.8
193-
- name: Install tox
194-
run: >-
195-
python -m
196-
pip install
197-
--user
198-
tox
199-
- name: Check out src from Git
200-
uses: actions/checkout@v2
201-
with:
202-
# Get shallow Git history (default) for tag creation events
203-
# but have a complete clone for any other workflows.
204-
# Both options fetch tags but since we're going to remove
205-
# one from HEAD in non-create-tag workflows, we need full
206-
# history for them.
207-
fetch-depth: >-
208-
${{
209-
(
210-
github.event_name == 'create' &&
211-
github.event.ref_type == 'tag'
212-
) &&
213-
1 || 0
214-
}}
215-
- name: Drop Git tags from HEAD for non-tag-create events
216-
if: >-
217-
github.event_name != 'create' ||
218-
github.event.ref_type != 'tag'
219-
run: >-
220-
git tag --points-at HEAD
221-
|
222-
xargs git tag --delete
223-
- name: Instruct setuptools-scm not to add a local version part
224-
if: >-
225-
github.event_name == 'push' &&
226-
github.ref == format(
227-
'refs/heads/{0}', github.event.repository.default_branch
228-
)
229-
run: |
230-
echo 'local_scheme = "no-local-version"' >> pyproject.toml
231-
git update-index --assume-unchanged pyproject.toml
232-
- name: Pre-populate tox env
233-
run: >-
234-
python -m
235-
tox
236-
--parallel auto
237-
--parallel-live
238-
--notest
239-
--skip-missing-interpreters false
240-
-vvvv
241-
- name: Build dists
242-
run: python -m tox -p auto --parallel-live -vvvv
243-
- name: Publish to test.pypi.org
244-
if: >-
245-
(
246-
github.event_name == 'push' &&
247-
github.ref == format(
248-
'refs/heads/{0}', github.event.repository.default_branch
249-
)
250-
) ||
251-
(
252-
github.event_name == 'create' &&
253-
github.event.ref_type == 'tag'
254-
)
255-
uses: pypa/gh-action-pypi-publish@master
256-
with:
257-
password: ${{ secrets.testpypi_password }}
258-
repository_url: https://test.pypi.org/legacy/
259-
- name: Publish to pypi.org
260-
if: >- # "create" workflows run separately from "push" & "pull_request"
261-
github.event_name == 'create' &&
262-
github.event.ref_type == 'tag'
263-
uses: pypa/gh-action-pypi-publish@master
264-
with:
265-
password: ${{ secrets.pypi_password }}

0 commit comments

Comments
 (0)