-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (38 loc) · 1.14 KB
/
CD.yml
File metadata and controls
43 lines (38 loc) · 1.14 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
name: CD Pipeline
on:
create:
jobs:
build:
name: Build
runs-on: ubuntu-latest
if: github.event_name == 'create' && startsWith(github.ref, 'refs/tags')
steps:
- name: Load version into env
shell: bash
run: |
[[ $GITHUB_REF =~ refs/tags/(.*) ]]
version="${BASH_REMATCH[1]}"
[ -z "${version}" ] && exit 1
echo "RELEASE_VERSION=${version}" >> $GITHUB_ENV
- uses: actions/checkout@v4
- uses: ./.github/build
with:
package-version: ${RELEASE_VERSION}
pypi-publish:
name: Publish to pypi
needs: build
if: github.event_name == 'create' && startsWith(github.ref, 'refs/tags')
runs-on: ubuntu-latest
# Specifying a GitHub environment is optional, but strongly encouraged
environment: pypi
permissions:
# IMPORTANT: this permission is mandatory for Trusted Publishing
id-token: write
steps:
- uses: actions/download-artifact@v4
with:
name: dist
path: dist/
- uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: ${{ vars.REPOSITORY_URL }}