-
Notifications
You must be signed in to change notification settings - Fork 2
63 lines (61 loc) · 2.32 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
57
58
59
60
61
62
63
name: "Release new version"
on:
push:
branches:
- main
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.DEPLOYMENT_TOKEN }}
- name: Calculate version
id: calculate_version
uses: mathieudutour/[email protected]
with:
tag_prefix: ""
github_token: ${{ secrets.DEPLOYMENT_TOKEN }}
dry_run: true
- name: "Write 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: "Update version in plugin.cfg"
run: |
sed -i -re 's/version=".+$/version="${{ steps.calculate_version.outputs.new_version }}"/gi' addons/speedy_gonzales/plugin.cfg
# - name: "Commit"
# 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.DEPLOYMENT_TOKEN }}
- name: Create version
id: create_version
uses: mathieudutour/[email protected]
with:
tag_prefix: ""
github_token: ${{ secrets.DEPLOYMENT_TOKEN }}
- name: Create a GitHub release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.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 }}