-
Notifications
You must be signed in to change notification settings - Fork 14
69 lines (60 loc) · 2.07 KB
/
create_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
57
58
59
60
61
62
63
64
65
66
67
68
69
name: Create Release
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]+-beta[0-9]+'
- '*-preview[0-9]+'
jobs:
create_release:
name: Create Release
permissions:
contents: write
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Extract Version
run: |
TAG="${{github.ref_name}}"
if [[ $TAG =~ ^v[0-9]+\.[0-9]+\.[0-9]+ ]]; then
echo "VERSION=${TAG#v}" >> $GITHUB_ENV
else
echo "VERSION=${TAG}" >> $GITHUB_ENV
fi
if [[ $TAG =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "PRERELEASE=false" >> $GITHUB_ENV
else
echo "PRERELEASE=true" >> $GITHUB_ENV
fi
if [[ $TAG =~ -preview[0-9]+$ ]]; then
echo "PREVIEW=true" >> $GITHUB_ENV
else
echo "PREVIEW=false" >> $GITHUB_ENV
fi
- name: Build Package
uses: ./.github/actions/build
- name: Extract Config Signature
run: cat src/conf/confparser.h | sed -n 's/^#define .\+_SIGNATURE\W\+\([0-9]*\)/\1/p' > config_signature.txt
- name: Rename Package File
run: mv refloat.vescpkg refloat-${{env.VERSION}}.vescpkg
- name: Install Changelog Generation Dependencies
run: sudo apt-get install python3-git
- name: Generate Release Notes
run: |
if [[ "${{env.PREVIEW}}" == "true" ]]; then
echo "**WARNING: This is an experimental version of the package. Bugs may and will be present. Be very careful!**" > release_notes.md
echo "" >> release_notes.md
fi
python changelog.py >> release_notes.md
- name: Create Release
uses: ncipollo/release-action@v1
with:
tag: ${{github.ref}}
name: Refloat ${{env.VERSION}}
draft: true
artifacts: "refloat-${{env.VERSION}}.vescpkg,config_signature.txt"
bodyFile: "release_notes.md"
prerelease: ${{env.PRERELEASE}}
allowUpdates: true