This repository has been archived by the owner on Oct 10, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 986
136 lines (117 loc) · 4.88 KB
/
build.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
name: Build Project
on:
push:
tags:
- v[0-9].[0-9]+.[0-9]+*
# pr's will trigger this action. i think the idea here is to verify that a build is passing before merging.
pull_request:
branches:
- main
jobs:
Build_Release:
runs-on: windows-2022
steps:
- name: Checkout
uses: actions/checkout@v2.3.4
- name: Build Release
shell: bash
run: '"C:/Program Files/Microsoft Visual Studio/2022/Enterprise/Msbuild/Current/Bin/MSBuild.exe" -property:Configuration=Release'
- name: Build Release_Version
shell: bash
run: '"C:/Program Files/Microsoft Visual Studio/2022/Enterprise/Msbuild/Current/Bin/MSBuild.exe" -property:Configuration=Release_Version'
- name: Package Release Builds
if: ${{ github.event_name == 'push' }}
shell: cmd
run: |
move /y Release\AmongUsMenu.dll AmongUsMenu.dll
move /y Release_Version\version.dll version.dll
tar -caf Release.zip AmongUsMenu.dll version.dll LICENSE
- name: Upload Release Artifact
if: ${{ github.event_name == 'push' }}
uses: actions/upload-artifact@v2.2.3
with:
name: Release
path: Release.zip
Build_Debug:
runs-on: windows-2022
steps:
- name: Checkout
uses: actions/checkout@v2.3.4
- name: Build Debug
shell: bash
run: '"C:/Program Files/Microsoft Visual Studio/2022/Enterprise/Msbuild/Current/Bin/MSBuild.exe" -property:Configuration=Debug'
- name: Build Debug_Version
shell: bash
run: '"C:/Program Files/Microsoft Visual Studio/2022/Enterprise/Msbuild/Current/Bin/MSBuild.exe" -property:Configuration=Debug_Version'
- name: Package Debug Builds
if: ${{ github.event_name == 'push' }}
shell: cmd
run: |
move /y Debug\AmongUsMenu.dll AmongUsMenu.dll
move /y Debug_Version\version.dll version.dll
tar -caf Debug.zip AmongUsMenu.dll version.dll LICENSE
- name: Upload Debug Artifact
if: ${{ github.event_name == 'push' }}
uses: actions/upload-artifact@v2.2.3
with:
name: Debug
path: Debug.zip
AutoRelease:
if: ${{ github.event_name == 'push' }}
runs-on: windows-2022
needs: [Build_Release, Build_Debug]
steps:
- name: Parse tag semver
uses: booxmedialtd/ws-action-parse-semver@3576f3a20a39f8752fe0d8195f5ed384090285dc
id: semver_parser
with:
input_string: ${{ github.ref }}
version_extractor_regex: '\/v(.*)$'
# please keep this for an adjustment period, will help diagnose any issues
- name: Debug semver
run: |
echo 'major: ${{ steps.semver_parser.outputs.major }}'
echo 'minor: ${{ steps.semver_parser.outputs.minor }}'
echo 'patch: ${{ steps.semver_parser.outputs.patch }}'
echo 'feature (is pre-release?): ${{ steps.semver_parser.outputs.prerelease }}'
echo 'feature ver: ${{ steps.semver_parser.outputs.build }}'
echo 'full: ${{ steps.semver_parser.outputs.fullversion }}'
echo 'is pre-release: ${{ steps.semver_parser.outputs.prerelease != 0 }}'
- name: Download Release Artifact
uses: actions/download-artifact@v2.0.9
with:
name: Release
- name: Download Debug Artifact
uses: actions/download-artifact@v2.0.9
with:
name: Debug
- name: Automatic Releases
if: ${{ github.event_name == 'push' }}
uses: marvinpinto/action-automatic-releases@526ce12c6675bbe6e0e9a4169c90d09a3f7ad3e2
id: "automatic_releases"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: ${{ steps.semver_parser.outputs.prerelease != 0 }}
files: |
Release.zip
Debug.zip
Notification:
if: ${{ github.event_name == 'push' && github.repository == 'BitCrackers/AmongUsMenu' }}
runs-on: ubuntu-latest
needs: [AutoRelease]
steps:
- name: Parse tag into env
# credit: mcraiha via [https://github.community/t/how-to-get-just-the-tag-name/16241/17]
id: get_tag
shell: bash
run: echo ::set-output name=THIS_TAG::${GITHUB_REF/refs\/tags\//}
- name: Debug tag parsing
run: echo '${{ steps.get_tag.outputs.THIS_TAG }}'
- name: Discord Notification
uses: rjstone/discord-webhook-notify@v1.0.4
with:
severity: info
description: "Project Build"
# note: we could also link directly to the asset, but that might not be very user-friendly
details: "${{ github.server_url }}/${{ github.repository }}/releases/tag/${{ steps.get_tag.outputs.THIS_TAG }}"
webhookUrl: ${{ secrets.DISCORD_BUILD_WEBHOOK }}