-
Notifications
You must be signed in to change notification settings - Fork 71
82 lines (74 loc) · 2.06 KB
/
python.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
76
77
78
79
80
81
name: Build Tensornet
on:
push:
branches:
- '**' # matches every branch
tags:
- 'v[0-9]+'
- 'v[0-9]+\.[a-z0-9]+'
- 'v[0-9]+\.[0-9]+\.[a-z0-9]+'
- 'v[0-9]+\.[0-9]+\.[0-9]+\.[a-z0-9]+'
pull_request:
jobs:
tn_build:
runs-on: ubuntu-latest
env:
NEED_ACTIVATE_ENV: "false"
steps:
- name: checkout repository
uses: actions/checkout@v4
- uses: mamba-org/setup-micromamba@v1
with:
micromamba-version: '1.5.8-0'
environment-file: config/tn_build.yaml
init-shell: bash
cache-downloads: true
post-cleanup: 'none'
- name: Run custom command in micromamba environment
run: |
./manager build
./manager copy-libs
rm -rf /home/runner/.cache/bazel # remove bazel cache to avoid job hang
shell: micromamba-shell {0}
- name: Create setup dist
run: |
./manager create_dist
shell: micromamba-shell {0}
- name: Store wheels
uses: actions/upload-artifact@v4
with:
path: dist/
retention-days: 7
publish-to-test-pypi:
name: Upload to test-pypi
needs:
- tn_build
runs-on: ubuntu-latest
permissions:
id-token: write # mandatory for trusted publishing
steps:
- name: Download wheels
uses: actions/download-artifact@v4
with:
merge-multiple: true
path: dist/
- name: Publish wheels to test-PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
publish-to-pypi:
name: Upload to pypi
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
needs:
- tn_build
runs-on: ubuntu-latest
permissions:
id-token: write # mandatory for trusted publishing
steps:
- name: Download wheels
uses: actions/download-artifact@v4
with:
merge-multiple: true
path: dist/
- name: Publish wheels to PyPI
uses: pypa/gh-action-pypi-publish@release/v1