Skip to content
This repository was archived by the owner on Sep 14, 2023. It is now read-only.

Commit a7f61cb

Browse files
authored
Modernized github pipelines (#94)
1 parent 6385a35 commit a7f61cb

File tree

6 files changed

+131
-79
lines changed

6 files changed

+131
-79
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @ssbarnea

.github/release-drafter.yml

Lines changed: 43 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,51 @@
1+
# Format and labels used aim to match those used by Ansible project
2+
name-template: '$RESOLVED_VERSION'
3+
tag-template: '$RESOLVED_VERSION'
14
categories:
2-
- title: 'Features'
5+
- title: 'Major Changes'
36
labels:
7+
- 'major' # c6476b
8+
- title: 'Minor Changes'
9+
labels:
10+
- 'feature' # 006b75
11+
- 'enhancement' # ededed
12+
- 'refactoring'
13+
- title: 'Bugfixes'
14+
labels:
15+
- 'bug' # fbca04
16+
- title: 'Deprecations'
17+
labels:
18+
- 'deprecated' # fef2c0
19+
exclude-labels:
20+
- 'skip-changelog'
21+
version-resolver:
22+
major:
23+
labels:
24+
- 'major'
25+
minor:
26+
labels:
27+
- 'minor'
428
- 'feature'
529
- 'enhancement'
6-
- title: 'Bug Fixes'
30+
- 'refactoring'
31+
patch:
732
labels:
8-
- 'fix'
9-
- 'bugfix'
33+
- 'patch'
1034
- 'bug'
11-
- title: 'Maintenance'
12-
label: 'chore'
13-
exclude-labels:
14-
- 'skip-changelog'
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'
1548
template: |
16-
## Changes
17-
1849
$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/verify-pr-label-action@v1.4.0
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: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: release-drafter
2+
3+
on:
4+
push:
5+
# branches to consider in the event; optional, defaults to all
6+
branches:
7+
- main
8+
- 'releases/**'
9+
- 'stable/**'
10+
11+
jobs:
12+
update_release_draft:
13+
runs-on: ubuntu-20.04
14+
steps:
15+
# Drafts your next Release notes as Pull Requests are merged into "main"
16+
- uses: release-drafter/release-drafter@v5
17+
env:
18+
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, created, edited]
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: >-
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: >-
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 & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -60,72 +60,3 @@ jobs:
6060
run: |
6161
echo "${{ matrix.PREFIX }} tox -e ${{ matrix.tox_env }}"
6262
${{ matrix.PREFIX }} tox -e ${{ matrix.tox_env }}
63-
64-
publish:
65-
name: Publish to PyPI registry
66-
needs:
67-
- build
68-
runs-on: ubuntu-latest
69-
70-
env:
71-
PY_COLORS: 1
72-
TOXENV: packaging
73-
74-
steps:
75-
- name: Switch to using Python 3.6 by default
76-
uses: actions/setup-python@v2
77-
with:
78-
python-version: 3.6
79-
- name: Install tox
80-
run: python -m pip install --user tox
81-
- name: Check out src from Git
82-
uses: actions/checkout@v2
83-
with:
84-
# Get shallow Git history (default) for tag creation events
85-
# but have a complete clone for any other workflows.
86-
# Both options fetch tags but since we're going to remove
87-
# one from HEAD in non-create-tag workflows, we need full
88-
# history for them.
89-
fetch-depth: >-
90-
${{
91-
(
92-
github.event_name == 'create' &&
93-
github.event.ref_type == 'tag'
94-
) &&
95-
1 || 0
96-
}}
97-
- name: Drop Git tags from HEAD for non-tag-create events
98-
if: >-
99-
github.event_name != 'create' ||
100-
github.event.ref_type != 'tag'
101-
run: >-
102-
git tag --points-at HEAD
103-
|
104-
xargs git tag --delete
105-
- name: Build dists
106-
run: python -m tox
107-
- name: Publish to test.pypi.org
108-
if: >-
109-
(
110-
github.event_name == 'push' &&
111-
github.ref == format(
112-
'refs/heads/{0}', github.event.repository.default_branch
113-
)
114-
) ||
115-
(
116-
github.event_name == 'create' &&
117-
github.event.ref_type == 'tag'
118-
)
119-
uses: pypa/gh-action-pypi-publish@master
120-
with:
121-
password: ${{ secrets.testpypi_password }}
122-
repository_url: https://test.pypi.org/legacy/
123-
- name: Publish to pypi.org
124-
if: >- # "create" workflows run separately from "push" & "pull_request"
125-
github.event_name == 'create' &&
126-
github.event.ref_type == 'tag'
127-
uses: pypa/gh-action-pypi-publish@master
128-
with:
129-
password: ${{ secrets.pypi_password }}
130-
# No need to publish to quay.io from here as they do it when a new tag
131-
# is pushed on git.

0 commit comments

Comments
 (0)