-
Notifications
You must be signed in to change notification settings - Fork 3
72 lines (68 loc) · 2 KB
/
Copy pathdeployment.yml
File metadata and controls
72 lines (68 loc) · 2 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
name: Deployment
on:
push:
branches-ignore:
- dependabot/**
- release-please-**
pull_request:
branches-ignore:
- release-please-**
jobs:
ci:
name: CI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Installing dependencies
run: |
python -m pip install \
build \
readme_renderer[md] \
setuptools_scm
- name: Validate README for PyPI
run: |
python -m readme_renderer README.md -o /tmp/README.html
- name: Build distributions
run: |
python -m build --outdir $PWD/dist .
release-please:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' && github.repository == 'DIRACGrid/dirac-cwl' }}
outputs:
release_created: ${{ steps.release.outputs.release_created }}
permissions:
contents: write
pull-requests: write
steps:
- uses: googleapis/release-please-action@v4
id: release
with:
token: ${{ secrets.GITHUB_TOKEN }}
release-type: simple
deploy-pypi:
name: PyPI deployment
runs-on: ubuntu-latest
needs: release-please
if: ${{ github.event_name == 'push' && github.repository == 'DIRACGrid/dirac-cwl' && needs.release-please.outputs.release_created == 'true' }}
permissions:
id-token: write # Required for trusted publishing on PyPI
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Required for setuptools_scm to find tags
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Installing dependencies
run: |
python -m pip install \
build \
setuptools_scm
- name: Build distributions
run: |
python -m build --outdir $PWD/dist .
- name: Publish package on PyPI
uses: pypa/gh-action-pypi-publish@release/v1