-
Notifications
You must be signed in to change notification settings - Fork 3
101 lines (88 loc) · 2.77 KB
/
Copy pathpython-packages.yml
File metadata and controls
101 lines (88 loc) · 2.77 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
name: python-packages
on:
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#running-a-workflow-when-a-pull-request-is-approved
# pull_request:
# types:
# - review_requested
# branches:
# - main
push:
branches:
- main
tags:
- "v[0-9]+*"
workflow_dispatch:
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Recursive checkout
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
with:
submodules: recursive
path: "."
fetch-depth: 0 # for tags
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@3542bca2639a428e1796aaa6a2ffef0c0f575566 # v3
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build wheel 'setuptools>=64' 'setuptools_scm>=8'
- name: Build package
run: python -m build
- run: du -h dist/*
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: python-packages
path: |
dist/*.whl
dist/*.tar.gz
# publish to GitHub Release
gh_release:
name: gh_release
needs: build
if: >-
github.repository == 'WaveSpeedAI/wavespeed-python' &&
github.event_name == 'push' &&
(github.ref == 'refs/heads/main' ||
(github.ref_type == 'tag' && startsWith(github.ref, 'refs/tags/v')))
environment: github-release
runs-on: ubuntu-latest
permissions:
contents: write
timeout-minutes: 60
defaults:
run:
shell: bash
steps:
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
with:
path: dist
- run: ls -R dist/
# create night release if it's a push to main
- if: github.repository == 'WaveSpeedAI/wavespeed-python' && github.event_name == 'push' && github.ref == 'refs/heads/main'
name: Nightly Release
uses: andelf/nightly-release@c5ed4bdb7c1da04a4fa1e40bc5e67306f682563b # v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: nightly
name: 'Nightly Release $$'
prerelease: true
body: 'TODO: Add nightly release notes'
files: |
dist/*/*.whl
dist/*/*.tar.gz
# create release if it's a tag like vx.y.z
- if: github.repository == 'WaveSpeedAI/wavespeed-python' && github.ref_type == 'tag' && startsWith(github.ref, 'refs/tags/v')
name: Release
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v1
with :
files: |
dist/*/*.whl
dist/*/*.tar.gz