Prepared Drawables #322
This file contains 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: Deploy to GitHub Pages | |
on: | |
push: | |
branches: [ "main" ] | |
jobs: | |
build: | |
name: Build Kotlin/Wasm | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up JDK | |
uses: actions/setup-java@v2 | |
with: | |
distribution: 'adopt' | |
java-version: '17' | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: List all files | |
run: find . | |
- name: Install glyphhanger for font subsetting | |
if: false # disabled as glyphhanger doesn't work | |
run: | | |
pip install fonttools brotli zopfli | |
npm install -g glyphhanger | |
- name: Print used chinese fonts | |
if: false # disabled as glyphhanger doesn't work | |
timeout-minutes: 5 | |
run: | | |
glyphhanger ./app/src/commonMain/composeResources/values-zh/strings.xml | |
- name: Reduce fonts | |
if: false # doesn't work | |
timeout-minutes: 5 | |
run: | | |
glyphhanger ./app/src/commonMain/composeResources/values-zh/strings.xml --subset=./app/src/commonMain/composeResources/font/noto_sans_sc_regular.ttf | |
glyphhanger ./app/src/commonMain/composeResources/values-ko/strings.xml --subset=./app/src/commonMain/composeResources/font/noto_sans_kr_regular.ttf | |
- name: List all files | |
run: find . | |
- name: Run Gradle build | |
run: | | |
chmod +x gradlew | |
./gradlew build allTests wasmJsBrowserDistribution | |
- name: Fix permissions | |
run: | | |
chmod -v -R +rX "app/build/dist/wasmJs/productionExecutable/" | while read line; do | |
echo "::warning title=Invalid file permissions automatically fixed::$line" | |
done | |
- name: Upload Pages artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: app/build/dist/wasmJs/productionExecutable/ | |
deploy: | |
needs: build | |
permissions: | |
pages: write | |
id-token: write | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Deploy to GitHub Pages | |
timeout-minutes: 5 | |
id: deployment | |
uses: actions/deploy-pages@v4 |