From a2b3be9045476e9bfb638219313ab5dfce1ec692 Mon Sep 17 00:00:00 2001 From: Woyten Date: Wed, 15 May 2024 23:08:10 +0200 Subject: [PATCH] Deploy tune-cli WASM artifact --- .github/workflows/build-microwave-web.yml | 61 ------------ .github/workflows/deploy-web-artifacts.yml | 105 +++++++++++++++++++++ .github/workflows/run-test-suite.yml | 2 - 3 files changed, 105 insertions(+), 63 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..5c130c54 --- /dev/null +++ b/.github/workflows/deploy-web-artifacts.yml @@ -0,0 +1,105 @@ +name: Deploy web artifacts + +on: + push: + branches: [build-tune-web] + +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 + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: artifact + + deploy-github-pages: + name: Deploy microwave web version 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 + 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