Skip to content

Commit

Permalink
Merge pull request #5 from Per-Terra/Per-Terra-patch-1
Browse files Browse the repository at this point in the history
GitHub Actionsの仕様変更に対応
  • Loading branch information
Per-Terra authored Dec 4, 2023
2 parents daeea99 + 752171b commit eea3ce7
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 79 deletions.
145 changes: 69 additions & 76 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,19 @@
name: Build LuaJIT

on:
schedule:
- cron: "0 0 * * *"

- cron: "0 0 * * *"
workflow_dispatch:

jobs:
build-original:
runs-on: windows-latest
strategy:
matrix:
arch:
- x86
- x64

version: [2.1]
arch: [x64, x86]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: ilammy/msvc-dev-cmd@v1
with:
Expand All @@ -25,142 +22,138 @@ jobs:
- name: Build LuaJIT
run: |
cd ${{ github.workspace }}
git clone https://github.com/LuaJIT/LuaJIT.git
cd LuaJIT\src
(Get-Content .\msvcbuild.bat -Raw) -replace '/MD','/MT' | Set-Content .\msvcbuild.bat
git clone https://luajit.org/git/luajit.git
cd .\luajit\src
(Get-Content .\msvcbuild.bat -Raw) -replace '/MD', '/MT' | Set-Content .\msvcbuild.bat
.\msvcbuild.bat
- name: Set workflow REV_LIST_COUNT
- name: Set workflow revision
id: workflow-rev
run: |
cd ${{ github.workspace }}
$REVCOUNT = git rev-list --count HEAD
echo "::set-output name=REV_LIST_COUNT::$REVCOUNT"
echo "REV_LIST_COUNT=$REVCOUNT" >> $env:GITHUB_OUTPUT
$SHA = git rev-parse HEAD
echo "::set-output name=REV_SHA::$SHA"
echo "REV_SHA=$SHA" >> $env:GITHUB_OUTPUT
- name: Set LuaJIT REV_SHA
- name: Set LuaJIT revision
id: luajit-rev
run: |
cd ${{ github.workspace }}\LuaJIT
cd ${{ github.workspace }}\luajit
$REVCOUNT = git rev-list --count HEAD
echo "::set-output name=REV_LIST_COUNT::$REVCOUNT"
echo "REV_LIST_COUNT=$REVCOUNT" >> $env:GITHUB_OUTPUT
$SHA = git rev-parse HEAD
echo "::set-output name=REV_SHA::$SHA"
echo "REV_SHA=$SHA" >> $env:GITHUB_OUTPUT
- name: Create BuildInfo File
- 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
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 2.1.0-beta3 ${{ steps.luajit-rev.outputs.REV_SHA }}" >> About-This-Build.txt
echo "https://github.com/LuaJIT/LuaJIT" >> 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
- name: Create archive
run: |
cd ${{ github.workspace }}\LuaJIT
Compress-Archive doc,COPYRIGHT,README,src\lua51.dll,src\lua51.lib,About-This-Build.txt -DestinationPath LuaJIT-2.1.0-beta3_Win_${{ matrix.arch }}.zip
cd ${{ github.workspace }}\luajit
Compress-Archive doc, COPYRIGHT, README, src\lua51.dll, src\lua51.lib, About-This-Build.txt -DestinationPath LuaJIT_${{ matrix.version }}_Win_${{ matrix.arch }}.zip
- uses: actions/upload-artifact@v3
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: LuaJIT
path: ${{ github.workspace }}/LuaJIT/LuaJIT-2.1.0-beta3_Win_${{ matrix.arch }}.zip
path: ${{ github.workspace }}/luajit/LuaJIT_${{ matrix.version }}_Win_${{ matrix.arch }}.zip

build-openresty:
runs-on: windows-latest
strategy:
matrix:
arch:
- x86
- x64

arch: [x64, x86]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{ matrix.arch }}

