-
Notifications
You must be signed in to change notification settings - Fork 119
79 lines (77 loc) · 2.61 KB
/
prerelease.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
70
71
72
73
74
75
76
77
78
79
name: "Release new prerelease version"
on:
push:
branches:
- develop
jobs:
prerelease:
if: "github.event.head_commit.message != 'chore: storing version and changelog'"
name: Preparing release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
token: ${{ secrets.ESCORIA_DEPLOYMENT_TOKEN }}
- name: Remove trailing whitespace
run: |
OUTPUT=$(find . -name "*.gd" -type f | xargs sed -i 's/[[:space:]]$//')
RC=$?
if [[ $RC -ne 0 ]] && [[ $RC -ne 128 ]]
then
echo $OUTPUT
exit $RC
fi
exit 0
- name: Calculate version
id: calculate_version
uses: mathieudutour/[email protected]
with:
github_token: ${{ secrets.ESCORIA_DEPLOYMENT_TOKEN }}
dry_run: true
pre_release_branches: "develop"
append_to_pre_release_tag: "alpha"
default_bump: "release"
custom_release_rules: "fix:prerelease,feat:prerelease"
- name: "Write changelog"
if: "steps.calculate_version.outputs.changelog != ''"
run: |
CHANGELOG=""
if [ -e CHANGELOG.md ]
then
CHANGELOG=$(cat CHANGELOG.md)
fi
echo -e "${{steps.calculate_version.outputs.changelog}}\n\n${CHANGELOG}" > CHANGELOG.md
- name: "Commit"
if: "steps.calculate_version.outputs.changelog != ''"
uses: EndBug/[email protected]
with:
message: "chore: storing version and changelog"
push: true
release:
if: "github.event.head_commit.message == 'chore: storing version and changelog'"
name: Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
token: ${{ secrets.ESCORIA_DEPLOYMENT_TOKEN }}
- name: Create version
id: create_version
uses: mathieudutour/[email protected]
with:
github_token: ${{ secrets.ESCORIA_DEPLOYMENT_TOKEN }}
dry_run: true
pre_release_branches: "develop"
append_to_pre_release_tag: "alpha"
default_bump: "release"
custom_release_rules: "fix:prerelease,feat:prerelease"
- name: Create a GitHub release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.ESCORIA_DEPLOYMENT_TOKEN }}
with:
tag_name: ${{ steps.create_version.outputs.new_tag }}
release_name: ${{ steps.create_version.outputs.new_tag }}
body: ${{ steps.create_version.outputs.changelog }}