From 17a20887cec795d73484958b7730b1a29b555b4c Mon Sep 17 00:00:00 2001 From: Andrii Bodnar Date: Thu, 12 Sep 2024 12:14:42 +0300 Subject: [PATCH] ci: fix release process (#113) --- .github/workflows/ci.yml | 40 +++++++++++++++++++++++++++++++++-- .github/workflows/release.yml | 13 +++++++++--- 2 files changed, 48 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 39ad752..f232c7e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,13 +12,21 @@ on: - 'README.md' - 'LICENSE' +env: + TOOLCHAIN: 1.80.0 + jobs: check: name: Check runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@stable + + - uses: dtolnay/rust-toolchain@master + with: + toolchain: ${{ env.TOOLCHAIN }} + targets: wasm32-wasi + - uses: Swatinem/rust-cache@v2 - name: Run cargo check @@ -30,8 +38,36 @@ jobs: needs: check steps: - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@stable + + - uses: dtolnay/rust-toolchain@master + with: + toolchain: ${{ env.TOOLCHAIN }} + targets: wasm32-wasi + - uses: Swatinem/rust-cache@v2 - name: Run cargo test run: cargo test + + test-publish: + name: Test Publish + runs-on: ubuntu-latest + needs: test + steps: + - uses: actions/checkout@v4 + + - uses: dtolnay/rust-toolchain@master + with: + toolchain: ${{ env.TOOLCHAIN }} + targets: wasm32-wasi + + - uses: Swatinem/rust-cache@v2 + + - name: Set up Node + uses: actions/setup-node@v4 + with: + registry-url: 'https://registry.npmjs.org' + node-version: 16.x + + - name: Publish Dry Run + run: npm publish --dry-run diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6136ed7..7f12ea4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,19 +4,26 @@ on: release: types: [released, prereleased] +env: + TOOLCHAIN: 1.80.0 + jobs: release: name: Release runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@stable - - name: Set up Node 14 + - uses: dtolnay/rust-toolchain@master + with: + toolchain: ${{ env.TOOLCHAIN }} + targets: wasm32-wasi + + - name: Set up Node uses: actions/setup-node@v4 with: registry-url: 'https://registry.npmjs.org' - node-version: 14.x + node-version: 16.x - uses: Swatinem/rust-cache@v2