Skip to content

Commit

Permalink
DX: outsource GitHub workflows to ComPWA/actions (#180)
Browse files Browse the repository at this point in the history
* MAINT: rename "✨ Feature" issue label
  • Loading branch information
redeboer authored Jan 29, 2023
1 parent 975abfd commit 6a3317e
Show file tree
Hide file tree
Showing 21 changed files with 143 additions and 456 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: Feature request
about: Suggest an idea for this project
title: ""
labels: "💡 Enhancement"
labels: " Enhancement"
assignees: ""
---

Expand Down
10 changes: 8 additions & 2 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
<!-- Fixes #xxx -->

<!-- For the PR title, follow a conventional commit message style: https://compwa-org.readthedocs.io/en/stable/develop.html#commit-conventions -->
<!--
For the PR title, follow a conventional commit message style:
https://compwa-org.readthedocs.io/en/stable/develop.html#commit-conventions
-->

<!-- Contents of this PR appear in the release notes. Please use screenshots, code snippets etc. to illustrate proposed changes -->
<!--
Contents of this PR appear in the release notes. Please use screenshots, code snippets
etc. to illustrate proposed changes
-->
6 changes: 4 additions & 2 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ references:

categories:
- title: ✨ New features
label: 💡 Feature
label: Feature
- title: ⚠️ Enhancements and optimizations
label: ⚙️ Enhancement
- title: ⚠️ API changes
Expand All @@ -32,6 +32,8 @@ replacers:
sort-direction: ascending

template: |
_See all documentation for this version [here](https://pwa.rtfd.io)._
_See all documentation for this version [here](https://PWA-pages.rtfd.io/en/$NEXT_PATCH_VERSION)._
$CHANGES
_The full changelog as commits can be found [here](https://github.com/ComPWA/PWA-pages/compare/$PREVIOUS_TAG...$NEXT_PATCH_VERSION)._
47 changes: 6 additions & 41 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,47 +7,12 @@ on:
- released

jobs:
push:
name: Push to version branches
milestone:
if: startsWith(github.ref, 'refs/tags')
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Configure Git credentials
run: |
git config --global user.name "GitHub Action"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
- name: Push to stable branch
run: |
git push origin HEAD:refs/heads/stable --force
- name: Push to matching minor version branch
env:
TAG: ${{ github.ref_name }}
run: |
re='^([0-9]+)\.([0-9]+)\.[0-9]+'
if [[ $TAG =~ $re ]]; then
MINOR_VERSION_BRANCH="${BASH_REMATCH[1]}.${BASH_REMATCH[2]}.x"
git push origin HEAD:refs/heads/$MINOR_VERSION_BRANCH --force
fi
uses: ComPWA/actions/.github/workflows/close-milestone.yml@v1
pypi:
name: Publish to PyPI
if: startsWith(github.ref, 'refs/tags')
needs: push
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.8"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
uses: ComPWA/actions/.github/workflows/publish-to-pypi.yml@v1
push:
if: startsWith(github.ref, 'refs/tags') && !github.event.release.prerelease
uses: ComPWA/actions/.github/workflows/push-to-version-branches.yml@v1
49 changes: 0 additions & 49 deletions .github/workflows/ci-docs.yml

This file was deleted.

46 changes: 0 additions & 46 deletions .github/workflows/ci-style.yml

This file was deleted.

49 changes: 0 additions & 49 deletions .github/workflows/ci-tests.yml

This file was deleted.

39 changes: 39 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: CI

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
PYTHONHASHSEED: "0"

on:
push:
branches:
- main
- epic/*
pull_request:
branches:
- main
- epic/*
workflow_dispatch:
inputs:
specific-pip-packages:
description: Run CI with specific pip packages
required: false
type: string

jobs:
doc:
uses: ComPWA/actions/.github/workflows/ci-docs.yml@v1
with:
specific-pip-packages: ${{ inputs.specific-pip-packages }}
pytest:
uses: ComPWA/actions/.github/workflows/pytest.yml@v1
with:
coverage-target: pwa_pages
skipped-python-versions: all
specific-pip-packages: ${{ inputs.specific-pip-packages }}
style:
if: inputs.specific-pip-packages == ''
uses: ComPWA/actions/.github/workflows/pre-commit.yml@v1
22 changes: 22 additions & 0 deletions .github/workflows/clean-caches.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Clean caches

on:
pull_request:
types:
- closed
workflow_dispatch:
inputs:
ref:
description: Clean caches for this branch name or ref
required: false
type: string

jobs:
cleanup:
name: Remove caches
runs-on: ubuntu-22.04
steps:
- uses: ComPWA/actions/clean-caches@v1
with:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ref: ${{ inputs.ref }}
45 changes: 0 additions & 45 deletions .github/workflows/linkcheck.yml

This file was deleted.

14 changes: 0 additions & 14 deletions .github/workflows/milestone.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/pr-linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- uses: docker://agilepathway/pull-request-label-checker:latest
with:
any_of: |
Bug,💡 Feature,⚠️ Interface,📝 Docs,🔨 Maintenance,🖱️ DX,📖 Analysis,
Bug, Feature,⚠️ Interface,📝 Docs,🔨 Maintenance,🖱️ DX,📖 Analysis,
📖 Software,📖 Theory
none_of: ❌ Won't fix,💫 Good first issue
repo_token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
Loading

0 comments on commit 6a3317e

Please sign in to comment.