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 63f8370
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/anki_artifacts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
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
./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/...

This comment has been minimized.

Copy link
@mikehardy

mikehardy Jun 21, 2022

Member

perhaps

if ! bazel --version > /dev/null 2>&1; then
    echo "Bazel missing, please install it from your favorite package manager, e.g. 'brew install bazelisk'"
    exit 1
fi

it's the little things ;-)

This comment has been minimized.

Copy link
@dae

dae Jun 21, 2022

Author

I've reverted the commit that depends on this in the AnkiDroid PR for now, as it has some issue that need to be fixed (preferably by someone with a bit more gradle experience) - so this could either go in as-is and unused for now, or I can revert it if you'd prefer.

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 63f8370

Please sign in to comment.