-
Notifications
You must be signed in to change notification settings - Fork 1
39 lines (30 loc) · 1020 Bytes
/
Copy pathpublish.yml
File metadata and controls
39 lines (30 loc) · 1020 Bytes
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
name: Publish To PyPI
on:
push:
branches: ['main']
jobs:
build-publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set environnment package version from commit
run: |
SHORT_SHA=$(echo ${{ github.sha }} | cut -c-6)
echo "PACKAGE_VERSION=0.2.$(date +%Y%m%d).$((16#${SHORT_SHA}))" >> $GITHUB_ENV # use similar convention as Go bindings, but with decimal digits only
- name: Set up Python 3.12
uses: actions/setup-python@v3
with:
python-version: "3.12"
- name: Install dependencies
run: pip install build twine
- name: Build wheel
run: |
echo "Creating __init__.py files"
find cs3 -type d -exec touch {}/__init__.py \;
echo "Building version ${PACKAGE_VERSION}"
python -m build
- name: Publish distribution to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: twine upload --repository pypi dist/*