Loading files
This file is pinned to the selected release. Download the original to open it in your design tool.
13ad6d618This file is pinned to the selected release. Download the original to open it in your design tool.
name: Bundle Stack-chan Firmware
on:
push:
branches:
- dev/v1.0
pull_request:
branches:
- dev/v1.0
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check for changes in firmware
id: diff_check
run: |
git diff --quiet HEAD^ HEAD -- ./firmware/ || echo "diff_detected=true" >> $GITHUB_ENV
- name: Cache build results
id: cache
uses: actions/cache@v4
with:
path: ./firmware/stackchan/tech.moddable.stackchan
key: ${{ github.sha }}
- name: Setup
if: ${{ env.diff_detected}} || steps.cache.outputs.cache-hit != 'true'
uses: ./.github/actions/setup
- name: Bundle
if: ${{ env.diff_detected}} || steps.cache.outputs.cache-hit != 'true'
run: source "$HOME/.local/share/xs-dev-export.sh" && npm run bundle
working-directory: ./firmware
- name: Upload Firmware Bundle
if: ${{ env.diff_detected}} || steps.cache.outputs.cache-hit != 'true'
uses: actions/upload-artifact@v4
with:
name: firmware-bundle
path: ./firmware/stackchan/tech.moddable.stackchan
deploy:
needs: build
if: github.event_name == 'push' && github.ref == 'refs/heads/dev/v1.0'
runs-on: ubuntu-latest
steps:
- name: Checkout Pages Branch
uses: actions/checkout@v4
with:
ref: gh-pages
- name: Download Firmware Bundle
uses: actions/download-artifact@v4
with:
name: firmware-bundle
path: ./firmware-bundle
- name: Move Bundle
run: |
mkdir -p ./web/flash/tech.moddable.stackchan
rm -rf ./web/flash/tech.moddable.stackchan/*
mv firmware-bundle/* ./web/flash/tech.moddable.stackchan
- name: Commit and Push
run: |
git config --global user.name 'GitHub Action'
git config --global user.email 'action@github.com'
git add .
git commit -m "Deploy firmware bundle from ${{ github.sha }}"
git push