-
Notifications
You must be signed in to change notification settings - Fork 3
73 lines (69 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
64
65
66
67
68
69
70
71
72
73
name: Release
run-name: 1.0.0.${{ github.run_number }}
on:
push:
branches:
- master
tags:
- "*"
env:
_IS_BUILD_CANARY: false
_IS_GITHUB_RELEASE: false
_RELEASE_NAME: JunctionVIIICatalogs
_RELEASE_VERSION: v0
_BUILD_BRANCH: "${{ github.ref }}"
_BUILD_VERSION: "1.0.0.${{ github.run_number }}"
GIT_REDIRECT_STDERR: 2>&1
jobs:
CD:
runs-on: ubuntu-latest
timeout-minutes: 1440
strategy:
max-parallel: 1
steps:
- name: Set Git Config
run: |
git config --global core.autocrlf false
git config --global core.filemode false
git config --global core.longpaths true
- name: Checkout
uses: actions/[email protected]
- name: Install xmllint
run: |
sudo apt-get update
sudo apt-get install -y libxml2-utils
- name: Set execute permission for prepare.sh
run: chmod +x .github/workflows/prepare.sh
- name: Prepare Env
run: .github/workflows/prepare.sh
shell: bash
- name: Combine XML files
run: |
echo '<?xml version="1.0"?>' > tsunamods.xml
echo '<Catalog Name="Tsunamods Catalog" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">' >> tsunamods.xml
echo '<Mods>' >> tsunamods.xml
for file in mods/**/*.xml; do
xmllint --format "$file" | sed '1d' >> tsunamods.xml
done
echo '</Mods>' >> tsunamods.xml
echo '</Catalog>' >> tsunamods.xml
- name: Publish Canary Release
uses: ncipollo/release-action@v1
if: env._IS_GITHUB_RELEASE == 'true' && env._IS_BUILD_CANARY == 'true' && success()
with:
artifacts: tsunamods.xml
allowUpdates: true
generateReleaseNotes: true
prerelease: true
removeArtifacts: true
tag: canary
name: "${{ env._RELEASE_NAME }}-${{ env._RELEASE_VERSION }}"
- name: Publish Stable release
uses: ncipollo/release-action@v1
if: env._IS_GITHUB_RELEASE == 'true' && env._IS_BUILD_CANARY == 'false' && success()
with:
artifacts: tsunamods.xml
generateReleaseNotes: true
makeLatest: true
removeArtifacts: true
name: "${{ env._RELEASE_NAME }}-${{ env._RELEASE_VERSION }}"