-
Notifications
You must be signed in to change notification settings - Fork 174
71 lines (60 loc) · 2.33 KB
/
release_win_amd64.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
name: WindowsRelease_amd64
on:
release:
types: [published]
permissions:
contents: read
jobs:
build:
runs-on: windows-2019
strategy:
matrix:
# python-version: [ '3.8', '3.9', '3.10', '3.11', '3.12']
python-version: ['3.10']
architecture: [ 'x64' ]
steps:
# Checkout the latest branch of Paddle2ONNX.
- name: Checkout Paddle2ONNX
uses: actions/checkout@v4
with:
submodules: true
# Clone protobuf repository and checkout to v21.12
- name: Clone protobuf
run: |
git clone https://github.com/protocolbuffers/protobuf.git
cd protobuf
git checkout v21.12
# Build and install protobuf
- name: Build and install protobuf
run: |
cd protobuf
git submodule update --init --recursive
mkdir build
cd build
cmake -G "Visual Studio 16 2019" -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}\protobuf\protobuf_install\ -Dprotobuf_MSVC_STATIC_RUNTIME=OFF -Dprotobuf_BUILD_SHARED_LIBS=OFF -Dprotobuf_BUILD_TESTS=OFF -Dprotobuf_BUILD_EXAMPLES=OFF ..
cmake --build . --config Release --target install
# Setup Python
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
with:
python-version: ${{ matrix.python-version }}
# Install Python dependencies
- name: Install Python dependencies
run: |
python -m pip install -q --upgrade pip
python -m pip install setuptools wheel auditwheel auditwheel-symbols build twine
- name: Build package
run: |
$Env:PATH = "${{ github.workspace }}\protobuf\protobuf_install\bin;" + $Env:PATH
$Env:PIP_EXTRA_INDEX_URL="https://www.paddlepaddle.org.cn/packages/nightly/cpu/"
python -m build --wheel
- uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6
with:
name: WindowsRelease_${{ matrix.architecture }}_py${{ matrix.python-version }}
path: dist
- name: Publish package
run: |
python -m twine upload --repository-url https://upload.pypi.org/legacy/ dist/*
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PADDLE2ONNX_API_TOKEN }}