-
Notifications
You must be signed in to change notification settings - Fork 2
53 lines (45 loc) · 1.6 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
name: GitHub Release
on:
# Triggers the workflow on pushing a tag only
push:
tags: "*"
branches:
- "!*"
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
steps:
# Checks-out repository under $GITHUB_WORKSPACE, so your job can access it
# GitHub Actions by default doesn't check out tags, so make sure those are included
- name: Checkout
uses: actions/checkout@v3
- name: Fetch Tags
run: git fetch --prune --unshallow --tags
# Tags with unstable, dev, qa in them will be marked as prerelease.
- name: Set Variables
run: |
echo "VERSION=$(git describe --tags)" >> $GITHUB_ENV
git log --format=%B -n 1 $(git log -1 --pretty=format:"%h") | cat - > changes.txt
if [[ "$(git describe --tags)" =~ .*"dev"|"qa"|"unstable".* ]]; then
echo "IS_PRERELEASE=true" >> $GITHUB_ENV;
else
echo "IS_PRERELEASE=false" >> $GITHUB_ENV;
fi
- name: Create Mod Zipfile
run: |
cd ./.github/workflows/
chmod +x ./runner.sh
./runner.sh
- name: Publish Release on GitHub
uses: "ncipollo/release-action@v1.12.0"
with:
name: ${{ env.VERSION }}
tag: ${{ env.VERSION }}
bodyFile: changes.txt
draft: false
prerelease: '${{ env.IS_PRERELEASE }}'
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: ".github/workflows/artifacts/*"