-
Notifications
You must be signed in to change notification settings - Fork 160
79 lines (69 loc) · 2.06 KB
/
pypi_release.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
on:
push:
tags:
- v*.*
# on:
# push:
jobs:
build:
name: Collect and Build
runs-on: ubuntu-latest
defaults:
run:
shell: bash
container:
image: sophgo/tpuc_dev:latest
options: --user 1001
volumes:
- /github/workspace:/workspace/tpu-mlir/
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Build package
run: |
. release_pip.sh
tar -czvf tpu-mlir-resource.tar regression/
cp -rf install/docs/TPU-MLIR_* ./
cp install/docs/TPU-MLIR快速入门指南.pdf ./TPU-MLIR_Quick_Start_ZH.pdf
cp install/docs/TPU-MLIR开发参考手册.pdf ./TPU-MLIR_Technical_Reference_Manual_ZH.pdf
- name: Upload to Artifacts
uses: actions/upload-artifact@v3
with:
name: my-artifact
path: |
./dist/
./tpu-mlir-resource.tar
./TPU-MLIR_Quick_Start.pdf
./TPU-MLIR_Quick_Start_ZH.pdf
./TPU-MLIR_Technical_Reference_Manual.pdf
./TPU-MLIR_Technical_Reference_Manual_ZH.pdf
pypi-publish:
needs: build
name: Upload release to PyPI
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/tpu_mlir
permissions:
contents: write
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
steps:
- uses: actions/download-artifact@v3
with:
name: my-artifact
path: ./
- name: Release asset
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
./dist/*.whl
./tpu-mlir-resource.tar
./TPU-MLIR_Quick_Start.pdf
./TPU-MLIR_Quick_Start_ZH.pdf
./TPU-MLIR_Technical_Reference_Manual.pdf
./TPU-MLIR_Technical_Reference_Manual_ZH.pdf
- name: Delete .tar.gz file
run: rm ./dist/*.tar.gz
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1