-
Notifications
You must be signed in to change notification settings - Fork 0
172 lines (166 loc) · 5.58 KB
/
Copy pathplugins.yml
File metadata and controls
172 lines (166 loc) · 5.58 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
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
170
171
172
name: EZPZ Plugin Management
on:
push:
branches: [main, develop]
paths: ["plugins/**", "ezpz.toml", "pyproject.toml"]
pull_request:
branches: [main]
paths: ["plugins/**", "ezpz.toml", "pyproject.toml"]
workflow_dispatch:
inputs:
operation:
description: "Operation to perform"
required: true
default: "test"
type: choice
options: ["test", "register-and-update", "publish"]
dry_run:
description: "Dry run (no actual registry changes)"
required: false
default: false
type: boolean
env:
PYTHON_VERSION: "3.13"
RUST_VERSION: "1.87"
jobs:
discover-plugins:
runs-on: ubuntu-latest
outputs:
project-plugins: ${{ steps.analyze.outputs.project-plugins }}
plugins-to-register: ${{ steps.analyze.outputs.plugins-to-register }}
plugins-to-update: ${{ steps.analyze.outputs.plugins-to-update }}
has-changes: ${{ steps.analyze.outputs.has-changes }}
steps:
- uses: actions/checkout@v4.2.2
- uses: actions/setup-python@v5.6.0
with:
python-version: ${{ env.PYTHON_VERSION }}
- uses: eifinger/setup-rye@v4.2.9
with:
enable-cache: true
- uses: hustcer/setup-nu@v3.20
with:
version: "0.105.1"
- uses: extractions/setup-just@v2
with:
just-version: "1.40.0"
- run: rye sync
- run: rye run ezpz registry refresh
- id: analyze
run: just actions::analyze-plugins
test-plugins:
runs-on: ubuntu-latest
needs: discover-plugins
if: |
(github.event_name == 'push' || github.event_name == 'pull_request' || github.event.inputs.operation == 'test') &&
needs.discover-plugins.outputs.has-changes == 'true'
strategy:
matrix:
plugin: ${{ fromJson(needs.discover-plugins.outputs.project-plugins) }}
fail-fast: false
steps:
- uses: actions/checkout@v4.2.2
- uses: actions/setup-python@v5.6.0
with:
python-version: ${{ env.PYTHON_VERSION }}
- uses: actions-rs/toolchain@v1.0.6
if: hashFiles(format('{0}/Cargo.toml', matrix.plugin.path)) != ''
with:
toolchain: ${{ env.RUST_VERSION }}
default: true
- uses: eifinger/setup-rye@v4.2.9
with:
enable-cache: true
- uses: hustcer/setup-nu@v3.20
with:
version: "0.105.1"
- uses: extractions/setup-just@v2
with:
just-version: "1.40.0"
- uses: actions/cache@v3
with:
path: |
~/.cache/uv
~/.cargo/registry
~/.cargo/git
target/
key: ${{ runner.os }}-${{ matrix.plugin.package_name }}-${{ hashFiles(format('{0}/**/pyproject.toml', matrix.plugin.path), format('{0}/**/Cargo.toml', matrix.plugin.path)) }}
- run: rye sync
- name: Test Plugin Pipeline
run: |
just actions::test-plugin-pipeline \
"${{ matrix.plugin.package_name }}" \
"${{ matrix.plugin.path }}"
register-update-plugins:
runs-on: ubuntu-latest
needs: [discover-plugins, test-plugins]
if: |
github.event_name == 'workflow_dispatch' &&
needs.discover-plugins.outputs.has-changes == 'true' &&
needs.test-plugins.result == 'success' &&
github.event.inputs.operation == 'register-and-update'
steps:
- uses: actions/checkout@v4.2.2
- uses: actions/setup-python@v5.6.0
with:
python-version: ${{ env.PYTHON_VERSION }}
- uses: eifinger/setup-rye@v4.2.9
with:
enable-cache: true
- uses: extractions/setup-just@v2
with:
just-version: "1.40.0"
- run: rye sync
- run: rye run ezpz registry refresh
- name: Register and Update Plugins
env:
EZPZ_SERVER_SECRET: ${{ secrets.EZPZ_SERVER_SECRET }}
run: |
just actions::register-update-plugins \
'${{ needs.discover-plugins.outputs.plugins-to-register }}' \
'${{ needs.discover-plugins.outputs.plugins-to-update }}' \
"${{ github.event.inputs.dry_run }}"
publish-plugins:
runs-on: ubuntu-latest
needs: [discover-plugins, test-plugins]
if: |
github.event_name == 'workflow_dispatch' &&
github.event.inputs.operation == 'publish'
strategy:
matrix:
plugin: ${{ fromJson(needs.discover-plugins.outputs.project-plugins) }}
fail-fast: false
steps:
- uses: actions/checkout@v4.2.2
- uses: actions/setup-python@v5.6.0
with:
python-version: ${{ env.PYTHON_VERSION }}
- uses: actions-rs/toolchain@v1.0.6
if: hashFiles(format('{0}/Cargo.toml', matrix.plugin.path)) != ''
with:
toolchain: ${{ env.RUST_VERSION }}
default: true
- uses: eifinger/setup-rye@v4.2.9
with:
enable-cache: true
- uses: hustcer/setup-nu@v3.20
with:
version: "0.105.1"
- uses: extractions/setup-just@v2
with:
just-version: "1.40.0"
- run: |
rye sync
rye add twine
- name: Publish Plugin
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
run: |
just actions::publish-plugin \
"${{ matrix.plugin.package_name }}" \
"${{ matrix.plugin.path }}" \
"${{ github.event.inputs.dry_run }}" \
'${{ needs.discover-plugins.outputs.plugins-to-register }}' \
'${{ needs.discover-plugins.outputs.plugins-to-update }}'