-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (73 loc) · 2.13 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
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
74
75
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"
permissions:
id-token: write
jobs:
build:
name: build ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-14]
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Set up Xcode
if: matrix.os == 'macos-14'
uses: maxim-lobanov/setup-xcode@v1.6.0
with:
xcode-version: '15.1.0'
- name: Install doxygen
if: matrix.os == 'ubuntu-latest'
run: sudo apt-get install doxygen
- name: Install doxygen
if: matrix.os == 'macos-14'
run: brew install doxygen
- name: Initialize repository
run: |
source initialize.sh
- name: Build python distributions
run: source build_python.sh
- name: Upload distribution for next job
uses: actions/upload-artifact@master
with:
name: dist-${{ matrix.os }}
path: dist
publish:
needs: build
runs-on: ubuntu-latest
steps:
- name: Download Ubuntu distribution from previous job
uses: actions/download-artifact@master
with:
name: dist-ubuntu-latest
path: dist
- name: Download MacOS distribution from previous job
uses: actions/download-artifact@master
with:
name: dist-macos-14
path: dist
- 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 }}