- name: Build luajit2
- 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
cd .\luajit2\src
(Get-Content .\msvcbuild.bat -Raw) -replace '/MD', '/MT' | Set-Content .\msvcbuild.bat
.\msvcbuild.bat
- name: Set workflow REV_LIST_COUNT
- name: Set workflow revision
id: workflow-rev
run: |
cd ${{ github.workspace }}
$REVCOUNT = git rev-list --count HEAD
echo "::set-output name=REV_LIST_COUNT::$REVCOUNT"
echo "REV_LIST_COUNT=$REVCOUNT" >> $env:GITHUB_OUTPUT
$SHA = git rev-parse HEAD
echo "::set-output name=REV_SHA::$SHA"
echo "REV_SHA=$SHA" >> $env:GITHUB_OUTPUT
- name: Set LuaJIT REV_SHA
- name: Set LuaJIT revision
id: luajit-rev
run: |
cd ${{ github.workspace }}\luajit2
$REVCOUNT = git rev-list --count HEAD
echo "::set-output name=REV_LIST_COUNT::$REVCOUNT"
echo "REV_LIST_COUNT=$REVCOUNT" >> $env:GITHUB_OUTPUT
$SHA = git rev-parse HEAD
echo "::set-output name=REV_SHA::$SHA"
echo "REV_SHA=$SHA" >> $env:GITHUB_OUTPUT
- name: Create BuildInfo File
- 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 "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 "openresty/luajit2 ${{ steps.luajit-rev.outputs.REV_SHA }}" >> 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
- name: Create archive
run: |
cd ${{ github.workspace }}\luajit2
Compress-Archive doc,COPYRIGHT,README,README.md,src\lua51.dll,src\lua51.lib,About-This-Build.txt -DestinationPath LuaJIT-2.1.0-beta3_OpenResty_Win_${{ matrix.arch }}.zip
Compress-Archive doc, COPYRIGHT, README, README.md, src\lua51.dll, src\lua51.lib, About-This-Build.txt -DestinationPath LuaJIT_2.1_OpenResty_Win_${{ matrix.arch }}.zip
- uses: actions/upload-artifact@v3
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: LuaJIT
path: ${{ github.workspace }}/luajit2/LuaJIT-2.1.0-beta3_OpenResty_Win_${{ matrix.arch }}.zip
path: ${{ github.workspace }}/luajit2/LuaJIT_2.1_OpenResty_Win_${{ matrix.arch }}.zip

create_release:
name: Create Release
create-release:
needs:
- build-original
- build-openresty
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: actions/download-artifact@v3
with:
name: LuaJIT
path: artifacts

- name: Get Date
id: get_date
run: |
DATE_TIME=`date +'%Y-%m-%d-%H-%M-%S'`
echo "::set-output name=DATE_TIME::${DATE_TIME}"
- name: Create a Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
RELEASE_NAME=Build-${{ steps.get_date.outputs.DATE_TIME }}
TAG_NAME=build-${{ steps.get_date.outputs.DATE_TIME }}
assets=()
for asset in ${{ github.workspace }}/artifacts/*.zip; do
assets+=("-a" "$asset")
done
hub release create "${assets[@]}" -m "$RELEASE_NAME" "$TAG_NAME"
- 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.get_date.outputs.DATE_TIME }}
TAG_NAME=build-${{ steps.get_date.outputs.DATE_TIME }}
gh release create "$TAG_NAME" ${{ github.workspace }}/artifacts/*.zip --title "$RELEASE_NAME" --notes "AviUtl用には\`LuaJIT_2.1_Win_x86.zip\`をダウンロードすることをお勧めします。"
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
## en
This is an unofficial build of the v2.1 branch of [LuaJIT](https://github.com/LuaJIT/LuaJIT) and the v2.1-agentzh branch of [openresty/luajit2](https://github.com/openresty/luajit2).

As of 2023/03/18, only the build of the library for Winodws(x86/x64) is supported.
As of 2023/12/15, only the build of the library for Winodws(x86/x64) is supported.

## ja
[LuaJIT](https://github.com/LuaJIT/LuaJIT)のv2.1ブランチ及び[openresty/luajit2](https://github.com/openresty/luajit2)のv2.1-agentzhブランチの非公式ビルドです。

2023/03/18現在、Winodws(x86/x64)ビルドのみ対応しています。
2023/12/05現在、Winodws(x86/x64)ビルドのみ対応しています。

## For AviUtl users
Releasesから`LuaJIT-2.1.0-beta3_Win_x86.zip`をダウンロードし、中身のlua51.dllを付属のものと置き換えてください。
Releasesから`LuaJIT_2.1_Win_x86.zip`をダウンロードし、中身のlua51.dllを付属のものと置き換えてください。

## Special Thanks
このリポジトリは[L-SMASH-Works-Auto-Builds](https://github.com/Mr-Ojii/L-SMASH-Works-Auto-Builds)を参考に作成されました。
Expand Down

0 comments on commit eea3ce7

Please sign in to comment.