Skip to content

Commit

Permalink
chore: refresh GHA pipelines (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
ssbarnea authored Sep 6, 2021
1 parent 7e5b824 commit 7945a85
Show file tree
Hide file tree
Showing 5 changed files with 102 additions and 95 deletions.
34 changes: 32 additions & 2 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Format and labels used aim to match those used by Ansible project
name-template: '$RESOLVED_VERSION'
tag-template: '$RESOLVED_VERSION'
categories:
- title: 'Major Changes'
labels:
Expand All @@ -7,6 +9,7 @@ categories:
labels:
- 'feature' # 006b75
- 'enhancement' # ededed
- 'refactoring'
- title: 'Bugfixes'
labels:
- 'bug' # fbca04
Expand All @@ -15,7 +18,34 @@ categories:
- 'deprecated' # fef2c0
exclude-labels:
- 'skip-changelog'
version-resolver:
major:
labels:
- 'major'
minor:
labels:
- 'minor'
- 'feature'
- 'enhancement'
- 'refactoring'
patch:
labels:
- 'patch'
- 'bug'
- 'deprecated'
default: patch
autolabeler:
- label: 'skip-changelog'
title: '/chore/i'
- label: 'bug'
title: '/fix/i'
- label: 'enhancement'
title: '/(enhance|improve)/i'
- label: 'feature'
title: '/feature/i'
- label: 'dreprecated'
title: '/deprecat/i'
template: |
## Changes
$CHANGES
Kudos goes to: $CONTRIBUTORS
21 changes: 21 additions & 0 deletions .github/workflows/labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# See https://github.com/jesusvasquez333/verify-pr-label-action
name: labels
on:
pull_request_target:
types: [opened, labeled, unlabeled, synchronize]

jobs:
check_pr_labels:
runs-on: ubuntu-latest
name: verify
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Verify PR label action
uses: jesusvasquez333/[email protected]
with:
github-token: '${{ secrets.GITHUB_TOKEN }}'
valid-labels: 'bug, enhancement, feature, refactoring, major, deprecated, skip-changelog'
invalid-labels: 'help wanted, invalid, feedback-needed, incomplete'
pull-request-number: '${{ github.event.pull_request.number }}'
disable-reviews: true
4 changes: 1 addition & 3 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,15 @@ on:
push:
# branches to consider in the event; optional, defaults to all
branches:
- $default-branch
- main
- master
- 'releases/**'
- 'stable/**'

jobs:
update_release_draft:
runs-on: ubuntu-20.04
steps:
# Drafts your next Release notes as Pull Requests are merged into "master"
# Drafts your next Release notes as Pull Requests are merged into "main"
- uses: release-drafter/release-drafter@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48 changes: 48 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: release

on:
release:
types: [published]

jobs:
pypi:
name: Publish to PyPI registry
environment: release
runs-on: ubuntu-20.04

env:
FORCE_COLOR: 1
PY_COLORS: 1
TOXENV: packaging
TOX_PARALLEL_NO_SPINNER: 1

steps:
- name: Switch to using Python 3.8 by default
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install tox
run: >-
python3 -m
pip install
--user
tox
- name: Check out src from Git
uses: actions/checkout@v2
with:
fetch-depth: 0 # needed by setuptools-scm
- name: Build dists
run: python -m tox
- name: Publish to test.pypi.org
if: >- # "create" workflows run separately from "push" & "pull_request"
github.event_name == 'release'
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.testpypi_password }}
repository_url: https://test.pypi.org/legacy/
- name: Publish to pypi.org
if: >- # "create" workflows run separately from "push" & "pull_request"
github.event_name == 'release'
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.pypi_password }}
90 changes: 0 additions & 90 deletions .github/workflows/tox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -173,93 +173,3 @@ jobs:
- name: Run tox -e ${{ matrix.tox_env }}
run: |
tox -e ${{ matrix.tox_env }}
publish:
name: Publish to PyPI registry
needs:
- linters
- unit
runs-on: ubuntu-latest

env:
PY_COLORS: 1
TOXENV: packaging
TOX_PARALLEL_NO_SPINNER: 1

steps:
- name: Switch to using Python 3.8 by default
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install tox
run: >-
python -m
pip install
--user
tox
- name: Check out src from Git
uses: actions/checkout@v2
with:
# Get shallow Git history (default) for tag creation events
# but have a complete clone for any other workflows.
# Both options fetch tags but since we're going to remove
# one from HEAD in non-create-tag workflows, we need full
# history for them.
fetch-depth: >-
${{
(
github.event_name == 'create' &&
github.event.ref_type == 'tag'
) &&
1 || 0
}}
- name: Drop Git tags from HEAD for non-tag-create events
if: >-
github.event_name != 'create' ||
github.event.ref_type != 'tag'
run: >-
git tag --points-at HEAD
|
xargs git tag --delete
- name: Instruct setuptools-scm not to add a local version part
if: >-
github.event_name == 'push' &&
github.ref == format(
'refs/heads/{0}', github.event.repository.default_branch
)
run: |
echo 'local_scheme = "no-local-version"' >> pyproject.toml
git update-index --assume-unchanged pyproject.toml
- name: Pre-populate tox env
run: >-
python -m
tox
--parallel auto
--parallel-live
--notest
--skip-missing-interpreters false
-vvvv
- name: Build dists
run: python -m tox -p auto --parallel-live -vvvv
- name: Publish to test.pypi.org
if: >-
(
github.event_name == 'push' &&
github.ref == format(
'refs/heads/{0}', github.event.repository.default_branch
)
) ||
(
github.event_name == 'create' &&
github.event.ref_type == 'tag'
)
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.testpypi_password }}
repository_url: https://test.pypi.org/legacy/
- name: Publish to pypi.org
if: >- # "create" workflows run separately from "push" & "pull_request"
github.event_name == 'create' &&
github.event.ref_type == 'tag'
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.pypi_password }}

0 comments on commit 7945a85

Please sign in to comment.