Skip to content

🧱 Builder changes #139

🧱 Builder changes

🧱 Builder changes #139

Workflow file for this run

# Runs on push to main branch and PRs to main branch
name: CI Build
on:
push:
branches: ['main']
tags-ignore: ['v*.*.*']
paths: ['src/**', 'shaders/**']
pull_request:
branches: ['main']
permissions:
contents: write
jobs:
lint-check:
# I hate this but it's the only way to skip the build job when releasing
if: ${{ !contains(github.event.head_commit.message, 'Releasing new version') }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: x.20
cache: 'npm'
- name: Run lint and check
run: |
npm ci
npm run lint
npm run check
build:
runs-on: ubuntu-latest
needs: lint-check
# Only run on main branch
if: github.ref == 'DISABLED FOR NOW refs/heads/main'
steps:
- uses: actions/checkout@v3
with:
persist-credentials: false
fetch-depth: 0
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: x.20
cache: 'npm'
registry-url: 'https://registry.npmjs.org'
- name: NPM install & version
env:
NODE_ENV: production
run: |
npm ci --include=dev
npm version prerelease --preid=${GITHUB_SHA:0:7} --no-git-tag-version
git status
- name: Build all bundles
env:
NODE_ENV: production
run: |
npm run build-single
npm run build
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add dist-single
git commit -m "Automated build of dist-bundle $(date -u)"
- name: Push dist-bundle back to GitHub
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}
- name: Publish prerelease to Github Packages
run: |
npm publish --tag=pre
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}