-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (45 loc) · 1.51 KB
/
shared-publish-release.yml
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
on:
workflow_call:
inputs:
discussionCategory:
description: The discussion category to use for release discussions
type: string
required: false
makeTarget:
description: The make target to run before publishing the release
required: false
type: string
tag:
description: The tag to publish the release from
required: true
type: string
jobs:
publish:
runs-on: ubuntu-latest
name: Publish release
permissions:
contents: write
discussions: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: refs/tags/${{ inputs.tag }}
- name: Check if tag is SemVer
id: checkTag
run: |
if [[ "${{ github.event.inputs.tag }}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo isSemVer=true >> $GITHUB_OUTPUT
echo "Tag is SemVer"
else
echo "Tag is not SemVer"
fi
- name: Make
if: ${{ github.event.inputs.makeTarget }}
run: make ${{ github.event.inputs.makeTarget }}
- name: Publish release
uses: ghalactic/github-release-from-tag@v5
with:
reactions: hooray,heart,rocket
discussionCategory: ${{ steps.checkTag.outputs.isSemVer == 'true' && github.event.inputs.discussionCategory || '' }}
discussionReactions: ${{ (github.event.inputs.discussionCategory && steps.checkTag.outputs.isSemVer == 'true') && 'hooray,heart,rocket' || '' }}