-
Notifications
You must be signed in to change notification settings - Fork 0
107 lines (86 loc) · 3.16 KB
/
CreateRelease.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
name: CreateRelease
on:
workflow_dispatch:
inputs:
major_version:
description: 'New major version'
required: true
default: '0'
minor_version:
description: 'New minor version'
required: true
default: '0'
patch_version:
description: 'New patch version'
required: true
default: '0'
jobs:
create_release:
permissions:
contents: write
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: develop
fetch-depth: 0
- name: Release
uses: softprops/action-gh-release@v2
with:
tag_name: 'v${{ github.event.inputs.major_version }}.${{ github.event.inputs.minor_version }}.${{ github.event.inputs.patch_version }}'
- name: Merge develop -> main
run: |
git checkout main
git merge develop
git push
deploy_assets_linux:
runs-on: ubuntu-24.04
needs: create_release
strategy:
matrix:
cfg:
- { compiler: gcc-14, flags: "-m32", arch_name: "x86-32" }
- { compiler: gcc-14, flags: "-m64", arch_name: "x86-64" }
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: main
submodules: recursive
- name: Setup Environment
run: external/Phi/scripts/ci/SetupEnvironment.sh
- name: Install dependencies
run: sudo scripts/ci/InstallDependencies.sh
- name: Install compiler
run: external/Phi/scripts/ci/InstallTools.sh ${{ matrix.cfg.compiler }} ninja
- name: Configure build directory
run: |
mkdir build -p
cd build
flags="-D_FORTIFY_SOURCE=2 -D_GLIBCXX_ASSERTIONS -fstack-clash-protection -fstack-protector-strong -fcf-protection -Wl,-z,defs -Wl,-z,now -Wl,-z,relro ${{ matrix.cfg.flags }}"
cmake -DCMAKE_BUILD_TYPE:STRING="Release" -DCMAKE_C_FLAGS:STRING="$flags" -DCMAKE_CXX_FLAGS:STRING="$flags" -DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON ..
- name: Build
working-directory: ./build
run: cmake --build . --config Release --target "DLXEmu"
- name: Strip binary
working-directory: ./build/bin
run: strip DLXEmu
- name: Determine asset name
run: echo "RELEASE_NAME=dlxemu-${{ github.event.release.name }}-linux-${{ matrix.cfg.arch_name }}" >> "$GITHUB_ENV"
- name: Package build artifacts
working-directory: ./build
run: |
zip ${RELEASE_NAME}.zip bin/DLXEmu
sha256sum ${RELEASE_NAME}.zip > ${RELEASE_NAME}.zip.sha256
tar -czvf ${RELEASE_NAME}.tar.gz bin/DLXEmu
sha256sum ${RELEASE_NAME}.tar.gz > ${RELEASE_NAME}.tar.gz.sha256
- name: Upload Release asset
uses: softprops/action-gh-release@v2
with:
tag_name: 'v${{ github.event.inputs.major_version }}.${{ github.event.inputs.minor_version }}.${{ github.event.inputs.patch_version }}'
files: |
build/${RELEASE_NAME}.zip
build/${RELEASE_NAME}.zip.sha256
build/${RELEASE_NAME}.tar.gz
build/${RELEASE_NAME}.tar.gz.sha256