Skip to content

esaw24-16x9-1p: force smaller camera on stream 2 #323

esaw24-16x9-1p: force smaller camera on stream 2

esaw24-16x9-1p: force smaller camera on stream 2 #323

Workflow file for this run

name: Build
on:
push:
branches: [ master ]
workflow_dispatch:
inputs:
base_branch:
description: 'Name of branch to base build on'
type: string
required: false
default: 'master'
build_branch:
description: 'Name of branch to commit build to'
type: string
required: false
default: 'build'
jobs:
build:
runs-on: ubuntu-latest
steps:
# Checkout the base branch of this repository with full depth
- name: Checkout this repository
uses: actions/checkout@v3
with:
token: ${{ secrets['GITHUB_TOKEN'] }}
ref: ${{ inputs.base_branch || 'master' }}
fetch-depth: 0
# Set the local git user config to use the GitHub Actions bot account
- name: Set local git config user details
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
# Recheckout both the base and build branches.
# This can "fail" if the build branch doesn't exist, but we should continue anyway.
- name: (Re)checkout both branches
id: checkout
continue-on-error: true
run: |
git checkout ${{ inputs.base_branch || 'master' }}
git checkout ${{ inputs.build_branch || 'build' }}
# Attempt to start to merge the base branch into build.
# This can "error" but we want to continue regardless.
# Will only run if the checkout step was successful.
- name: Merge base into build (1)
if: ${{ steps.checkout.outcome == 'success' }}
continue-on-error: true
run: |
git merge --no-commit ${{ inputs.base_branch || 'master' }}
# Do the 2nd part of the merge. This will ignore the branch's "shared" submodule stuff.
# This can "error" if the merge commit is empty but we want to continue regardless.
# Will only run if the checkout step was successful.
- name: Merge base into build (2)
if: ${{ steps.checkout.outcome == 'success' }}
continue-on-error: true
run: |
rm -rf shared~${{ inputs.base_branch || 'master' }}
git rm --ignore-unmatch --cached -r shared~${{ inputs.base_branch || 'master' }}
git reset HEAD shared
git commit -m "Merge branch '${{ inputs.base_branch || 'master' }}' into ${{ inputs.build_branch || 'build' }}"
# Returns the submodule back so we can get the latest files to build from that.
# Will only run if the checkout step was successful.
- name: Re-add esa-layouts-shared submodule
if: ${{ steps.checkout.outcome == 'success' }}
run: |
rm -rf shared
git rm --ignore-unmatch --cached -r shared
git checkout ${{ inputs.base_branch || 'master' }} shared
git commit -m "Re-add submodule" -a --allow-empty
# Converts the esa-layouts-shared submodule into a normal directory of files.
# This is done as we want to freeze the build at a point in time and this works well.
- name: Convert esa-layouts-shared submodule to regular directory
run: |
git submodule update --init
git rm --cached shared
git config -f .git/config --remove-section submodule.shared
rm -rf shared/.git
git add shared
# Setup some Node stuff
- name: Node.js setup
uses: actions/setup-node@v3
with:
node-version: '18'
# Install pnpm
- uses: pnpm/action-setup@v2
name: Install pnpm
with:
version: 8
# Gets pnpm's store directory (for next step)
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
# Set pnpm cache options
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
# Install pnpm dependencies
- name: Install pnpm dependencies
run: pnpm i --frozen-lockfile
# Actually build everything
- name: Build
run: |
npm run clean
npm run build
# Start committing newly built files into a temporary commit.
- name: Commit built files (1)
run: |
git add -f dashboard graphics extension
git add -f ':(glob)./shared/extension/*/dist/**'
git commit -m "Built files" -a --allow-empty
# Squash the previous 2 commits down for convenience and create the final build commit.
# Will only run if the checkout step was successful.
# This can "fail" if there are no newly changed/built files, but we should continue anyway.
- name: Commit built files (2)
continue-on-error: true
if: ${{ steps.checkout.outcome == 'success' }}
run: |
git reset --soft HEAD~2
git commit -m "Built files" -a
# Pushes the built files to a specific branch
- name: Push built files to build branch
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets['GITHUB_TOKEN'] }}
branch: ${{ inputs.build_branch || 'build' }}