-
Notifications
You must be signed in to change notification settings - Fork 2
163 lines (142 loc) · 5.67 KB
/
build.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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
name: Build LuaJIT
on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
jobs:
build-original:
runs-on: windows-latest
strategy:
matrix:
version: ["2.0", "2.1"]
arch: ["x64", "x86"]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{ matrix.arch }}
- name: Build LuaJIT
run: |
cd ${{ github.workspace }}
git clone https://luajit.org/git/luajit.git
cd .\luajit\
git checkout v${{ matrix.version }}
cd .\src
(Get-Content .\msvcbuild.bat -Raw) -replace '/MD', '/MT' | Set-Content .\msvcbuild.bat
.\msvcbuild.bat
- name: Set workflow revision
id: workflow-rev
run: |
cd ${{ github.workspace }}
$REVCOUNT = git rev-list --count HEAD
echo "REV_LIST_COUNT=$REVCOUNT" >> $env:GITHUB_OUTPUT
$SHA = git rev-parse HEAD
echo "REV_SHA=$SHA" >> $env:GITHUB_OUTPUT
- name: Set LuaJIT revision
id: luajit-rev
run: |
cd ${{ github.workspace }}\luajit
$REVCOUNT = git rev-list --count HEAD
echo "REV_LIST_COUNT=$REVCOUNT" >> $env:GITHUB_OUTPUT
$SHA = git rev-parse HEAD
echo "REV_SHA=$SHA" >> $env:GITHUB_OUTPUT
- name: Create About-This-Build.txt
run: |
cd ${{ github.workspace }}\luajit
echo "LuaJIT-Auto-Builds r${{ steps.workflow-rev.outputs.REV_LIST_COUNT }}" >> About-This-Build.txt
echo "https://github.com/Per-Terra/LuaJIT-Auto-Builds" >> About-This-Build.txt
echo "" >> About-This-Build.txt
echo "LuaJIT ${{ matrix.version }} ${{ steps.luajit-rev.outputs.REV_SHA }}" >> About-This-Build.txt
echo "https://luajit.org/git/luajit.git" >> About-This-Build.txt
echo "" >> About-This-Build.txt
echo "[Build Info.]" >> About-This-Build.txt
echo "OS: ${{ runner.os }} ${{ runner.arch }}" >> About-This-Build.txt
- name: Create archive
run: |
cd ${{ github.workspace }}\luajit
Compress-Archive doc, COPYRIGHT, README, src\lua51.dll, src\luajit.exe, About-This-Build.txt -DestinationPath LuaJIT_${{ matrix.version }}_Win_${{ matrix.arch }}.zip
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: LuaJIT
path: ${{ github.workspace }}/luajit/LuaJIT_${{ matrix.version }}_Win_${{ matrix.arch }}.zip
build-openresty:
runs-on: windows-latest
strategy:
matrix:
arch: ["x64", "x86"]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{ matrix.arch }}
- name: Build LuaJIT
run: |
cd ${{ github.workspace }}
git clone https://github.com/openresty/luajit2.git
cd .\luajit2\src
(Get-Content .\msvcbuild.bat -Raw) -replace '/MD', '/MT' | Set-Content .\msvcbuild.bat
.\msvcbuild.bat
- name: Set workflow revision
id: workflow-rev
run: |
cd ${{ github.workspace }}
$REVCOUNT = git rev-list --count HEAD
echo "REV_LIST_COUNT=$REVCOUNT" >> $env:GITHUB_OUTPUT
$SHA = git rev-parse HEAD
echo "REV_SHA=$SHA" >> $env:GITHUB_OUTPUT
- name: Set LuaJIT revision
id: luajit-rev
run: |
cd ${{ github.workspace }}\luajit2
$REVCOUNT = git rev-list --count HEAD
echo "REV_LIST_COUNT=$REVCOUNT" >> $env:GITHUB_OUTPUT
$SHA = git rev-parse HEAD
echo "REV_SHA=$SHA" >> $env:GITHUB_OUTPUT
- name: Create About-This-Build.txt
run: |
cd ${{ github.workspace }}\luajit2
echo "LuaJIT-Auto-Builds r${{ steps.workflow-rev.outputs.REV_LIST_COUNT }}" >> About-This-Build.txt
echo "https://github.com/Per-Terra/LuaJIT-Auto-Builds" >> About-This-Build.txt
echo "" >> About-This-Build.txt
echo "LuaJIT 2.1 ${{ steps.luajit-rev.outputs.REV_SHA }}" >> About-This-Build.txt
echo "https://github.com/openresty/luajit2" >> About-This-Build.txt
echo "" >> About-This-Build.txt
echo "[Build Info.]" >> About-This-Build.txt
echo "OS: ${{ runner.os }} ${{ runner.arch }}" >> About-This-Build.txt
- name: Create archive
run: |
cd ${{ github.workspace }}\luajit2
Compress-Archive doc, COPYRIGHT, README, README.md, src\lua51.dll, src\luajit.exe, About-This-Build.txt -DestinationPath LuaJIT_2.1_OpenResty_Win_${{ matrix.arch }}.zip
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: LuaJIT
path: ${{ github.workspace }}/luajit2/LuaJIT_2.1_OpenResty_Win_${{ matrix.arch }}.zip
create-release:
needs:
- build-original
- build-openresty
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v3
with:
name: LuaJIT
path: artifacts
- name: Set datetime
id: datetime
run: |
DATE_TIME=`date +'%Y-%m-%d-%H-%M-%S'`
echo "DATE_TIME=${DATE_TIME}" >> $GITHUB_OUTPUT
- name: Create release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
RELEASE_NAME=Build-${{ steps.datetime.outputs.DATE_TIME }}
TAG_NAME=build-${{ steps.datetime.outputs.DATE_TIME }}
gh release create "$TAG_NAME" ${{ github.workspace }}/artifacts/*.zip --title "$RELEASE_NAME" --notes "AviUtl用には\`LuaJIT_2.1_Win_x86.zip\`をダウンロードすることをお勧めします。"