-
Notifications
You must be signed in to change notification settings - Fork 19
55 lines (50 loc) · 1.31 KB
/
release.yml
File metadata and controls
55 lines (50 loc) · 1.31 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
# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
# SPDX-FileCopyrightText: 2021 James Carr
#
# SPDX-License-Identifier: MIT
name: Release Actions
on:
pull_request:
branches: [main]
push:
branches: [main]
release:
types: [published]
permissions: {}
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
filter: 'blob:none'
fetch-depth: 0
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.12'
- name: Build
run: pipx run build
- name: Check dist metadata
run: pipx run twine check dist/*
- name: Upload build as artifacts
uses: actions/upload-artifact@v5
with:
name: dist
path: dist/*
publish:
if: github.event_name == 'release' && startsWith(github.repository_owner, 'adafruit')
needs: [build]
runs-on: ubuntu-latest
permissions:
# needed for authenticating with PyPI trusted publisher
id-token: write
steps:
- name: Download build artifacts
uses: actions/download-artifact@v6
with:
name: dist
path: ./dist
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0