-
Notifications
You must be signed in to change notification settings - Fork 2
122 lines (106 loc) · 3.39 KB
/
Copy pathcibuild.yml
File metadata and controls
122 lines (106 loc) · 3.39 KB
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
name: Build
on:
push:
pull_request:
workflow_dispatch:
release:
types: [published]
jobs:
build:
name: Linux Native Release
runs-on: ubuntu-latest
defaults:
run:
shell: bash
container:
image: 'registry.gitlab.steamos.cloud/steamrt/sniper/sdk:latest'
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Set ownership
run: |
# Fix for "detected dubious ownership in repository"
chown -R $(id -u):$(id -g) $PWD
- name: Set reusable strings
run: |
preset_name=linux-release
workspace_dir="$GITHUB_WORKSPACE"
source_dir=${workspace_dir}
build_dir=${workspace_dir}/build/$preset_name
install_dir=$build_dir/install
echo "source_dir=$source_dir" >> "$GITHUB_ENV"
echo "build_dir=$build_dir" >> "$GITHUB_ENV"
echo "install_dir=$install_dir" >> "$GITHUB_ENV"
echo "preset_name=$preset_name" >> "$GITHUB_ENV"
- name: Git fetch tags
run: git fetch origin --tags
# Build
- name: CMake configure build
working-directory: ${{ env.source_dir }}
run: >
cmake
--preset ${{ env.preset_name }}
-DCMAKE_INSTALL_PREFIX=${{ env.install_dir }}
- name: CMake build
working-directory: ${{ env.source_dir }}
run: cmake --build --preset ${{ env.preset_name }} --parallel --verbose
- name: Install executable
run: cmake --install ${{ env.build_dir }}
# Artifacts
- name: Upload libraries
uses: actions/upload-artifact@v4
with:
name: gamedata-gen
path: ${{ env.install_dir }}/bin/gamedata-gen
# upload-latest-build:
# name: Upload Latest Build
#
# needs: [build, pack-resources]
# runs-on: ubuntu-latest
# if: github.ref == 'refs/heads/master'
# permissions:
# contents: write
#
# steps:
# - name: Download all artifacts
# uses: actions/download-artifact@v4
#
# - name: Packing artifacts
# run: 'parallel 7z a -tzip -mx=9 "{}.zip" "./{}/*" ::: *'
#
# - name: Create & upload latest build
# env:
# GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# REPO_INFO: ${{ github.repository }}
# run: |
# # Delete old "latest" (delete step always returns true so that even if there's no release, it still uploads)
# gh release delete latest --cleanup-tag --yes --repo "$REPO_INFO" || true
# # Create new "latest"
# gh release create latest *.zip --prerelease --title "Latest Master Build" --repo "$REPO_INFO"
#
# upload-release:
# name: Upload Release
#
# needs: [build, pack-resources]
# runs-on: ubuntu-latest
# if: github.event_name == 'release' && github.event.action == 'published'
# permissions:
# contents: write
#
# steps:
# - name: Download all artifacts
# uses: actions/download-artifact@v4
#
# # TODO remove?
# - name: Deleting every debug artifact
# run: 'rm -r *-Debug'
#
# - name: Packing artifacts
# run: 'parallel 7z a -tzip -mx=9 "{= s/neo-(.*)/neo-$GITHUB_REF_NAME-\1.zip/ =}" "./{}/*" ::: *' # TODO fix this command
#
# - name: Upload assets to a release
# env:
# GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# REPO_INFO: ${{ github.repository }}
# run: 'gh release upload "$GITHUB_REF_NAME" *.zip --clobber --repo "$REPO_INFO"'