-
Notifications
You must be signed in to change notification settings - Fork 3
79 lines (66 loc) · 1.9 KB
/
build.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: Build & Deploy
on:
push:
tags:
- 'v*.*.*'
branches:
- master
pull_request:
branches:
- master
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Install dependencies
run: sudo apt install zip
- name: Checkout
uses: actions/checkout@v2
- name: Package ZetaBot
run: ./build
- name: Get version
run: |
source ./version.sh
echo "VERSION=$VERSION" >>$GITHUB_ENV
- name: Upload as artifact
uses: actions/upload-artifact@v2
with:
name: ZetaBot_v${{ env.VERSION }}.pk3
path: Built/ZetaBot_v${{ env.VERSION }}.pk3
release:
name: Release
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
needs: build
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Get version
run: |
source ./version.sh
echo "VERSION=$VERSION" >>$GITHUB_ENV
- name: Download artifact
uses: actions/download-artifact@v2
with:
name: ZetaBot_v${{ env.VERSION }}.pk3
- name: Create release
uses: ncipollo/release-action@v1
with:
name: "v${{ env.VERSION }}"
draft: true
bodyFile: changelog/latest.md
artifacts: ZetaBot_v${{ env.VERSION }}.pk3
prerelease: contains(github.ref, '-rc')
token: ${{ secrets.GITHUB_TOKEN }}
- name: Archive release log
run: |
cp changelog/latest.md changelog/archived/v$VERSION.md
- name: Commit archived log
uses: EndBug/add-and-commit@v7.2.0
with:
add: changelog/archived/v${{ env.VERSION }}.md
push: "-u origin changelog-archivals"
pull_strategy: "NO-PULL"
branch: changelog-archivals
message: "(CI) Archived changelog for v${{ env.VERSION }}"