This repository was archived by the owner on Feb 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
49 lines (47 loc) · 1.65 KB
/
deployment.yml
File metadata and controls
49 lines (47 loc) · 1.65 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
name: Deployment
on:
push:
tags:
- 2.0.0a[0-9]+
pull_request:
jobs:
deploy-pypi:
name: PyPI deployment
runs-on: "ubuntu-latest"
if: github.event_name != 'push' || github.repository == 'DIRACGrid/COMDIRAC'
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: "3.9"
- name: Install dependencies
run: pip install build readme_renderer diraccfg
- name: Validate README for PyPI
run: python -m readme_renderer README.rst -o /tmp/README.html
- name: Make PEP-440 style release on GitHub
id: PEP-440
run: |
NEW_STYLE=${GITHUB_REF##*/}
echo "Use ${NEW_STYLE}" version
echo ::set-output name=tag_name::"v$NEW_STYLE"
echo ::set-output name=target_commitish::"$(git rev-parse HEAD)"
- name: Publish ${{ steps.PEP-440.outputs.tag_name }} release to GitHub
if: github.event_name == 'push'
uses: softprops/action-gh-release@v1
with:
target_commitish: ${{ steps.PEP-440.outputs.target_commitish }}
body_path: release.notes
tag_name: ${{ steps.PEP-440.outputs.tag_name }}
- name: Get ${{ steps.PEP-440.outputs.tag_name }} tag
if: github.event_name == 'push'
uses: actions/checkout@v2
with:
ref: ${{ steps.PEP-440.outputs.tag_name }}
- name: Build distributions
run: python -m build
- name: Publish package on PyPI
if: github.event_name == 'push'
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}