forked from BYVoid/OpenCC
-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (38 loc) · 1.3 KB
/
release-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
name: Build and upload python package to PyPI
on:
workflow_dispatch
jobs:
release-pypi:
strategy:
matrix:
os: [ubuntu-latest, macos-13, macos-14, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v1
- name: Build package and upload from docker (Linux)
if: runner.os == 'Linux'
run: |
docker run --rm -v "${PWD}:/opt/OpenCC" \
-e TWINE_USERNAME=__token__ \
-e TWINE_PASSWORD=${{ secrets.PYPI_TOKEN }} \
ubuntu:22.04 /bin/bash /opt/OpenCC/release-pypi-linux.sh
- name: Build package and upload (macOS)
if: runner.os == 'macOS' && runner.arch == 'x64'
run: bash release-pypi-macos.sh
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
- name: Build package and upload (macOS arm64)
if: runner.os == 'macOS' && runner.arch == 'arm64'
run: bash release-pypi-macos-arm.sh
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
- name: Build package and upload (Windows)
if: runner.os == 'Windows'
run: |
C:\Miniconda/condabin/conda.bat init powershell
./release-pypi-windows.cmd
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}