-
Notifications
You must be signed in to change notification settings - Fork 37
87 lines (81 loc) · 2.87 KB
/
release.yaml
File metadata and controls
87 lines (81 loc) · 2.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
---
name: Release
on:
push:
tags:
- "*"
concurrency:
group: "${{ github.workflow }}"
cancel-in-progress: true
permissions: {}
jobs:
release-pypi:
runs-on: ubuntu-latest
permissions:
id-token: write # Needed for publishing to PyPI
contents: write # Needed for pushing to GitHub Pages
pull-requests: write # Needed for creating version bump PR
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
# Needed to push to gh-pages branch
# IMPORTANT: Avoid publishing the .git/ folder to prevent leaking credentials
persist-credentials: true
- name: Setting up PDM
uses: pdm-project/setup-pdm@94a823180e06fcde4ad29308721954a521c96ed0 # v4
with:
python-version: "3.10"
architecture: x64
- name: Setting up nox
uses: wntrblm/nox@a74da2c766d4e656d6105639926c31f3aa4a6ca1 # 2025.02.09
with:
python-versions: "3.10"
- name: Free up disk space
run: |
sudo rm -rf /usr/local/lib/android \
/opt/ghc \
/opt/hostedtoolcache/CodeQL \
/usr/local/.ghcup
sudo docker system prune -af || true
sudo apt-get clean
sudo rm -rf /var/lib/apt/lists/*
- name: Configure Git Credentials
run: |
git config user.email "action@github.com"
git config user.name "GitHub Action"
- name: Bumping version
run: |
nox -s bump -- to "${GITHUB_REF_NAME}"
- name: Build artifacts
run: |
nox -s build
- name: Test Build
run: |
python -m pip install dist/*.whl
eva --version
- name: Build Release Docs
env:
PIP_NO_CACHE_DIR: "1"
run: |
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"
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 }}
- name: Create Pull Request for version bump
uses: peter-evans/create-pull-request@98357b18bf14b5342f975ff684046ec3b2a07725 # v8
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "chore: bump version to ${{ github.ref_name }}"
title: "bump version to ${{ github.ref_name }} [skip ci]"
body: |
This PR updates the pyproject.toml with the new version number.
Version: ${{ github.ref_name }}
*Automated PR created by the Release workflow*
branch: bump-version-${{ github.ref_name }}
base: main