diff --git a/.github/tapes/boa_cli.tape b/.github/tapes/boa_cli.tape new file mode 100644 index 00000000000..1b8bd959ca9 --- /dev/null +++ b/.github/tapes/boa_cli.tape @@ -0,0 +1,4 @@ +Output cli/assets/boa_cli.gif + +# The below path assumes that we are calling from Boa's root. +Source ./.github/tapes/boa_cli_src.tape diff --git a/.github/tapes/boa_cli_src.tape b/.github/tapes/boa_cli_src.tape new file mode 100644 index 00000000000..c2c13be4687 --- /dev/null +++ b/.github/tapes/boa_cli_src.tape @@ -0,0 +1,37 @@ +# The source tape file for creating the CLI intro GIF + +# Setup env +Hide + +Set TypingSpeed 50ms +Set Theme "GruvboxDark" +Set Shell fish + +# boa_cli needs to be installed for the tape to run. +Require boa + +Show + +Type "boa" + +Sleep 100ms + +Enter + +Type "2 + '2'" + +Enter + +Sleep 100ms + +Type "const sayHello = () => { return 'Hello World!' };" + +Enter + +Sleep 100ms + +Type "sayHello();" + +Enter + +Sleep 2s \ No newline at end of file diff --git a/.github/tapes/ci_cli_intro.tape b/.github/tapes/ci_cli_intro.tape new file mode 100644 index 00000000000..c0a063b268b --- /dev/null +++ b/.github/tapes/ci_cli_intro.tape @@ -0,0 +1,4 @@ +Output tmp/boa_cli.gif + +# The below path assumes that we are calling from Boa's root. +Source ./.github/tapes/boa_cli_src.tape diff --git a/.github/workflows/artifacts.yml b/.github/workflows/artifacts.yml new file mode 100644 index 00000000000..462551a88a1 --- /dev/null +++ b/.github/workflows/artifacts.yml @@ -0,0 +1,28 @@ +name: Build Artifacts + +on: + pull_request: + branches: + - main + +jobs: + build_cli_tape: + name: Generate boa_cli GIF + runs-on: ubuntu-latest + timeout-minutes: 60 + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + - run: cargo install --path ./cli + # Below is from vhs-actions examples + # https://github.com/charmbracelet/vhs-action/blob/main/examples/auto-commit.yml + - uses: charmbracelet/vhs-action@v1 + with: + version: v0.7.1 + path: './.github/tapes/ci_cli_intro.tape' + - uses: mfinelli/setup-imagemagick@v5 + with: + cache: true + - run: magick compare -verbose ./tmp/boa_cli.gif ./cli/assets/boa_cli.gif + # Clean up tmp directory created by ci_cli_intro.tape + - run: rm -rf ./tmp diff --git a/cli/README.md b/cli/README.md index ac8ea12996c..fd9b9ecb5e0 100644 --- a/cli/README.md +++ b/cli/README.md @@ -18,6 +18,8 @@ your CLI. +![](./assets/boa_cli.gif) + Once installed, your good to go! To execute some JavaScript source code, navigate to the directy of your choosing and type: diff --git a/cli/assets/boa_cli.gif b/cli/assets/boa_cli.gif new file mode 100644 index 00000000000..7cf28716b68 Binary files /dev/null and b/cli/assets/boa_cli.gif differ