forked from TeamSpen210/HammerAddons
-
Notifications
You must be signed in to change notification settings - Fork 17
136 lines (118 loc) · 4.24 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
on:
push:
branches:
- 'master'
tags-ignore:
- '*'
- '**'
workflow_dispatch:
inputs:
version:
description: 'Release version'
required: false
name: Release Deploy
jobs:
release:
runs-on: windows-latest
env:
FGD_BUILD_DIR: build
MD_BUILD_DIR: build_md
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0 # Required for finding the right tags
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install srctools
run: python -m pip install srctools
- name: FGD build and folder copy
run: .\build.bat fgd all
- name: Zip Momentum FGD
uses: thedoctor0/zip-release@master
with:
type: 'zip'
directory: ./${{ env.FGD_BUILD_DIR }}/momentum/
filename: 'fgd-momentum.zip'
- name: Zip P2CE FGD
uses: thedoctor0/zip-release@master
with:
type: 'zip'
directory: ./${{ env.FGD_BUILD_DIR }}/p2ce/
filename: 'fgd-p2ce.zip'
- name: Zip templategame FGD
uses: thedoctor0/zip-release@master
with:
type: 'zip'
directory: ./${{ env.FGD_BUILD_DIR }}/templategame/
filename: 'fgd-templategame.zip'
- name: MD build
run: .\build.bat md all
- name: Zip Momentum MD
uses: thedoctor0/zip-release@master
with:
type: 'zip'
directory: ./${{ env.MD_BUILD_DIR }}/momentum/
filename: 'md-momentum.zip'
- name: Zip P2CE MD
uses: thedoctor0/zip-release@master
with:
type: 'zip'
directory: ./${{ env.MD_BUILD_DIR }}/p2ce/
filename: 'md-p2ce.zip'
- name: Zip templategame MD
uses: thedoctor0/zip-release@master
with:
type: 'zip'
directory: ./${{ env.MD_BUILD_DIR }}/templategame/
filename: 'md-templategame.zip'
- name: Artifact Upload
uses: actions/upload-artifact@v3
with:
name: build_${{ github.event.inputs.version }}-${{ github.sha }}
path: |
./${{ env.FGD_BUILD_DIR }}/momentum/fgd-momentum.zip
./${{ env.FGD_BUILD_DIR }}/p2ce/fgd-p2ce.zip
./${{ env.FGD_BUILD_DIR }}/templategame/fgd-templategame.zip
./${{ env.MD_BUILD_DIR }}/momentum/md-momentum.zip
./${{ env.MD_BUILD_DIR }}/p2ce/md-p2ce.zip
./${{ env.MD_BUILD_DIR }}/templategame/md-templategame.zip
if-no-files-found: error
- name: Get previous tag
id: previoustag
uses: 'WyriHaximus/github-action-get-previous-tag@v1'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Next Monotonic Release version
id: next
uses: WyriHaximus/github-action-next-release-version@08a7476c98e8095fad1cce0e2344c7892e17d111
with:
version: ${{ steps.previoustag.outputs.tag }}
- name: Create Rolling Release
uses: softprops/action-gh-release@v1
if: ${{ github.event.inputs.version == '' }}
with:
tag_name: ${{ steps.next.outputs.version }}
files: |
${{ env.FGD_BUILD_DIR }}/momentum/fgd-momentum.zip
${{ env.FGD_BUILD_DIR }}/p2ce/fgd-p2ce.zip
${{ env.FGD_BUILD_DIR }}/templategame/fgd-templategame.zip
${{ env.MD_BUILD_DIR }}/momentum/md-momentum.zip
${{ env.MD_BUILD_DIR }}/p2ce/md-p2ce.zip
${{ env.MD_BUILD_DIR }}/templategame/md-templategame.zip
fail_on_unmatched_files: true
- name: Create Manual Release
uses: softprops/action-gh-release@v1
if: ${{ github.event.inputs.version != '' }}
with:
tag_name: ${{ github.event.inputs.version }}
files: |
${{ env.FGD_BUILD_DIR }}/momentum/fgd-momentum.zip
${{ env.FGD_BUILD_DIR }}/p2ce/fgd-p2ce.zip
${{ env.FGD_BUILD_DIR }}/templategame/fgd-templategame.zip
${{ env.MD_BUILD_DIR }}/momentum/md-momentum.zip
${{ env.MD_BUILD_DIR }}/p2ce/md-p2ce.zip
${{ env.MD_BUILD_DIR }}/templategame/md-templategame.zip
fail_on_unmatched_files: true