-
Notifications
You must be signed in to change notification settings - Fork 106
42 lines (42 loc) · 1.43 KB
/
publish.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
---
name: PyPI publish
# Publish once a maintainer clicks publish on a draft release
# and approves the GitHub actions job
on:
release:
types: [released]
jobs:
build:
runs-on: ubuntu-latest
environment: pypi-prod
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.8
uses: actions/setup-python@v5
with:
python-version: 3.8
- name: Install base dependencies
run: |
python -m pip install --upgrade pip
python -m pip install poetry twine
- name: Bump version number
run: poetry version ${{ github.event.release.tag_name }}
- name: Build and publish
env:
PYPI_USERNAME: __token__
PYPI_PASSWORD: ${{ secrets.PYPI_API_TOKEN_HERA }}
run: |
poetry build
twine upload -u __token__ -p $PYPI_PASSWORD --skip-existing dist/*
rm -rf dist/*
- name: Rename hera to hera-workflows for backwards compat
run: |
sed -i 's/name = "hera" # project-name/name = "hera-workflows" # project-name/g' pyproject.toml
sed -i 's/name = "hera" # project-name/name = "hera-workflows" # project-name/g' src/hera/_version.py
- name: Build and publish
env:
PYPI_USERNAME: __token__
PYPI_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
poetry build
twine upload -u __token__ -p $PYPI_PASSWORD --skip-existing dist/*