-
Notifications
You must be signed in to change notification settings - Fork 5
56 lines (52 loc) · 1.66 KB
/
Copy pathrelease.yaml
File metadata and controls
56 lines (52 loc) · 1.66 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
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# GitHub recommends pinning actions to a commit SHA.
# To get a newer version, you will need to update the SHA.
# You can also reference a tag or branch, but the action may change without warning.
name: Upload Python Package
on:
push:
branches:
- master
- main
jobs:
deploy:
permissions:
contents: write
runs-on: ubuntu-latest
environment: py-production
steps:
- uses: actions/checkout@v4
- name: Read current version
id: version
run: |
python3 - <<'PY' >> "$GITHUB_OUTPUT"
import json
with open("release/package.json") as file:
print("value=%s" % json.load(file)["version"])
PY
- name: Create GitHub Release
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release create "v${{ steps.version.outputs.value }}" \
--title "v${{ steps.version.outputs.value }}" \
--notes-file release/description.md
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: python -m build
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@v1.12.4
with:
user: __token__
password: ${{ secrets.PYPI_PASSWORD }}
verify-metadata: false