-
-
Notifications
You must be signed in to change notification settings - Fork 45
72 lines (61 loc) · 2.28 KB
/
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
name: Dev release
on:
push:
branches:
- dev
jobs:
get-version-string:
name: Get version string
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set vars
id: vars
run: |
echo "short_sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
outputs:
short_sha: ${{ steps.vars.outputs.short_sha }}
build:
name: Build
uses: ./.github/workflows/build.yaml
needs: get-version-string
with:
version: ${{ github.ref_name }}-${{ needs.get-version-string.outputs.short_sha }}
dev-release:
name: Dev Release
runs-on: ubuntu-latest
needs:
- get-version-string
- build
steps:
- uses: actions/checkout@v3
- name: Create folders
run: |
mkdir /home/runner/releases
- uses: actions/download-artifact@v3
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 .
- 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 *
- 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@v1
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-windows-${{ needs.get-version-string.outputs.version_string }}.zip
generate_release_notes: false
prerelease: true