forked from Savage-Game-Design/Mike-Force
-
Notifications
You must be signed in to change notification settings - Fork 14
41 lines (35 loc) · 1.43 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
on:
push:
branch:
- 'development'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: versions
run: |
export SGD_VERSION=$(cat mission/version.hpp | grep VERSION | awk '{print $3}' | sed 's/[^a-zA-Z0-9.]//g')
export BN_VERSION=$(git rev-parse HEAD | cut -c 1-8)
echo "SGD_VERSION=${SGD_VERSION}" >> $GITHUB_ENV
echo "BN_VERSION=${BN_VERSION}" >> $GITHUB_ENV
- name: generate release text
run: |
export COMMIT_MSG=$(git log -n 1 --format="%h: %s %n%n %b")
echo -e "Release using SGD version ${SGD_VERSION} and BN version ${BN_VERSION}\n\n" >> RELEASE.md
echo -e "${COMMIT_MSG}" >> RELEASE.md
- name: build zipfiles
run: chmod +x build_release.sh && ./build_release.sh
- name: tag zipfiles
run: |
mv ./release/zips/AllMPMissions.zip ./release/zips/AllMPMissions_${{ env.SGD_VERSION }}.${{ env.BN_VERSION }}.zip
mv ./release/zips/OnlyTheMissionScripts.zip ./release/zips/OnlyTheMissionScripts_${{ env.SGD_VERSION }}.${{ env.BN_VERSION }}.zip
- name: create release
uses: softprops/action-gh-release@v1
with:
token: ${{ github.token }}
tag_name: release-${{ env.SGD_VERSION }}.${{ env.BN_VERSION }}
name: Release ${{ env.SGD_VERSION }}.${{ env.BN_VERSION }}
files: ./release/zips/*.zip
body_path: RELEASE.md