forked from blackary/streamlit-image-coordinates
-
Notifications
You must be signed in to change notification settings - Fork 0
103 lines (86 loc) · 2.33 KB
/
build-and-release.yml
File metadata and controls
103 lines (86 loc) · 2.33 KB
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
name: Build Wheels and Release
on:
push:
branches: [main, master]
tags:
- 'v*.*.*'
workflow_dispatch:
pull_request:
branches: [main, master]
jobs:
build:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install uv
run: |
pip install uv
- name: Build wheels
run: |
uv build
- name: Upload wheels as artifact
uses: actions/upload-artifact@v4
with:
name: dist-wheels-${{ matrix.os }}
path: dist/*
test-wheels:
name: Test wheels on ${{ matrix.os }}
needs: build
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Download wheels
uses: actions/download-artifact@v4
with:
name: dist-wheels-${{ matrix.os }}
path: dist
- name: List downloaded files
run: |
ls -la dist/
- name: Install wheel
shell: bash
run: |
pip install dist/*.whl
- name: Test import
run: |
python -c "import streamlit_image_coordinates; print('Package imported successfully')"
release:
name: Create GitHub Release
needs: [build, test-wheels]
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
steps:
- name: Download all wheels
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Collect all wheels
run: |
mkdir -p dist
find artifacts -name "*.whl" -exec cp {} dist/ \;
find artifacts -name "*.tar.gz" -exec cp {} dist/ \;
ls -la dist/
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
files: dist/*
generate_release_notes: true
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}