Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add realease github workflow #318

Merged
merged 18 commits into from
Mar 22, 2024
73 changes: 41 additions & 32 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,30 +1,39 @@
---
name: CI

on:
workflow_dispatch:
pull_request:
branches:
- main
paths-ignore:
- "docs/**"
- "*.md"
push:
branches: main

branches:
- main
paths-ignore:
- "docs/**"
- "*.md"
jobs:
quality:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setting up PDM
uses: pdm-project/setup-pdm@v4
with:
python-version: "3.10"
architecture: x64
- name: Setting up nox
uses: wntrblm/[email protected]
with:
python-versions: "3.10"
- name: Performing lint checks
run: nox -s lint
- name: Performing static type checks
run: nox -s check
- name: Checkout
uses: actions/checkout@v4
- name: Setting up PDM
uses: pdm-project/setup-pdm@v4
with:
python-version: "3.10"
architecture: x64
- name: Setting up nox
uses: wntrblm/[email protected]
with:
python-versions: "3.10"
- name: Performing lint checks
run: nox -s lint
- name: Performing static type checks
run: nox -s check

tests:
strategy:
Expand All @@ -35,18 +44,18 @@ jobs:
- "3.10"
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
lfs: true
- name: Setting up PDM
uses: pdm-project/setup-pdm@v4
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- name: Setting up nox
uses: wntrblm/[email protected]
with:
python-versions: ${{ matrix.python-version }}
- name: Executing unit tests
run: nox -s test
- name: Checkout
uses: actions/checkout@v4
with:
lfs: true
- name: Setting up PDM
uses: pdm-project/setup-pdm@v4
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- name: Setting up nox
uses: wntrblm/[email protected]
with:
python-versions: ${{ matrix.python-version }}
- name: Executing unit tests
run: nox -s test
46 changes: 46 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
name: Release

on:
push:
tags:
- "*"

jobs:
release-pypi:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
steps:
- uses: actions/checkout@v4
- name: Setting up PDM
uses: pdm-project/setup-pdm@v4
with:
python-version: "3.10"
architecture: x64
- name: Setting up nox
uses: wntrblm/[email protected]
with:
python-versions: "3.10"
- name: Build artifacts
run: |
nox -s build
- name: Test Build
run: |
python -m pip install dist/*.whl
eva --version
- name: Build Release Docs
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git fetch origin gh-pages:gh-pages
tag="${{ github.ref_name }}"
DOC_VERSION=${tag%.*}
nox -s docs -- deploy --alias-type=copy --update-aliases "$DOC_VERSION" latest
git push origin gh-pages
- name: Publish package distributions to PyPI
run: nox -s publish -- --no-build
env:
PDM_PUBLISH_USERNAME: ${{ secrets.PYPI_USERNAME }}
PDM_PUBLISH_PASSWORD: ${{ secrets.PYPI_PASSWORD }}