-
Notifications
You must be signed in to change notification settings - Fork 0
142 lines (119 loc) · 3.32 KB
/
release.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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
name: Release Version
on:
push:
branches:
- master
jobs:
build_script:
name: Build single-file Script
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
path: 'tiki_build'
- uses: actions/checkout@v4
with:
repository: 'premake/premake-core'
path: 'premake'
- name: Build Premake
run: |
cd premake
make -f Bootstrap.mak linux
cd ..
- name: Generate script
run: |
cd tiki_build
../premake/bin/release/premake5 generate
echo "Script generation successful for build $build_id"
cd ..
- uses: actions/upload-artifact@v4
with:
name: script
path: tiki_build/tiki_build.lua
build_executable:
name: Build Executables
needs: build_script
runs-on: ${{ matrix.config.os }}
strategy:
matrix:
config:
- os: ubuntu-latest
- os: windows-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
path: 'tiki_build'
- uses: actions/checkout@v4
with:
repository: 'premake/premake-core'
path: 'premake'
- uses: actions/download-artifact@v4
with:
name: script
path: premake
- name: Patch Premake
run: |
cd premake
git apply ../tiki_build/premake5_tiki_build.patch
cd ..
- name: Build Premake Linux
if: matrix.config.os != 'windows-latest'
run: |
cd premake
make -f Bootstrap.mak linux
cd ..
echo "output_name=exe_linux" >> $GITHUB_ENV
echo "output_path=premake/bin/release/premake_tb" >> $GITHUB_ENV
- name: Build Premake Windows
if: matrix.config.os == 'windows-latest'
run: |
cd premake
.\Bootstrap.bat
cd ..
echo "output_name=exe_windows" >> $env:GITHUB_ENV
echo "output_path=premake/bin/release/premake_tb.exe" >> $env:GITHUB_ENV
- uses: actions/upload-artifact@v4
with:
name: ${{ env.output_name }}
path: ${{ env.output_path }}
create_release:
name: Create release
needs: build_executable
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
path: 'tiki_build'
- name: Write release info
run: |
cd tiki_build
build_id=$(git rev-list --count HEAD)
build_message=$(git log --format=%B -n 1 ${{ github.sha }})
echo "build_id=$build_id" >> $GITHUB_ENV
cd ..
echo "System Script and Executable release of ${{ github.sha }}" >> release_body.txt
echo "" >> release_body.txt
echo "Changes:" >> release_body.txt
echo "$build_message" >> release_body.txt
- uses: actions/download-artifact@v4
with:
name: script
- uses: actions/download-artifact@v4
with:
name: exe_linux
- uses: actions/download-artifact@v4
with:
name: exe_windows
- name: Create Release
id: create_release
uses: ncipollo/release-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag: v${{ env.build_id }}
name: Release ${{ env.build_id }}
bodyFile: release_body.txt
artifacts: "tiki_build.lua,premake_tb,premake_tb.exe"