From 84cc20bf1d003743b0a8280a45496b24d341ed80 Mon Sep 17 00:00:00 2001 From: Woyten Date: Wed, 15 May 2024 23:08:10 +0200 Subject: [PATCH] Build and deploy tune-cli web version --- .github/workflows/build-microwave-web.yml | 61 ------------- .github/workflows/deploy-web-artifacts.yml | 100 +++++++++++++++++++++ .github/workflows/run-test-suite.yml | 2 - microwave/README.md | 10 +-- tune-cli/README.md | 4 +- tune-web/README.md | 2 +- 6 files changed, 108 insertions(+), 71 deletions(-) delete mode 100644 .github/workflows/build-microwave-web.yml create mode 100644 .github/workflows/deploy-web-artifacts.yml diff --git a/.github/workflows/build-microwave-web.yml b/.github/workflows/build-microwave-web.yml deleted file mode 100644 index b1ecc054..00000000 --- a/.github/workflows/build-microwave-web.yml +++ /dev/null @@ -1,61 +0,0 @@ -name: Create microwave web version - -on: - push: - branches: [main] - -env: - CARGO_TERM_COLOR: always - RUSTFLAGS: "-D warnings" - -jobs: - create-microwave-web-version: - name: Create microwave web version - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - target: wasm32-unknown-unknown - - name: Install trunk - run: cargo install trunk - - name: Build microwave - run: | - cd microwave - trunk build --release - cd .. - mkdir -p artifact/microwave - mv microwave/dist/* artifact/microwave - - name: Upload Microwave web version - uses: actions/upload-artifact@v4 - with: - name: microwave-wasm - path: artifact - if-no-files-found: error - - name: Upload artifact - uses: actions/upload-pages-artifact@v3 - with: - path: artifact - - deploy-microwave-web-version: - name: Deploy microwave web version to GitHub pages - - needs: create-microwave-web-version - runs-on: ubuntu-latest - - permissions: - pages: write - id-token: write - - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - - steps: - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v4 - diff --git a/.github/workflows/deploy-web-artifacts.yml b/.github/workflows/deploy-web-artifacts.yml new file mode 100644 index 00000000..ece25d0f --- /dev/null +++ b/.github/workflows/deploy-web-artifacts.yml @@ -0,0 +1,100 @@ +name: Deploy web artifacts + +on: + push: + branches: [main] + +env: + CARGO_TERM_COLOR: always + RUSTFLAGS: "-D warnings" + +jobs: + create-tune-cli-web-version: + name: Create tune-cli web version + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + target: wasm32-unknown-unknown + - name: Install trunk + run: cargo install trunk + - name: Build tune-cli + run: | + cd tune-web + trunk build --release + cd .. + mkdir -p artifact + mv tune-web/dist/* artifact + - name: Upload tune-cli + uses: actions/upload-artifact@v4 + with: + name: tune-cli-wasm + path: artifact + if-no-files-found: error + + create-microwave-web-version: + name: Create microwave web version + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + target: wasm32-unknown-unknown + - name: Install trunk + run: cargo install trunk + - name: Build microwave + run: | + cd microwave + trunk build --release + cd .. + mkdir -p artifact + mv microwave/dist/* artifact + - name: Upload microwave + uses: actions/upload-artifact@v4 + with: + name: microwave-wasm + path: artifact + if-no-files-found: error + + deploy-github-pages: + name: Deploy web artifacts to GitHub pages + + needs: + - create-tune-cli-web-version + - create-microwave-web-version + + runs-on: ubuntu-latest + + permissions: + pages: write + id-token: write + + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + + steps: + - name: Download tune-cli artifact + uses: actions/download-artifact@v4 + with: + name: tune-cli-wasm + path: artifact/tune-cli + - name: Download microwave artifact + uses: actions/download-artifact@v4 + with: + name: microwave-wasm + path: artifact/microwave + - name: Upload pages artifact + uses: actions/upload-pages-artifact@v3 + with: + path: artifact + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 \ No newline at end of file diff --git a/.github/workflows/run-test-suite.yml b/.github/workflows/run-test-suite.yml index 1c973265..8ae0c7d1 100644 --- a/.github/workflows/run-test-suite.yml +++ b/.github/workflows/run-test-suite.yml @@ -41,5 +41,3 @@ jobs: target: wasm32-unknown-unknown - name: Ensure all lints pass run: cargo clippy --workspace --target wasm32-unknown-unknown - - name: Build - run: cargo build --workspace --target wasm32-unknown-unknown diff --git a/microwave/README.md b/microwave/README.md index 58ae4e01..b0e977a3 100644 --- a/microwave/README.md +++ b/microwave/README.md @@ -20,7 +20,7 @@ The built-in modular synthesis engine does not use any fixed architecture and ca ## Resources - [Download / Changelog](https://github.com/Woyten/tune/releases) -- [Browser Application](https://woyten.github.io/microwave/launcher.html) +- [Browser Application](https://woyten.github.io/tune/microwave/launcher.html) - Demo: [XĂȘnerie (15-EDO)](https://youtu.be/0PczKDrOdUA) - Demo: [Don't Take Five (16-EDO)](https://youtu.be/LLgClI8pyNw) - Demo: [The Bedoginning (17-EDO)](https://youtu.be/gaYvK9OBHK0) @@ -93,7 +93,7 @@ Irregular custom layout: Option A: Run `microwave` in a web browser without installing any additional software. -- [microwave (Browser)](https://woyten.github.io/microwave/launcher.html) +- [microwave (Browser)](https://woyten.github.io/tune/microwave/launcher.html) Option B: Download a precompiled version of `microwave` for the supported target architectures: @@ -115,7 +115,7 @@ sudo apt install pkg-config cargo install -f microwave ``` -`microwave` should run out-of-the box on a recent (Ubuntu) Linux, Windows or macOS installation. If it doesn't, the problem is probably caused by the Bevy framework. In that case, try following these [instructions](https://bevyengine.org/learn/book/getting-started/setup/). +`microwave` should run out-of-the box on a recent (Ubuntu) Linux, Windows or macOS installation. If it doesn't, the problem is probably caused by the Bevy framework. In that case, try following these [instructions](https://bevyengine.org/learn/quick-start/getting-started/setup/). # Usage @@ -539,13 +539,13 @@ microwave ref-note 62 --root 57 --luma-offs 31 --lo-key 0 --up-key 155 --midi-in # Browser Application -The browser application allows you to utilize `microwave` and all of its features without the need to install any additional software. Simply open the [Web Launcher](https://woyten.github.io/microwave/launcher.html) in your web browser. +The browser application allows you to utilize `microwave` and all of its features without the need to install any additional software. Simply open the [Web Launcher](https://woyten.github.io/tune/microwave/launcher.html) in your web browser. The Web Launcher functions as a command-line terminal, allowing you to launch `microwave` with the command-line arguments shown in the previous sections. ![](https://github.com/Woyten/tune/raw/main/microwave/microwave-web-launcher.png) -To interact with files read from and written to by the browser application, open the [File Manager](https://woyten.github.io/microwave/filemanager.html), which facilitates file exchange between your file system and the application. +To interact with files read from and written to by the browser application, open the [File Manager](https://woyten.github.io/tune/microwave/filemanager.html), which facilitates file exchange between your file system and the application. ![](https://github.com/Woyten/tune/raw/main/microwave/microwave-file-manager.png) diff --git a/tune-cli/README.md b/tune-cli/README.md index bdd8ba72..a5f21b59 100644 --- a/tune-cli/README.md +++ b/tune-cli/README.md @@ -7,7 +7,7 @@ Explore musical tunings and create synthesizer tuning files for microtonal scale ## Resources - [Download / Changelog](https://github.com/Woyten/tune/releases) -- [Browser Application](https://woyten.github.io/tune-cli/) +- [Browser Application](https://woyten.github.io/tune/tune-cli/) - Demo: [I'm a Lumatic (17-EDO)](https://youtu.be/zKnJJEaidWI) - Demo: [Stay Strong (17-EDO)](https://youtu.be/JutcUVrA8Tg) - Demo: [XĂȘnerie (15-EDO)](https://youtu.be/0PczKDrOdUA) @@ -18,7 +18,7 @@ Explore musical tunings and create synthesizer tuning files for microtonal scale Option A: Try out the browser app to get a very first impression: -- [tune-cli (Browser)](https://woyten.github.io/tune-cli) +- [tune-cli (Browser)](https://woyten.github.io/tune/tune-cli) Option B: Download a precompiled version of `tune-cli` for the supported target architectures: diff --git a/tune-web/README.md b/tune-web/README.md index 44eee421..f0896008 100644 --- a/tune-web/README.md +++ b/tune-web/README.md @@ -3,7 +3,7 @@ A browser-based playground for [`tune-cli`](https://github.com/Woyten/tune/tree/ # Resources - [Changelog](https://github.com/Woyten/tune/releases) -- [Browser Application](https://woyten.github.io/tune-cli/) +- [Browser Application](https://woyten.github.io/tune/tune-cli/) # Installation