-
Notifications
You must be signed in to change notification settings - Fork 3
73 lines (59 loc) · 2.46 KB
/
python-release.yaml
File metadata and controls
73 lines (59 loc) · 2.46 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
name: Dataplane Python Package Release
on:
release:
types: [published]
jobs:
worker:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10"]
permissions:
contents: read
packages: write
# This is used to complete the identity challenge
# with sigstore/fulcio when running outside of PRs.
id-token: write
steps:
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
- name: Release check out ${{ steps.get_version.outputs.VERSION }}
uses: actions/checkout@v3
with:
ref: ${{ steps.get_version.outputs.VERSION }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python3 -m pip install --upgrade twine
python3 -m pip install --upgrade build
if [ -f tests/requirements.txt ]; then pip install -r tests/requirements.txt; fi
- name: Update pyproject.toml version ${{ steps.get_version.outputs.VERSION }}
run: python3 update_toml_release.py ${{ steps.get_version.outputs.VERSION }}
- name: Build python package
run: python3 -m build
- name: Distribute python package
run: python3 -m twine upload dist/* -u "__token__" -p ${{ secrets.PYPI_API_TOKEN }}
# - uses: actions/checkout@v3
# - name: Install dependencies
# run: |
# python -m pip install --upgrade pip
# python3 -m pip install --upgrade toml
# - name: Update pyproject.toml version ${{ steps.get_version.outputs.VERSION }}
# run: python3 update_toml_release.py ${{ steps.get_version.outputs.VERSION }}
# - name: Commit report
# continue-on-error: true
# run: |
# git config --global user.name 'Dataplane Actions'
# git config --global user.email 'saul-data@users.noreply.github.com'
# git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY
# git checkout "${GITHUB_REF:11}"
# git add pyproject.toml
# git commit -am "Automated TOML release update"
# git push
# # git diff --exit-code || git commit -am "Automated TOML release update"
# # git diff --exit-code || git push