forked from indico/indico-plugins
-
Notifications
You must be signed in to change notification settings - Fork 0
169 lines (157 loc) Β· 4.44 KB
/
pypi.yml
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
name: PyPI release π π¦
env:
PYTHON_VERSION: '3.12'
TZ: Europe/Zurich
on:
push:
tags:
- 'v*'
- '!v0.*'
- '!v1.*'
- '!v2.*'
- '!v3.0'
- '!v3.0.*'
- '!v3.1'
- '!v3.1.*'
- '!v3.2'
- '!v3.2.*'
- '!*\+docs'
workflow_dispatch:
inputs:
plugin-name:
description: Plugin name
required: true
type: choice
options:
- '' # this is invalid for a `required` dropdown so we force a choice instead of preselecting the first one
- citadel
- cloud_captchas
- livesync
- livesync_debug
- owncloud
- payment_manual
- payment_paypal
- payment_sixpay
- piwik
- previewer_code
- previewer_jupyter
- prometheus
- storage_s3
- themes_legacy
- ursh
- vc_dummy
- vc_zoom
permissions:
contents: read
jobs:
check-version:
name: Check version
runs-on: ubuntu-22.04
if: github.event_name != 'workflow_dispatch'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
name: Set up Python π
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Check version π
run: python .github/utils/check_version.py "${GITHUB_REF#refs/tags/v}"
build:
name: Build plugins π
needs: check-version
if: ${{ !cancelled() && (needs.check-version.result == 'success' || needs.check-version.result == 'skipped') }}
uses: ThiefMaster/indico-gh-actions/.github/workflows/build-plugins.yml@master
with:
scripts-repo: ThiefMaster/indico-gh-actions
directory: public
add-version-suffix: false
plugin: ${{ github.event_name == 'workflow_dispatch' && inputs.plugin-name }}
test-install:
name: Test installing plugins
needs: build
runs-on: ubuntu-22.04
steps:
- name: Download build artifacts π¦
uses: actions/download-artifact@v4
with:
merge-multiple: true
pattern: plugin-wheel-*
path: wheels
- name: Set up Python π
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install Indico π§
run: |
sudo apt-get install libpq-dev
pip install setuptools wheel
pip install indico
- name: Install plugins π§©
run: pip install wheels/*.whl
- name: List plugins π§©
run: indico setup list-plugins
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
- test-install
runs-on: ubuntu-22.04
permissions:
contents: write
steps:
- name: Download build artifacts π¦
uses: actions/download-artifact@v4
with:
merge-multiple: true
pattern: plugin-wheel-*
path: dist
- name: Create draft release π
run: >-
gh release create
--draft
--repo ${{ github.repository }}
--title ${{ github.ref_name }}
${{ github.ref_name }}
dist/*
env:
GH_TOKEN: ${{ github.token }}
publish-pypi:
name: Publish π
needs:
- build
- test-install
- create-github-release
# 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@v4
with:
merge-multiple: true
pattern: plugin-wheel-*
path: dist
# Try uploading to Test PyPI first, in case something fails.
- name: Publish to Test PyPI π§ͺ
uses: pypa/[email protected]
with:
repository-url: https://test.pypi.org/legacy/
packages-dir: dist/
skip-existing: true
- name: Publish to PyPI π
uses: pypa/[email protected]
with:
packages-dir: dist/
skip-existing: true
- name: Publish GitHub release π
run: >-
gh release edit
--draft=false
--repo ${{ github.repository }}
${{ github.ref_name }}
env:
GH_TOKEN: ${{ github.token }}