Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/workflows/build-android.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Other platform builds

on:
workflow_call:

jobs:
build-android:
name: Build (Android)
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v7

- name: Set up JDK 25
uses: actions/setup-java@v4
with:
java-version: '25'
distribution: 'temurin'
cache: 'gradle'
cache-dependency-path: src/android/frontend/gradle/wrapper/gradle-wrapper.properties

- name: Install ccache
run: sudo apt-get update && sudo apt-get install -y ccache

- uses: actions/cache@v6
with:
path: ~/.cache/ccache
key: ccache-android-${{ github.sha }}
restore-keys: |
ccache-android-

- name: Build APK
run: |
cd src/android/frontend
./gradlew assembleDebug \
-Pandroid.cxx.ndk.ccache=true \
-Porg.gradle.caching=true

- name: Upload APK
uses: actions/upload-artifact@v7
with:
name: butterscotch-android
path: src/android/frontend/app/build/outputs/apk/debug/app-debug.apk
93 changes: 0 additions & 93 deletions .github/workflows/build-other.yml

This file was deleted.

44 changes: 44 additions & 0 deletions .github/workflows/build-web.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Web builds

on:
workflow_call:

jobs:
build-web:
name: Build (Web)
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v7

- name: Get commit info
id: commit-info
run: |
echo "hash=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
echo "date=$(git log -1 --format=%cd --date=short)" >> $GITHUB_OUTPUT

- name: Setup Emscripten SDK
uses: mymindstorm/setup-emsdk@v14
with:
version: latest

- name: Install ccache
run: sudo apt-get update && sudo apt-get install -y ccache

- uses: actions/cache@v6
with:
path: ~/.cache/ccache
key: ccache-web-${{ github.sha }}
restore-keys: |
ccache-web-

- name: Configure
run: emcmake cmake -B build -G Ninja -DWERROR=ON -DPLATFORM=web -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache "-DBUTTERSCOTCH_COMMIT_HASH=${{ steps.commit-info.outputs.hash }}" "-DBUTTERSCOTCH_COMMIT_DATE=${{ steps.commit-info.outputs.date }}"

- name: Build
run: cmake --build build

- name: Upload artifact
uses: actions/upload-artifact@v7
with:
name: butterscotch-web
path: build/butterscotch.*
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
uses: ./.github/workflows/build-console.yml

Other:
uses: ./.github/workflows/build-other.yml
uses: ./.github/workflows/build-web.yml

Compilers:
uses: ./.github/workflows/build-old-compilers.yml
73 changes: 73 additions & 0 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Deploy Web to GitHub Pages

on:
push:
branches: [web-refactor]
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: pages
cancel-in-progress: false

jobs:
build:
name: Build (Web)
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v7

- name: Get commit info
id: commit-info
run: |
echo "hash=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
echo "date=$(git log -1 --format=%cd --date=short)" >> $GITHUB_OUTPUT

- name: Setup Emscripten SDK
uses: mymindstorm/setup-emsdk@v14
with:
version: latest

- name: Install ccache
run: sudo apt-get update && sudo apt-get install -y ccache

- uses: actions/cache@v6
with:
path: ~/.cache/ccache
key: ccache-pages-${{ github.sha }}
restore-keys: |
ccache-pages-
ccache-web-

- name: Configure
run: emcmake cmake -B build -G Ninja -DWERROR=ON -DPLATFORM=web -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache "-DBUTTERSCOTCH_COMMIT_HASH=${{ steps.commit-info.outputs.hash }}" "-DBUTTERSCOTCH_COMMIT_DATE=${{ steps.commit-info.outputs.date }}"

- name: Build
run: cmake --build build

- name: Stage site
run: |
mkdir -p site
cp build/butterscotch.html site/index.html
cp build/butterscotch.js build/butterscotch.wasm site/

- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: site

deploy:
name: Deploy to GitHub Pages
needs: build
runs-on: ubuntu-24.04
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy
id: deployment
uses: actions/deploy-pages@v4
Loading
Loading