-
Notifications
You must be signed in to change notification settings - Fork 47
82 lines (68 loc) · 2.67 KB
/
build.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
name: Build Workflow
on: [ push, pull_request ]
jobs:
build:
name: Build (${{ matrix.config }})
runs-on: windows-latest
permissions:
contents: write
strategy:
matrix:
config: [ Debug, RelWithDebInfo ]
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: ilammy/msvc-dev-cmd@v1.12.1
with:
arch: amd64
- name: Configure CMake
run: cmake -B ${{ github.workspace }}/build -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DCMAKE_CI_BUILD=ON -DGITHUB_ENV="$env:GITHUB_ENV" -G Ninja
- name: Build
id: build
run: cmake --build ${{ github.workspace }}/build --config ${{ matrix.config }}
- name: Get short SHA
run: echo "SHORT_SHA=$("${{ github.sha }}".SubString(0, 7))" >> $env:GITHUB_ENV
- name: Create environment variables
run: |
$config = "${{ matrix.config }}"
if ($config -eq "RelWithDebInfo") {
$config = "release"
}
else {
$config = $config.ToLower()
}
echo "PRETTY_CONFIG=${config}" | Out-File -FilePath $env:GITHUB_ENV -Encoding UTF8 -Append
- name: Upload game_dir with zip file name
uses: actions/upload-artifact@v3
with:
name: ${{ env.MOD_ZIP_FILENAME }}_${{ env.PRETTY_CONFIG }}_${{ env.SHORT_SHA }}
path: ${{ github.workspace }}/game_dir/**
- name: Upload game_dir_debug with zip file name
uses: actions/upload-artifact@v3
with:
name: ${{ env.MOD_ZIP_FILENAME }}_${{ env.PRETTY_CONFIG }}_${{ env.SHORT_SHA }}_pdb
path: ${{ github.workspace }}/game_dir_debug/**
- name: Upload game_dir_requirements with zip file name
uses: actions/upload-artifact@v3
with:
name: ${{ env.MOD_ZIP_FILENAME }}_${{ env.PRETTY_CONFIG }}_${{ env.SHORT_SHA }}_requirements
path: ${{ github.workspace }}/game_dir_requirements/**
- name: Upload game_dir_requirements_debug with zip file name
uses: actions/upload-artifact@v3
with:
name: ${{ env.MOD_ZIP_FILENAME }}_${{ env.PRETTY_CONFIG }}_${{ env.SHORT_SHA }}_requirements_pdb
path: ${{ github.workspace }}/game_dir_requirements_debug/**
- name: 'Version Badge'
if: always()
run: |
mkdir badge
echo '{"cp_version":{"label":"Cyberpunk 2077","status":"${{ env.CYBERPUNK_2077_GAME_VERSION }}","color":"${{ steps.build.outcome == 'success' && '31b75d' || 'red' }}"}}' > badge/shields.json
- name: Push shields branch
if: github.ref == 'refs/heads/main'
uses: s0/git-publish-subdir-action@develop
env:
REPO: self
BRANCH: shields
FOLDER: badge
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}