Skip to content

Commit

Permalink
improve github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Darkflame72 committed Nov 11, 2020
1 parent b569fa9 commit f19a213
Show file tree
Hide file tree
Showing 12 changed files with 345 additions and 92 deletions.
28 changes: 28 additions & 0 deletions .github/ISSUE_TEMPLATES/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
name: Bug report
about: Create a report to help us improve
title: ""
labels: ""
assignees: ""
---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**OS (please complete the following information:**

- OS: [e.g. Windows 10]
- Python version [e.g. 3.8.1]
- Version [e.g. 1]

**Additional context**
Add any other context about the problem here.
19 changes: 19 additions & 0 deletions .github/ISSUE_TEMPLATES/feature-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
name: Feature request
about: Suggest an idea for this project
title: ""
labels: ""
assignees: ""
---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
23 changes: 15 additions & 8 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "pip"
directory: "/" # Location of package manifests
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: "daily"
interval: daily
- package-ecosystem: pip
directory: "/.github/workflows"
schedule:
interval: daily
- package-ecosystem: pip
directory: "/docs"
schedule:
interval: daily
- package-ecosystem: pip
directory: "/"
schedule:
interval: daily
38 changes: 38 additions & 0 deletions .github/labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
# Labels names are important as they are used by Release Drafter to decide
# regarding where to record them in changelog or if to skip them.
#
# The repository label will be autoaticalluu configured using this file and
# the GitHub Action https://github.com/marketplace/actions/github-labeler.
- name: invalid
description: This doesn't seem right
color: e4e669
- name: performance
description: A code change that improves performance
color: f3ffb2
- name: python
description: Pull requests that update Python code
color: 2b67c6
- name: question
description: Further information is requested
color: d876e3
- name: refactoring
description: A code change that neither fixes a bug nor adds a feature
color: d4c5f9
- name: removal
description: Removals and Deprecations
color: f00000
- name: style
description:
Changes that do not affect the meaning of the code (white-space, formatting,
etc)
color: ffc6df
- name: task
description:
color: d88c70
- name: testing
description: Adding missing tests or correcting existing tests
color: 79e57f
- name: wontfix
description: This will not be worked on
color: ffffff
23 changes: 13 additions & 10 deletions .github/releasedrafter.yml → .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,29 @@
categories:
- title: ":boom: Breaking Changes"
label: "breaking"
- title: ":package: Build System"
label: "build"
- title: ":construction_worker: Continuous Integration"
label: "ci"
- title: ":books: Documentation"
label: "documentation"
- title: ":rocket: Features"
label: "enhancement"
- title: ":fire: Removals and Deprecations"
label: "removal"
- title: ":beetle: Fixes"
label: "bug"
- title: ":racehorse: Performance"
label: "performance"
- title: ":rotating_light: Testing"
label: "testing"
- title: ":construction_worker: Continuous Integration"
label: "ci"
- title: ":books: Documentation"
label: "documentation"
- title: ":hammer: Refactoring"
label: "refactoring"
- title: ":fire: Removals and Deprecations"
label: "removal"
- title: ":lipstick: Style"
label: "style"

- title: ":package: Dependencies"
labels:
- "dependencies"
- "build"
template: |
## What’s Changed
## Changes
$CHANGES
5 changes: 5 additions & 0 deletions .github/workflows/constraints.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pip==20.2.3
nox==2020.8.22
nox-poetry==0.5.0
poetry==1.1.2
virtualenv==20.0.35
16 changes: 0 additions & 16 deletions .github/workflows/coverage.yml

This file was deleted.

25 changes: 25 additions & 0 deletions .github/workflows/labeller.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Labeler

on:
push:
branches:
- main
- master

jobs:
labeler:
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/checkout@v2.3.3

- name: Run Labeler
if: success()
uses: crazy-max/ghaction-github-labeler@v3.1.0
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
yaml-file: .github/labels.yml
skip-delete: true
dry-run: false
exclude: |
hacktoberfest*
12 changes: 0 additions & 12 deletions .github/workflows/release-drafter.yml

This file was deleted.

83 changes: 72 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,79 @@
name: Release

on:
release:
types: [published]
push:
branches:
- main
- master

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
- name: Check out the repository
uses: actions/checkout@v2.3.3
with:
fetch-depth: 2

- name: Set up Python
uses: actions/setup-python@v2.1.4
with:
python-version: "3.9"

- name: Upgrade pip
run: |
pip install --constraint=.github/workflows/constraints.txt pip
pip --version
- name: Install Poetry
run: |
pip install --constraint=.github/workflows/constraints.txt poetry
poetry --version
- name: Check if there is a parent commit
id: check-parent-commit
run: |
echo "::set-output name=sha::$(git rev-parse --verify --quiet HEAD^)"
- name: Detect and tag new version
id: check-version
if: steps.check-parent-commit.outputs.sha
uses: salsify/action-detect-and-tag-new-version@v2.0.1
with:
version-command: |
bash -o pipefail -c "poetry version | awk '{ print \$2 }'"
- name: Bump version for developmental release
if: "! steps.check-version.outputs.tag"
run: |
poetry version patch &&
version=$(poetry version | awk '{ print $2 }') &&
poetry version $version.dev.$(date +%s)
- name: Build package
run: |
poetry build --ansi
- name: Publish package on PyPI
if: steps.check-version.outputs.tag
uses: pypa/gh-action-pypi-publish@v1.4.1
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}

- name: Publish package on TestPyPI
if: "! steps.check-version.outputs.tag"
uses: pypa/gh-action-pypi-publish@v1.4.1
with:
user: __token__
password: ${{ secrets.TEST_PYPI_TOKEN }}
repository_url: https://test.pypi.org/legacy/

- name: Publish the release notes
uses: release-drafter/release-drafter@v5.11.0
with:
python-version: "3.8"
architecture: x64
- run: pip install nox==2019.11.9
- run: pip install poetry==1.0.5
- run: nox
- run: poetry build
- run: poetry publish --username=__token__ --password=${{ secrets.PYPI_TOKEN }}
publish: ${{ steps.check-version.outputs.tag != '' }}
tag: ${{ steps.check-version.outputs.tag }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25 changes: 0 additions & 25 deletions .github/workflows/test-pypi.yml

This file was deleted.

0 comments on commit f19a213

Please sign in to comment.