-
Notifications
You must be signed in to change notification settings - Fork 8
65 lines (63 loc) · 1.74 KB
/
publish.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
name: Publish to PyPI.org
on:
release:
types: [published]
jobs:
build-nim:
runs-on: ${{matrix.os}}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/buildnim
- name: Cache Unix
if: runner.os == 'Linux' || runner.os == 'macOS'
uses: actions/upload-artifact@v3
with:
name: "nimlite-unix"
path: |
${{ env.NIMLITE_DIR }}/${{ env.NIM_PACKAGE_NAME }}.so
- name: Cache Windows
if: runner.os == 'Windows'
uses: actions/upload-artifact@v3
with:
name: "nimlite-windows"
path: |
${{ env.NIMLITE_DIR }}/${{ env.NIM_PACKAGE_NAME }}.pyd
pypi:
needs: [build-nim]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set Environment Variables
uses: allenevans/[email protected]
with:
NIMLITE_DIR: 'nimlite'
NIM_PACKAGE_NAME: 'libnimlite'
- name: Cache Restore Unix
uses: actions/download-artifact@v3
with:
name: nimlite-unix
path: |
${{ env.NIMLITE_DIR }}
- name: Cache Restore Windows
uses: actions/download-artifact@v3
with:
name: nimlite-windows
path: |
${{ env.NIMLITE_DIR }}
- name: install python
run: |
python3 -m pip install --upgrade build
- name: build wheel
run: |
python3 -m build --wheel
- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}