Build #25
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: brgen-build | |
run-name: Build | |
on: push | |
concurrency: | |
group: build-${{ github.ref_name }} | |
cancel-in-progress: true | |
jobs: | |
build-linux: | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
steps: | |
- name: Timeline | |
uses: Kesin11/actions-timeline@b03a6aa289adef5534c84ccb6fbef7c975973574 # v2.1.0 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Checkout repository | |
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3 | |
- name: Set up Ninja | |
uses: seanmiddleditch/gha-setup-ninja@8b297075da4cd2a5f1fd21fe011b499edf06e9d2 # master | |
- name: Set up Clang | |
uses: egor-tensin/setup-clang@ef434b41eb33a70396fb336b1bae39c76d740c3d # v1.4 | |
with: | |
version: latest | |
platform: x64 | |
- name: Build | |
run: | | |
. build.sh native Release | |
./tool/src2json --version | |
- name: Pack artifacts | |
run: | | |
mkdir -p artifacts | |
cp -a ./tool ./artifacts/tool | |
cp -a ./script/link_path.sh ./artifacts | |
cp -a ./example ./artifacts/example | |
cp -a ./LICENSE ./artifacts | |
cp -a ./README.md ./artifacts | |
cp -a ./brgen.json ./artifacts | |
cp -a ./script/make_cpp_test.sh ./artifacts | |
cp -a ./script/make_cpp_tests.sh ./artifacts | |
cp -a ./testkit ./artifacts/testkit | |
- name: Upload artifacts | |
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3 | |
with: | |
name: brgen-linux | |
path: ./artifacts | |
build-macos: | |
runs-on: macos-latest | |
timeout-minutes: 20 | |
steps: | |
- name: Timeline | |
uses: Kesin11/actions-timeline@b03a6aa289adef5534c84ccb6fbef7c975973574 # v2.1.0 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Checkout repository | |
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3 | |
- name: Set up Ninja | |
uses: seanmiddleditch/gha-setup-ninja@8b297075da4cd2a5f1fd21fe011b499edf06e9d2 # master | |
- name: Install Homebrew Clang | |
run: | | |
brew install llvm | |
- name: Build | |
run: | | |
export FUTILS_CXX_COMPILER=/usr/local/opt/llvm/bin/clang++ | |
export FUTILS_C_COMPILER=/usr/local/opt/llvm/bin/clang | |
. build.sh native Release | |
./tool/src2json --version | |
- name: Pack artifacts | |
run: | | |
mkdir -p artifacts | |
cp -a ./tool ./artifacts/tool | |
cp -a ./script/link_path.sh ./artifacts | |
cp -a ./example ./artifacts/example | |
cp -a ./LICENSE ./artifacts | |
cp -a ./README.md ./artifacts | |
cp -a ./brgen.json ./artifacts | |
cp -a ./script/make_cpp_test.sh ./artifacts | |
cp -a ./script/make_cpp_tests.sh ./artifacts | |
cp -a ./testkit ./artifacts/testkit | |
- name: Upload artifacts | |
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3 | |
with: | |
name: brgen-macos | |
path: ./artifacts | |
build-windows: | |
runs-on: windows-latest | |
timeout-minutes: 20 | |
steps: | |
- name: Timeline | |
uses: Kesin11/actions-timeline@b03a6aa289adef5534c84ccb6fbef7c975973574 # v2.1.0 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Checkout repository | |
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3 | |
- name: Set up Ninja | |
uses: seanmiddleditch/gha-setup-ninja@8b297075da4cd2a5f1fd21fe011b499edf06e9d2 # master | |
- name: Set up Clang | |
uses: egor-tensin/setup-clang@ef434b41eb33a70396fb336b1bae39c76d740c3d # v1.4 | |
with: | |
version: latest | |
platform: x64 | |
- name: Build | |
shell: cmd | |
run: | | |
call .\build.bat native Release %CD%\utils | |
.\tool\src2json.exe --version | |
- name: Pack artifacts | |
shell: cmd | |
run: | | |
mkdir artifacts | |
xcopy /E /I /Y tool artifacts\tool | |
xcopy /E /I /Y example artifacts\example | |
copy /Y LICENSE artifacts | |
copy /Y README.md artifacts | |
copy /Y brgen.json artifacts | |
copy /Y script\make_cpp_test.bat artifacts | |
copy /Y script\make_cpp_tests.bat artifacts | |
xcopy /E /I /Y testkit artifacts\testkit | |
- name: Upload artifacts | |
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3 | |
with: | |
name: brgen-windows | |
path: ./artifacts | |
build-vscode-extension: | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
steps: | |
- name: Timeline | |
uses: Kesin11/actions-timeline@b03a6aa289adef5534c84ccb6fbef7c975973574 # v2.1.0 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Checkout repository | |
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3 | |
- name: Set up Node.js | |
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 | |
- name: Setup ast2ts | |
run: | | |
cd ast2ts | |
npm install | |
tsc | |
cd .. | |
- name: Install VSCE | |
run: npm install -g vsce | |
- name: Build | |
run: | | |
cd lsp | |
npm install | |
vsce package | |
- name: Pack artifacts | |
run: | | |
mkdir -p artifacts | |
cp -a ./lsp/LICENSE ./artifacts | |
cp -a ./lsp/brgen-lsp-*.vsix ./artifacts | |
- name: Upload artifacts | |
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3 | |
with: | |
name: brgen-vscode-extension | |
path: ./artifacts | |
build-arm-linux: | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
steps: | |
- name: Timeline | |
uses: Kesin11/actions-timeline@b03a6aa289adef5534c84ccb6fbef7c975973574 # v2.1.0 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Checkout repository | |
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3 | |
- name: Set up Ninja | |
uses: seanmiddleditch/gha-setup-ninja@8b297075da4cd2a5f1fd21fe011b499edf06e9d2 # master | |
- name: Install Cross Compiler | |
run: | | |
sudo apt-get update && sudo apt-get install -y g++-aarch64-linux-gnu | |
- name: Build | |
run: | | |
go version | |
export GOARCH=arm64 | |
export FUTILS_CXX_COMPILER=aarch64-linux-gnu-g++ | |
export FUTILS_C_COMPILER=aarch64-linux-gnu-gcc | |
export CC=$FUTILS_C_COMPILER | |
. build.sh native Release | |
- name: Pack artifacts | |
run: | | |
mkdir -p artifacts | |
cp -a ./tool ./artifacts/tool | |
cp -a ./script/link_path.sh ./artifacts | |
cp -a ./example ./artifacts/example | |
cp -a ./LICENSE ./artifacts | |
cp -a ./README.md ./artifacts | |
cp -a ./brgen.json ./artifacts | |
cp -a ./script/make_cpp_test.sh ./artifacts | |
cp -a ./script/make_cpp_tests.sh ./artifacts | |
cp -a ./testkit ./artifacts/testkit | |
- name: Upload artifacts | |
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3 | |
with: | |
name: brgen-linux-arm | |
path: ./artifacts | |
build-android: | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
steps: | |
- name: Timeline | |
uses: Kesin11/actions-timeline@b03a6aa289adef5534c84ccb6fbef7c975973574 # v2.1.0 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Checkout repository | |
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3 | |
- name: Set up Ninja | |
uses: seanmiddleditch/gha-setup-ninja@8b297075da4cd2a5f1fd21fe011b499edf06e9d2 # master | |
- name: Install Android NDK | |
uses: nttld/setup-ndk@6a7e9c5494a25c4842ca1011f710300132eacd94 # v1.4.2 | |
with: | |
ndk-version: r26b | |
- name: Build | |
run: | | |
BASE_PATH=/opt/hostedtoolcache/ndk/r26b/x64/toolchains/llvm/prebuilt/linux-x86_64 | |
#ls -Ral $BASE_PATH | |
export GOARCH=arm64 | |
export FUTILS_CXX_COMPILER=$BASE_PATH/bin/aarch64-linux-android21-clang++ | |
export FUTILS_C_COMPILER=$BASE_PATH/bin/aarch64-linux-android21-clang | |
export CC=$FUTILS_C_COMPILER | |
. build.sh native Release | |
LIBCPP_SHARED=$BASE_PATH/sysroot/usr/lib/aarch64-linux-android/libc++_shared.so | |
cp $LIBCPP_SHARED ./tool | |
- name: Pack artifacts | |
run: | | |
mkdir -p artifacts | |
cp -a ./tool ./artifacts/tool | |
cp -a ./script/link_path.sh ./artifacts | |
cp -a ./example ./artifacts/example | |
cp -a ./LICENSE ./artifacts | |
cp -a ./README.md ./artifacts | |
cp -a ./brgen.json ./artifacts | |
cp -a ./script/make_cpp_test.sh ./artifacts | |
cp -a ./script/make_cpp_tests.sh ./artifacts | |
cp -a ./testkit ./artifacts/testkit | |
- name: Upload artifacts | |
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3 | |
with: | |
name: brgen-android | |
path: ./artifacts | |
collect-licenses: | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
steps: | |
- name: Timeline | |
uses: Kesin11/actions-timeline@b03a6aa289adef5534c84ccb6fbef7c975973574 # v2.1.0 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Checkout repository | |
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3 | |
- name: fetch dependencies | |
run: | | |
go mod download | |
cd ast2ts | |
npm install | |
tsc | |
cp ../LICENSE ./out | |
cd ../lsp | |
npm install | |
cd server | |
npm install | |
cd ../client | |
npm install | |
cd ../../src/tool/json2rust | |
mkdir -p ./pkg | |
cp ../../../LICENSE ./pkg | |
cd ../../../web/doc | |
go mod download | |
cd ../dev | |
npm install | |
cd ../.. | |
- name: Install gocredits | |
run: | | |
go install github.com/Songmu/gocredits/cmd/gocredits@latest | |
- name: Set up ruby | |
uses: ruby/setup-ruby@70da3bbf44ac06db1b0547ce2acc9380a5270d1e # v1.175.0 | |
with: | |
ruby-version: ruby | |
- uses: github/setup-licensed@d6b3a6f7058c2b40c06d205e13e15c2418977566 # v1.1.4 | |
with: | |
version: "4.4" # required: supports matching based on string equivalence or node-semver range | |
- name: Collect licenses | |
run: | | |
go mod edit -json | |
. ./script/collect_licenses.sh | |
- name: List licenses | |
run: | | |
ls -alR ./license_cache | |
- name: Upload artifacts | |
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3 | |
with: | |
name: brgen-licenses | |
path: ./license_cache | |
build-pages: | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
steps: | |
- name: Timeline | |
uses: Kesin11/actions-timeline@b03a6aa289adef5534c84ccb6fbef7c975973574 # v2.1.0 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Checkout | |
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3 | |
- name: Setup Emscripten | |
uses: mymindstorm/setup-emsdk@6ab9eb1bda2574c4ddb79809fc9247783eaf9021 # v14 | |
- name: Set up Ninja | |
uses: seanmiddleditch/gha-setup-ninja@8b297075da4cd2a5f1fd21fe011b499edf06e9d2 # master | |
- name: Set up ast2ts | |
run: | | |
cd ast2ts | |
npm install | |
tsc | |
cd .. | |
- name: Set up wasm-pack | |
run: | | |
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh | |
- name: Build Wasm | |
run: | | |
GOROOT=`go env GOROOT` | |
echo "GOROOT=$GOROOT" | |
export WASMEXEC_FILE="$GOROOT/misc/wasm/wasm_exec.js" | |
export WEB_PRODUCTION="production" | |
. build.sh wasm-em Release | |
- name: Setup Hugo | |
uses: peaceiris/actions-hugo@75d2e84710de30f6ff7268e08f310b60ef14033f # v3.0.0 | |
with: | |
hugo-version: "latest" | |
extended: true | |
- name: Build Hugo | |
run: | | |
cd web/doc | |
hugo --minify | |
cd ../.. | |
- name: Upload artifact | |
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3 | |
with: | |
name: brgen-web | |
path: "./web/public" | |
- name: Setup Pages | |
uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5.0.0 | |
release: | |
needs: | |
[ | |
build-linux, | |
build-macos, | |
build-windows, | |
build-vscode-extension, | |
build-arm-linux, | |
build-android, | |
build-pages, | |
collect-licenses, | |
] | |
uses: ./.github/workflows/release.yml | |
permissions: | |
contents: write | |
run-test: | |
needs: build-linux | |
uses: ./.github/workflows/brgen-test.yaml | |
deploy: | |
needs: build-pages | |
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
uses: ./.github/workflows/deploy.yml | |
permissions: | |
contents: read | |
pages: write | |
id-token: write |