-
Notifications
You must be signed in to change notification settings - Fork 0
109 lines (106 loc) · 3.25 KB
/
Copy pathpypi.yml
File metadata and controls
109 lines (106 loc) · 3.25 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
name: PyPI release 🐍 📦
on:
push:
tags:
- 'v*'
- '!v1.*'
- '!v2.*'
- '!v3.0.*'
- '!v3.1.*'
- '!*\+docs'
env:
TZ: Europe/Zurich
PYTHON_VERSION: '3.12'
NODE_VERSION: '22.x'
jobs:
build:
name: Build package 📦
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v6
name: Set up Python 🐍
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install uv
uses: astral-sh/setup-uv@v7
- name: Install build deps 🔧
run: sudo apt-get install libpq-dev
- name: Check version 🔍
run: uv run --no-sync --isolated --with hatchling .github/utils/check_version.py "${GITHUB_REF#refs/tags/v}"
- name: Extract changelog 📜
run: python .github/utils/extract_changelog.py "${GITHUB_REF#refs/tags/v}" /tmp/changelog.md
- uses: actions/setup-node@v6
name: Setup Node
with:
node-version: ${{ env.NODE_VERSION }}
- name: Install Indico + Python deps 🔧
run: uv pip install --system -e '.[dev]'
- name: Install npm deps ☕
run: npm ci
- name: Build wheel 🏗
run: ./bin/maintenance/build-wheel.py indico
- uses: actions/upload-artifact@v7
name: Upload build artifacts 📦
with:
name: indico-wheel
retention-days: 7
path: ./dist
- uses: actions/upload-artifact@v7
name: Store Markdown changelog 📜
with:
name: changelog
retention-days: 7
path: /tmp/changelog.md
create-github-release:
name: Create GitHub release 🐙
# Upload wheel to a GitHub release. It remains available as a build artifact for a while as well.
needs: build
runs-on: ubuntu-22.04
permissions:
contents: write
steps:
- uses: actions/download-artifact@v8
name: Download build artifacts 📦
- name: Create draft release 🐙
run: >-
gh release create
--draft
--repo ${{ github.repository }}
--title ${{ github.ref_name }}
--notes-file changelog/changelog.md
${{ github.ref_name }}
indico-wheel/*
env:
GH_TOKEN: ${{ github.token }}
publish-pypi:
name: Publish 🚀
needs: build
# Wait for approval before attempting to upload to PyPI. This allows reviewing the
# files in the draft release.
environment: publish
runs-on: ubuntu-22.04
permissions:
contents: write
id-token: write
steps:
- uses: actions/download-artifact@v8
# Try uploading to Test PyPI first, in case something fails.
- name: Publish to Test PyPI 🧪
uses: pypa/gh-action-pypi-publish@v1.14.0
with:
repository-url: https://test.pypi.org/legacy/
packages-dir: indico-wheel/
attestations: false
- name: Publish to PyPI 🚀
uses: pypa/gh-action-pypi-publish@v1.14.0
with:
packages-dir: indico-wheel/
- name: Publish GitHub release 🐙
run: >-
gh release edit
--draft=false
--repo ${{ github.repository }}
${{ github.ref_name }}
env:
GH_TOKEN: ${{ github.token }}