-
Notifications
You must be signed in to change notification settings - Fork 80
97 lines (84 loc) · 2.91 KB
/
c-cpp.yml
File metadata and controls
97 lines (84 loc) · 2.91 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
# SPDX-License-Identifier: MPL-2.0
name: C/C++ CI
on:
push:
branches: [ develop, master, release/*, feature/*, hotfix/* ]
pull_request:
branches: [ develop ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
timeout-minutes: 60
permissions:
contents: read
strategy:
fail-fast: false # so that if one config fails, other won't be cancelled automatically
matrix:
config:
- {
name: "Windows GCC",
os: windows-latest,
builddir: "Make/gccWin",
makefile: "Makefile.gccWin",
release_name: "win-x86_64-gcc",
release_extension: ".zip",
archive_command: "7z a -tzip -mmt"
}
- {
name: "Ubuntu GCC",
os: ubuntu-latest,
builddir: "Make/gcc",
makefile: "Makefile",
release_name: "linux-x86_64-gcc",
release_extension: ".tar.xz",
archive_command: "tar cvfJ"
}
defaults:
run:
shell: bash
steps:
- name: Harden Runner
uses: step-security/harden-runner@a90bcbc6539c36a85cdfeb73f7e2f433735f215b # v2.14.1
with:
egress-policy: audit
- uses: actions/checkout@v6.0.2
continue-on-error: true # rsync code 24: harmless cleanup-phase race during VM setup
with:
submodules: recursive
- name: Escape backslash in branch name
run: echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/} | tr / -)" >> $GITHUB_ENV
- name: Set release name
run: |
DESTDIR="openSeaChest-${BRANCH_NAME}-${{ matrix.config.release_name }}"
echo "DESTDIR=${DESTDIR}" >> $GITHUB_ENV
- name: Add Mingw-w64 to path
if: startsWith(matrix.config.name, 'Windows GCC')
run: |
echo "C:\msys64\mingw64\bin" >> $GITHUB_PATH
- name: Make buildjsonc.sh executable
run: chmod +x Make/buildjsonc.sh
- name: make
working-directory: ${{ matrix.config.builddir }}
run: |
make release -f ${{ matrix.config.makefile }}
- name: Packing release
env:
ARCHIVE_EXT: ${{ matrix.config.release_extension }}
run: |
mkdir build
cd build
${{ matrix.config.archive_command }} "${DESTDIR}${ARCHIVE_EXT}" ../${{ matrix.config.builddir }}/openseachest_exes
- name: Uploading artifacts
uses: actions/upload-artifact@v7.0.0
with:
name: ${{ format('{0}', env.DESTDIR) }}
path: ${{ format('./build/{0}{1}', env.DESTDIR, matrix.config.release_extension) }}
# - name: Publish release
# if: ${{ startsWith(github.ref, 'refs/tags/v') && matrix.config.publish_release }}
# uses: softprops/action-gh-release@v2
# with:
# files: ${{ format('./build/{0}{1}', env.DESTDIR, matrix.config.release_extension) }}