Skip to content
This repository has been archived by the owner on Feb 7, 2023. It is now read-only.

Commit

Permalink
Add script to build desktop web/buildinfo artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
dae committed Jun 21, 2022
1 parent 665d81c commit 72bbc41
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/anki_artifacts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Build web/build artifacts from upstream
on:
workflow_dispatch:
push:
schedule:
- cron: "0 0 * * *"
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 80
steps:
- uses: actions/checkout@v2

# todo: cache bazel folder

- name: Build artifacts
run: |
curl -L https://github.com/bazelbuild/bazelisk/releases/download/v1.10.1/bazelisk-linux-amd64 -o ./bazel
chmod +x bazel
export PATH=$(pwd):"$PATH"
./tools/build-ankidroid-artifacts.sh
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: anki_artifacts
if-no-files-found: error
path: anki_artifacts.zip
15 changes: 15 additions & 0 deletions tools/build-ankidroid-artifacts.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

set -e

bazel build buildinfo.txt ts/...
rm -rf droid
mkdir -p droid/web
rsync -a .bazel/bin/buildinfo.txt droid
for i in card-info graphs deck-options change-notetype congrats; do
cp -av .bazel/bin/ts/$i/$i.{html,js,css} droid/web/
done
cd droid
chmod -R a+w *
zip -r ../anki_artifacts.zip *

0 comments on commit 72bbc41

Please sign in to comment.