-
Notifications
You must be signed in to change notification settings - Fork 6
55 lines (45 loc) · 1.3 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
---
name: Release
on:
push:
tags:
- '*.*.*'
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up Python 3.9
uses: actions/setup-python@v5
with:
python-version: 3.9
- name: Install dependencies
run: make py.update
- name: Run tests
run: make test
- name: Build the package
run: make build
- name: Find the package File
id: find_file
run: |
FILE=$(find "$(realpath ./dist)" -type f -name "*.whl")
FILE=$(echo "$FILE" | tr -d '[:space:]')
echo "FILE_PATH=$FILE" >> "$GITHUB_ENV"
FILE_PREFIX=$(echo "$FILE" | grep -oP '^.*/\K[^/]+-\d+\.\d+\.\d+')
echo "FILE_NAME=$FILE_PREFIX" >> "$GITHUB_ENV"
- name: Upload whl file to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ env.FILE_PATH }}
asset_name: ${{ env.FILE_NAME }}.whl
tag: ${{ github.ref }}
overwrite: true
- name: Publish the package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1