-
Notifications
You must be signed in to change notification settings - Fork 7
86 lines (82 loc) · 2.56 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
name: Build
on:
push:
paths:
- "src/**"
- "premake5.lua"
- ".github/workflows/build.yml"
pull_request:
paths:
- "src/**"
workflow_dispatch:
inputs:
release:
description: "Release after build"
required: true
type: boolean
jobs:
build:
name: ACTS (Windows)
runs-on: windows-latest
strategy:
matrix:
cfg:
- Release
- Debug
platform:
- x64
steps:
- uses: actions/checkout@v3.5.3
with:
submodules: true
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.3.1
with:
msbuild-architecture: x64
- name: Get version
id: get_version
shell: pwsh
run: "\"version=$(scripts/getversion.ps1)\" | Out-File $env:GITHUB_OUTPUT"
- name: Version
run: "\"version: ${{ steps.get_version.outputs.version }}\""
- name: Setup premake5
uses: abel0b/setup-premake@v2.3
with:
version: "5.0.0-beta2"
- name: Create project
shell: pwsh
run: scripts/setup.ps1 -ci
- name: Build project
shell: pwsh
run: msbuild build/AtianCodTools.sln /p:Configuration=${{matrix.cfg}} /p:Platform=${{matrix.platform}}
- name: Package project
if: matrix.cfg == 'Release'
shell: pwsh
run: scripts/package.ps1
- name: Upload dev release
uses: ncipollo/release-action@v1
if: matrix.cfg == 'Release' && github.ref == 'refs/heads/main'
with:
commit: ${{ github.sha }}
token: ${{ secrets.GITHUB_TOKEN }}
tag: "latest_build"
artifacts: "build/package/acts.zip"
artifactErrorsFailBuild: true
makeLatest: false
removeArtifacts: true
replacesArtifacts: true
allowUpdates: true
name: "Dev build ${{ steps.get_version.outputs.version }}"
body: "Latest dev build, [get the latest release build here](https://github.com/ate47/atian-cod-tools/releases/latest)."
- name: Upload release
if: inputs.release && matrix.cfg == 'Release' && github.ref == 'refs/heads/main'
uses: ncipollo/release-action@v1
with:
commit: ${{ github.sha }}
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: "build/package/acts.zip"
artifactErrorsFailBuild: true
makeLatest: true
tag: "${{ steps.get_version.outputs.version }}"
name: "${{ steps.get_version.outputs.version }}"
bodyFile: release/RELEASE.MD