-
Notifications
You must be signed in to change notification settings - Fork 2
100 lines (94 loc) · 2.54 KB
/
shared-release.yaml
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
# This file is @generated by <https://github.com/liblaf/copier-python>.
# DO NOT EDIT!
name: (Shared) Release
on:
push:
release:
types:
- published
workflow_dispatch:
jobs:
build:
name: Build
runs-on: ubuntu-latest
outputs:
artifact-name: ${{ steps.build.outputs.artifact-name }}
steps:
- name: Checkout
uses: actions/checkout@v4
- id: build
name: Build and Inspect a Python Package
uses: hynek/build-and-inspect-python-package@v2
publish:
name: Publish
permissions:
id-token: write
needs:
- build
if: github.event_name == 'release' || startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-publish
cancel-in-progress: true
steps:
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
name: ${{ needs.build.outputs.artifact-name }}
path: dist/
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
pre-release:
name: Pre-Release
permissions:
contents: write
needs:
- build
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-pre-release
cancel-in-progress: true
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
name: ${{ needs.build.outputs.artifact-name }}
path: dist/
- name: Create Pre-Release
uses: liblaf/actions/release@main
with:
clobber: true
files: dist/*
prerelease: true
tag: latest
release:
name: Release
permissions:
contents: write
needs:
- build
if: github.event_name == 'release' || startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-release
cancel-in-progress: true
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
name: ${{ needs.build.outputs.artifact-name }}
path: dist/
- name: Upload Release Assets
uses: liblaf/actions/release@main
with:
files: dist/*
tag: ${{ github.event.release.tag_name || github.ref_name }}