-
Notifications
You must be signed in to change notification settings - Fork 173
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
54 changed files
with
407 additions
and
200 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: CI | ||
on: | ||
push: | ||
paths-ignore: ['**/*.md'] | ||
pull_request: | ||
branches: [main] | ||
paths-ignore: ['**/*.md'] | ||
|
||
jobs: | ||
windows: | ||
uses: ./.github/workflows/windows.yml | ||
permissions: | ||
contents: write | ||
|
||
macos: | ||
uses: ./.github/workflows/macos.yml | ||
permissions: | ||
contents: write | ||
|
||
linux: | ||
uses: ./.github/workflows/linux.yml | ||
permissions: | ||
contents: write |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
name: Linux | ||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
setup: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Bundle WebUI Bridge | ||
run: | | ||
npm i -g esbuild | ||
bridge/build.sh | ||
- uses: actions/cache@v3 | ||
with: | ||
path: bridge/webui_bridge.h | ||
key: ${{ runner.os }}-${{ github.sha }}-bridge | ||
|
||
build-release: | ||
needs: setup | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
strategy: | ||
matrix: | ||
compiler: [GCC, Clang] | ||
fail-fast: false | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/cache/restore@v3 | ||
with: | ||
path: bridge/webui_bridge.h | ||
key: ${{ runner.os }}-${{ github.sha }}-bridge | ||
fail-on-cache-miss: true | ||
- name: Build | ||
run: | | ||
if [ "${{ matrix.compiler }}" == "Clang" ]; then | ||
sudo ln -s llvm-ar-13 /usr/bin/llvm-ar | ||
sudo ln -s llvm-ranlib-13 /usr/bin/llvm-ranlib | ||
fi | ||
compiler=${{ matrix.compiler }} | ||
make COMPILER=${compiler,,} | ||
- name: Prepare Artifact | ||
run: | | ||
cp -r include dist | ||
artifact=webui-${{ runner.os }}-${{ matrix.compiler }}-x64 | ||
# Convert to lowercase (`,,` ^= lowercase shell param) | ||
artifact=${artifact,,} | ||
# Add the ARTIFACT name as GitHub environment variable. | ||
echo "ARTIFACT=$artifact" >> $GITHUB_ENV | ||
mv dist/ $artifact | ||
tar -czvf $artifact.tar.gz $artifact | ||
- name: Upload Artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{ env.ARTIFACT }} | ||
path: ${{ env.ARTIFACT }} | ||
- name: Release Artifact | ||
if: github.ref_type == 'tag' | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: ${{ env.ARTIFACT }}.tar.gz |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
name: macOS | ||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
setup: | ||
runs-on: macos-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Bundle WebUI Bridge | ||
run: | | ||
npm i -g esbuild | ||
bridge/build.sh | ||
- uses: actions/cache@v3 | ||
with: | ||
path: bridge/webui_bridge.h | ||
key: ${{ runner.os }}-${{ github.sha }}-bridge | ||
|
||
build-release: | ||
needs: setup | ||
runs-on: macos-latest | ||
permissions: | ||
contents: write | ||
strategy: | ||
matrix: | ||
compiler: [Clang] | ||
arch: [x64, arm64] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/cache/restore@v3 | ||
with: | ||
path: bridge/webui_bridge.h | ||
key: ${{ runner.os }}-${{ github.sha }}-bridge | ||
fail-on-cache-miss: true | ||
- name: Build | ||
run: | | ||
if [ "${{ matrix.arch }}" == "arm64" ]; then | ||
make ARCH_TARGET="-target arm64-apple-darwin" | ||
else | ||
make | ||
fi | ||
- name: Prepare Artifacts | ||
run: | | ||
cp -r include dist | ||
# Add the ARTIFACT name(lowercased) as GitHub environment variable. | ||
artifact=$(echo ${{ runner.os }}-${{ matrix.compiler }}-${{ matrix.arch }} | tr '[:upper:]' '[:lower:]') | ||
echo "ARTIFACT=$artifact" >> $GITHUB_ENV | ||
mv dist/ $artifact | ||
tar -czvf $artifact.tar.gz $artifact | ||
- name: Upload Artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{ env.ARTIFACT }} | ||
path: ${{ env.ARTIFACT }} | ||
- name: Release Artifact | ||
if: github.ref_type == 'tag' | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: ${{ env.ARTIFACT }}.tar.gz |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
name: Windows | ||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
setup: | ||
runs-on: windows-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Bundle WebUI Bridge | ||
run: bridge/build.ps1 | ||
- uses: actions/cache@v3 | ||
with: | ||
path: bridge/webui_bridge.h | ||
key: ${{ runner.os }}-${{ github.sha }}-bridge | ||
|
||
build-release: | ||
needs: setup | ||
runs-on: windows-latest | ||
permissions: | ||
contents: write | ||
strategy: | ||
matrix: | ||
compiler: [GCC, MSVC] | ||
fail-fast: false | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/cache/restore@v3 | ||
with: | ||
path: bridge/webui_bridge.h | ||
key: ${{ runner.os }}-${{ github.sha }}-bridge | ||
fail-on-cache-miss: true | ||
- uses: microsoft/[email protected] | ||
- if: ${{ matrix.compiler == 'MSVC' }} | ||
uses: ilammy/msvc-dev-cmd@v1 | ||
- name: Build | ||
run: | | ||
if ('${{ matrix.compiler }}' -eq 'MSVC') { | ||
nmake -f ./Makefile.nmake | ||
} else { | ||
mingw32-make | ||
} | ||
- name: Prepare Artifact | ||
shell: bash | ||
run: | | ||
cp -r include dist | ||
artifact=webui-${{ runner.os }}-${{ matrix.compiler }}-x64 | ||
# Convert to lowercase (`,,` ^= lowercase shell param) | ||
artifact=${artifact,,} | ||
# Add the ARTIFACT name as GitHub environment variable. | ||
echo "ARTIFACT=$artifact" >> $GITHUB_ENV | ||
mv dist/ $artifact | ||
7z a -tzip $artifact.zip $artifact | ||
- name: Upload Artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{ env.ARTIFACT }} | ||
path: ${{ env.ARTIFACT }} | ||
- name: Release Artifact | ||
if: github.ref_type == 'tag' | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: ${{ env.ARTIFACT }}.zip |
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
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
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
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
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
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
Oops, something went wrong.