Repository navigation
65 lines (56 loc) · 1.64 KB
/
Copy pathrelease_github.yml
File metadata and controls
65 lines (56 loc) · 1.64 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
name: release_github
on:
workflow_dispatch:
inputs:
tag:
description: 'Custom tag to release as'
required: false
type: string
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
permissions:
contents: read
jobs:
build:
uses: ./.github/workflows/build.yml
release:
if: github.event_name == 'push' || github.event.inputs.tag != ''
needs: [ build ]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Extract release notes
id: extract-release-notes
uses: ffurrer2/extract-release-notes@v3
- name: Load release python packages
uses: actions/download-artifact@v8
with:
name: release_dist_python
path: dist
- name: Load release binaries
uses: actions/download-artifact@v8
with:
pattern: release_dist_bin_*
merge-multiple: true
path: dist
- name: Create Release
if: github.event_name == 'push'
uses: ncipollo/release-action@v1
with:
body: ${{ steps.extract-release-notes.outputs.release_notes }}
artifacts: "dist/*"
token: ${{ secrets.GITHUB_TOKEN }}
draft: true
- name: Create Release (Custom Tag)
if: github.event_name != 'push' && github.event.inputs.tag != ''
uses: ncipollo/release-action@v1
with:
body: ${{ steps.extract-release-notes.outputs.release_notes }}
artifacts: "dist/*"
token: ${{ secrets.GITHUB_TOKEN }}
draft: true
tag: ${{ github.event.inputs.tag }}