-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (46 loc) · 1.41 KB
/
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
52
name: Create Release
on:
push:
tags:
- '*' # Push events to matching *, i.e. 1.0, 20.15.10
jobs:
release-note:
runs-on: ubuntu-latest
outputs:
version: ${{ env.VERSION }}
message: ${{ env.TAG_MESSAGE }}
steps:
- name: Check out the repo
uses: actions/checkout@v4
with:
ref: ${{ github.ref_name }}
fetch-depth: 0 # Fetch all history for all tags and branches
- name: Get Release Notes
run: |
TAG_MESSAGE=$(git tag -l --format="%(contents:subject)" ${{ github.ref_name }})
echo "Release message: "$TAG_MESSAGE
echo "TAG_MESSAGE=$TAG_MESSAGE" >> $GITHUB_ENV
- name: Get update version
run: |
VERSION=${GITHUB_REF#refs/tags/}
echo "New version: $VERSION"
echo "VERSION=$VERSION" >> $GITHUB_ENV
build:
needs: release-note
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Create Release
uses: ncipollo/release-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ needs.release-note.outputs.version }}
name: ${{ needs.release-note.outputs.version }}
body: |
${{ needs.release-note.outputs.message }}
draft: false
prerelease: false
omitDraftDuringUpdate: true