-
Notifications
You must be signed in to change notification settings - Fork 1
40 lines (39 loc) · 1.19 KB
/
pypi.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
name: Publish to PyPI
# run when pushes are made to main or dev branches and there are changes in the grss/version.txt file
on:
push:
branches:
- main
- dev
paths:
- "grss/version.txt"
jobs:
build-and-upload:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
with:
submodules: true
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.8"
- name: Initialize repository
run: |
source initialize.sh --no-tm-overwrite
- name: Run build script
run: source build_python.sh
- name: Show files
run: ls -l dist
- name: Publish to Test PyPI
if: github.ref == 'refs/heads/dev'
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository-url: https://test.pypi.org/legacy/
- name: Publish to PyPI
if: github.ref == 'refs/heads/main'
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}