-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (37 loc) · 1.21 KB
/
Copy pathrelease.yml
File metadata and controls
46 lines (37 loc) · 1.21 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
name: Build and publish release
# Triggers on any tag matching v1.2.3 style (e.g. v3.0.0), or can be run
# manually from the Actions tab for a dry run without pushing a tag.
on:
push:
tags:
- 'v*.*.*'
workflow_dispatch:
permissions:
contents: write # needed to create the GitHub Release and upload assets
jobs:
build-and-release:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install build tool
run: python -m pip install --upgrade build
- name: Clean dist/ before building (avoid re-attaching old committed releases)
run: rm -rf dist
- name: Build sdist and wheel
run: python -m build
- name: Upload build artifacts (workflow run, for manual dry-runs)
uses: actions/upload-artifact@v4
with:
name: dist
path: dist/*
- name: Create GitHub Release with dist files attached
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v2
with:
files: dist/*
generate_release_notes: true