-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (41 loc) · 1.18 KB
/
Copy pathrelease-python-artifacts.yml
File metadata and controls
50 lines (41 loc) · 1.18 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
name: Release Python Artifacts
on:
release:
types: [published]
workflow_dispatch:
inputs:
tag:
description: "Tag to build and attach artifacts for (for example: v0.2.0)"
required: true
type: string
permissions:
contents: write
jobs:
build-and-attach:
runs-on: ubuntu-latest
env:
RELEASE_TAG: ${{ github.event_name == 'release' && github.event.release.tag_name || inputs.tag }}
steps:
- name: Checkout repository at release tag
uses: actions/checkout@v4
with:
ref: ${{ env.RELEASE_TAG }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install build tooling
run: |
python -m pip install --upgrade pip
python -m pip install build twine
- name: Build wheel and sdist
run: python -m build
- name: Verify package metadata
run: python -m twine check dist/*
- name: Attach artifacts to GitHub release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ env.RELEASE_TAG }}
files: |
dist/*.whl
dist/*.tar.gz