-
-
Notifications
You must be signed in to change notification settings - Fork 3
56 lines (51 loc) · 1.43 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
53
54
55
56
name: release
on:
push:
tags:
- "[0-9]+.[0-9]+.[0-9]+"
permissions:
contents: write
jobs:
create_release:
name: Create Release
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v4
- name: Get the release version from the tag
if: env.VERSION == ''
run: echo "VERSION=${{ github.ref_name }}" | tee -a $GITHUB_ENV
- name: Display the version
run: |
echo "version is: $VERSION"
- name: Create GitHub release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release create "${VERSION}" --draft --verify-tag --title $VERSION
outputs:
version: ${{ env.VERSION }}
build:
name: Build & Release
needs: [create_release]
uses: ./.github/workflows/build.yml
with:
release: true
publish_release:
name: Publish Release
needs: [build]
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v4
- name: Get the release version from the tag
if: env.VERSION == ''
run: echo "VERSION=${{ github.ref_name }}" | tee -a $GITHUB_ENV
- name: Display the version
run: |
echo "version is: $VERSION"
- name: Publish GitHub release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release edit "${VERSION}" --draft=false
outputs:
version: ${{ env.VERSION }}