This commit is contained in:
lordwelch 2022-01-16 18:44:22 -08:00
parent ed16199940
commit 461a951126
2 changed files with 69 additions and 33 deletions

57
.github/workflows/CI.yaml vendored Normal file
View File

@ -0,0 +1,57 @@
on:
workflow_run:
workflows: "CI"
types:
- completed
permissions:
contents: read
issues: write
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [3.9]
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 1
ref: refs/remotes/pull/${{pull}}/merge
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- uses: actions/download-artifact@v2
with:
name: isort.out
- uses: reviewdog/action-setup@v1
- name: Run reviewdog
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
reviewdog -name="isort" -f=diff -reporter=github-pr-review <isort.diff
- name: Check files using the black formatter
uses: rickstaa/action-black@v1
with:
black_args: "."
- name: Annotate black diff changes using reviewdog
if: steps.action_black.outputs.is_formatted == 'true'
uses: reviewdog/action-suggester@v1
with:
tool_name: black
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: flake8 Lint
if: runner.os == 'Linux'
uses: reviewdog/action-flake8@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

View File

@ -1,30 +1,27 @@
name: Build
name: CI
on:
push:
tags:
- "[0-9]+.[0-9]+.[0-9]+*"
pull_request:
jobs:
build:
permissions:
contents: write
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [3.9]
os: [ubuntu-latest, macos-10.15, windows-latest]
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
fetch-depth: 1
ref: refs/remotes/pull/${{pull}}/merge
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python3 -m pip install -r requirements_dev.txt
@ -33,31 +30,13 @@ jobs:
python3 -m pip install -r "$requirement"
done
shell: bash
- name: Install Windows dependencies
- name: Run CI
run: |
choco install -y zip
if: runner.os == 'Windows'
- name: build
run: |
make pydist
make dist
- name: Archive production artifacts
isort . -c >isort.out
isort . --diff >isort.diff
- name: upload isort output
uses: actions/upload-artifact@v2
if: runner.os != 'Linux' # linux binary currently has a segfault when running on latest fedora
with:
name: "${{ format('ComicTagger-{0}', runner.os) }}"
path: dist/*.zip
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
prerelease: "${{ contains(github.ref, '-') }}" # alpha-releases should be 1.3.0-alpha.x full releases should be 1.3.0
draft: true
files: dist/*.zip
- name: "Publish distribution 📦 to PyPI"
if: startsWith(github.ref, 'refs/tags/') && runner.os == 'Linux'
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.PYPI_API_TOKEN }}
packages_dir: piprelease
path: isort.out