Repository navigation
proper readme #13
This file contains hidden or 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: Basalt 2.5 CI | |
| on: | |
| push: | |
| branches: | |
| - basalt2.5 | |
| pull_request: | |
| branches: | |
| - basalt2.5 | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| craftos: | |
| name: CraftOS checks | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Install build dependencies | |
| run: | | |
| sudo add-apt-repository --yes ppa:jackmacwindows/ppa | |
| sudo apt-get update | |
| sudo apt-get install --yes craftos-pc lua5.4 | |
| - name: Validate documentation annotations | |
| run: | | |
| mkdir -p "$RUNNER_TEMP/craftos-docgen" | |
| craftos \ | |
| --headless \ | |
| --directory "$RUNNER_TEMP/craftos-docgen" \ | |
| --mount-ro "Basalt=$GITHUB_WORKSPACE" \ | |
| --exec "local ok=shell.run('Basalt/tools/docgen.lua','--check'); os.shutdown(ok and 0 or 1)" | |
| - name: Smoke-test the source loader | |
| run: | | |
| mkdir -p "$RUNNER_TEMP/craftos-smoke" | |
| craftos \ | |
| --headless \ | |
| --directory "$RUNNER_TEMP/craftos-smoke" \ | |
| --mount-ro "basalt=$GITHUB_WORKSPACE/src" \ | |
| --exec "local ok=shell.run('basalt/main.lua'); os.shutdown(ok and 0 or 1)" | |
| - name: Build release bundles | |
| run: | | |
| mkdir -p "$RUNNER_TEMP/basalt-output" | |
| lua5.4 tools/bundle-host.lua \ | |
| --no-minify "$RUNNER_TEMP/basalt-output/basalt.lua" | |
| lua5.4 tools/bundle-host.lua \ | |
| "$RUNNER_TEMP/basalt-output/basalt.min.lua" | |
| lua5.4 tools/bundle-host.lua \ | |
| --compress "$RUNNER_TEMP/basalt-output/basalt.compressed.lua" | |
| - name: Smoke-test release bundles | |
| run: | | |
| mkdir -p "$RUNNER_TEMP/craftos-release-smoke" | |
| craftos \ | |
| --headless \ | |
| --directory "$RUNNER_TEMP/craftos-release-smoke" \ | |
| --mount-ro "output=$RUNNER_TEMP/basalt-output" \ | |
| --exec "local normal=assert(loadfile('output/basalt.lua'))(); local compact=assert(loadfile('output/basalt.min.lua'))(); local packed=assert(loadfile('output/basalt.compressed.lua'))(); assert(normal.VERSION==compact.VERSION and compact.VERSION==packed.VERSION); os.shutdown(0)" | |
| - name: Update committed bundles | |
| if: github.event_name == 'push' | |
| run: | | |
| cp "$RUNNER_TEMP/basalt-output/basalt.lua" bundle/basalt.lua | |
| cp "$RUNNER_TEMP/basalt-output/basalt.min.lua" bundle/basalt.min.lua | |
| cp "$RUNNER_TEMP/basalt-output/basalt.compressed.lua" \ | |
| bundle/basalt.compressed.lua | |
| git add bundle/basalt.lua bundle/basalt.min.lua \ | |
| bundle/basalt.compressed.lua | |
| if git diff --cached --quiet; then | |
| exit 0 | |
| fi | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git commit -m "Build release bundles" | |
| git push | |
| - name: Upload release bundles | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: basalt-2.5 | |
| path: ${{ runner.temp }}/basalt-output/*.lua | |
| if-no-files-found: error |