Build LuaJIT #1039
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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\`をダウンロードすることをお勧めします。" |