forked from mattsta/signal-backup
-
-
Notifications
You must be signed in to change notification settings - Fork 55
70 lines (60 loc) · 1.62 KB
/
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
name: release
on:
push:
tags:
- '*'
branches: [ main ]
workflow_dispatch:
jobs:
build:
name: build ${{ matrix.os }} ${{ matrix.py }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ["ubuntu-latest", "macos-latest"]
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: extra env vars for macOS
if: matrix.os == 'macos-latest'
run: |
export LDFLAGS="-L/opt/homebrew/opt/openssl@3/lib"
export CPPFLAGS="-I/opt/homebrew/opt/openssl@3/include"
- name: build
run: |
pip install build
python -m build
echo "WHEEL_NAME=$(ls dist/*.whl)" >> $GITHUB_ENV
echo "SDIST_NAME=$(ls dist/*.tar.gz)" >> $GITHUB_ENV
- name: test
run: |
pip install dist/*.whl pytest
pytest
- uses: actions/upload-artifact@v4
with:
name: ${{ env.WHEEL_NAME }}
path: "dist/*.whl"
- uses: actions/upload-artifact@v4
# only do this once
if: matrix.os == 'ubuntu-latest'
with:
name: ${{ env.SDIST_NAME }}
path: "dist/*.tar.gz"
upload:
needs: [build]
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
merge-multiple: true
- name: Copy artifacts to dist/ folder
run: |
mkdir -p dist/
mv *.tar.gz dist/
mv *.whl dist/
- name: Upload
uses: pypa/[email protected]
with:
password: ${{ secrets.PYPI_API_TOKEN }}
skip_existing: true