-
-
Notifications
You must be signed in to change notification settings - Fork 45
105 lines (92 loc) · 3.54 KB
/
build-dev-release.yaml
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
name: Dev release
on:
push:
branches:
- dev
jobs:
get-version-string:
name: Get version string
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set vars
id: vars
run: |
echo "short_sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
outputs:
version_string: ${{ github.ref_name }}-${{ steps.vars.outputs.short_sha }}
check-newlines:
name: Check for CRLF and final newlines
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check for CRLF and final newlines
run: |
./scripts/check-newlines.sh
check-formatting:
name: Check for consistent formatting
runs-on: ubuntu-latest
strategy:
matrix:
path:
- check: 'src'
exclude: 'sdk'
steps:
- uses: actions/checkout@v4
- uses: jidicula/clang-format-action@v4.13.0
with:
clang-format-version: '16'
check-path: ${{ matrix.path['check'] }}
exclude-regex: ${{ matrix.path['exclude'] }}
build:
name: Build
uses: ./.github/workflows/build.yaml
needs: get-version-string
with:
version: ${{ needs.get-version-string.outputs.version_string }}
dev-release:
name: Dev Release
runs-on: ubuntu-latest
needs:
- get-version-string
- build
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Create folders
run: |
mkdir /home/runner/releases
- uses: actions/download-artifact@v4
with:
path: /home/runner/artifacts
- name: Archive Linux build
run: |
cd /home/runner/artifacts/cs2kz-linux
tar -czvf /home/runner/releases/cs2kz-linux-${{ needs.get-version-string.outputs.version_string }}.tar.gz .
rm ./cfg/cs2kz-server-config.txt
tar -czvf /home/runner/releases/cs2kz-linux-${{ needs.get-version-string.outputs.version_string }}-upgrade.tar.gz .
- name: Archive Windows build
run: |
cd /home/runner/artifacts/cs2kz-windows
zip -r /home/runner/releases/cs2kz-windows-${{ needs.get-version-string.outputs.version_string }}.zip *
rm ./cfg/cs2kz-server-config.txt
zip -r /home/runner/releases/cs2kz-windows-${{ needs.get-version-string.outputs.version_string }}-upgrade.zip *
- name: Tag the repository
id: tag
run: |
git config --global user.email "${{ github.repository_owner_id }}+${{ github.repository_owner }}@users.noreply.github.com"
git config --global user.name "${{ github.repository_owner }}"
git tag -a ${{ needs.get-version-string.outputs.version_string }} -m "Published version ${{ needs.get-version-string.outputs.version_string }}" ${GITHUB_SHA}
git push origin ${{ needs.get-version-string.outputs.version_string }}
- name: Dev Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ needs.get-version-string.outputs.version_string }}
files: |
/home/runner/releases/cs2kz-linux-${{ needs.get-version-string.outputs.version_string }}.tar.gz
/home/runner/releases/cs2kz-linux-${{ needs.get-version-string.outputs.version_string }}-upgrade.tar.gz
/home/runner/releases/cs2kz-windows-${{ needs.get-version-string.outputs.version_string }}.zip
/home/runner/releases/cs2kz-windows-${{ needs.get-version-string.outputs.version_string }}-upgrade.zip
generate_release_notes: false
prerelease: true