From 6d487c84e3f65049e45a370f9aaaaa60c17c77e4 Mon Sep 17 00:00:00 2001 From: Darwin Boersma Date: Sun, 8 Dec 2024 10:50:23 -0700 Subject: [PATCH] Add CI workflow Signed-off-by: Darwin Boersma --- .github/workflows/ci.yaml | 39 +++++++++++++++++ .../workflows/release-leptos-spin-macro.yml | 43 ------------------- .github/workflows/release-leptos-spin.yml | 43 ------------------- 3 files changed, 39 insertions(+), 86 deletions(-) create mode 100644 .github/workflows/ci.yaml delete mode 100644 .github/workflows/release-leptos-spin-macro.yml delete mode 100644 .github/workflows/release-leptos-spin.yml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..2d5e35f --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,39 @@ +name: "CI" +on: + push: + branches: + - main + pull_request: + branches: + - main +env: + RUST_VERSION: "1.80.1" + SPIN_VERSION: "" +jobs: + spin: + runs-on: "ubuntu-latest" + name: Build Spin App + steps: + - uses: actions/checkout@v4 + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: "${{ env.RUST_VERSION }}" + targets: wasm32-wasip1,wasm32-unknown-unknown + - name: Install Spin + uses: fermyon/actions/spin/setup@v1 + with: + plugins: + - name: Install cargo-binstall + uses: cargo-bins/cargo-binstall@v1.10.16 + - name: Install cargo-leptos + run: cargo binstall cargo-leptos@0.2.22 + - name: Install leptos-ssr template + run: spin templates install --dir . --upgrade + working-directory: . + - name: Create app with template + run: spin new -t leptos-ssr my-leptos-app -a + working-directory: . + - name: Build app + run: spin build + working-directory: ./my-leptos-app diff --git a/.github/workflows/release-leptos-spin-macro.yml b/.github/workflows/release-leptos-spin-macro.yml deleted file mode 100644 index e87f56a..0000000 --- a/.github/workflows/release-leptos-spin-macro.yml +++ /dev/null @@ -1,43 +0,0 @@ -name: Release leptos-spin-macro - -on: - workflow_dispatch: - -jobs: - publish-dry-run: - name: "Perform dry run for publish" - runs-on: ubuntu-latest - steps: - - name: Check out code - uses: actions/checkout@v2 - - - name: Set up Rust - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - - - name: Check macro crate publish - run: cargo publish --dry-run -p leptos-spin-macro - - release: - name: "Publish to crates.io" - needs: publish-dry-run - runs-on: ubuntu-latest - steps: - - name: Check out code - uses: actions/checkout@v2 - - - name: Set up Rust - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - - - name: Log into Crates.io - run: cargo login ${CRATES_IO_TOKEN} - env: - CRATES_IO_TOKEN: ${{ secrets.CRATES_IO_TOKEN }} - - - name: Publish macro crate - run: cargo publish -p leptos-spin-macro diff --git a/.github/workflows/release-leptos-spin.yml b/.github/workflows/release-leptos-spin.yml deleted file mode 100644 index 82e1e4b..0000000 --- a/.github/workflows/release-leptos-spin.yml +++ /dev/null @@ -1,43 +0,0 @@ -name: Release leptos-spin - -on: - workflow_dispatch: - -jobs: - publish-dry-run: - name: "Perform dry run for publish" - runs-on: ubuntu-latest - steps: - - name: Check out code - uses: actions/checkout@v2 - - - name: Set up Rust - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - - - name: Check main crate publish - run: cargo publish --dry-run -p leptos-spin - - release: - name: "Publish to crates.io" - needs: publish-dry-run - runs-on: ubuntu-latest - steps: - - name: Check out code - uses: actions/checkout@v2 - - - name: Set up Rust - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - - - name: Log into Crates.io - run: cargo login ${CRATES_IO_TOKEN} - env: - CRATES_IO_TOKEN: ${{ secrets.CRATES_IO_TOKEN }} - - - name: Publish main crate - run: cargo publish -p leptos-spin