diff --git a/.github/workflows/wasm.yaml b/.github/workflows/wasm.yaml index 4eac887c..cab817a8 100644 --- a/.github/workflows/wasm.yaml +++ b/.github/workflows/wasm.yaml @@ -14,44 +14,31 @@ jobs: wasm: name: WASM 🧭 runs-on: ubuntu-latest + if: startsWith(github.ref, 'refs/tags/v') steps: - - name: Check if release exists ⚙️ - id: check-if-release-exists - uses: insightsengineering/release-existence-action@v1 - - name: Get branch names 🌿 - if: >- - steps.check-if-release-exists.outputs.release-exists == 'true' id: branch-name uses: tj-actions/branch-names@v7 - name: Checkout repo 🛎 uses: actions/checkout@v4.1.1 - if: >- - steps.check-if-release-exists.outputs.release-exists == 'true' with: ref: ${{ steps.branch-name.outputs.head_ref_branch }} path: ${{ github.event.repository.name }} - name: Get package name 📦 - if: >- - steps.check-if-release-exists.outputs.release-exists == 'true' run: | echo "PKGNAME=$(echo $(awk -F: '/Package:/{gsub(/[ ]+/,"") ; print $2}' DESCRIPTION))" >> $GITHUB_ENV shell: bash working-directory: ${{ github.event.repository.name }}/${{ inputs.package-subdirectory }} - name: Build WASM packages 🧭 - if: >- - steps.check-if-release-exists.outputs.release-exists == 'true' uses: r-wasm/actions/build-rwasm@v1 with: packages: | ${{ github.repository_owner }}/${{ env.PKGNAME }}@${{ steps.branch-name.outputs.tag }} - name: Upload WASM packages ⬆ - if: >- - steps.check-if-release-exists.outputs.release-exists == 'true' uses: actions/upload-artifact@v4 with: name: wasm-${{ env.PKGNAME }} @@ -59,6 +46,10 @@ jobs: _site/bin/emscripten/contrib/*/${{ env.PKGNAME }}*.tgz _site/src/contrib/${{ env.PKGNAME }}*.tar.gz + - name: Check if release exists ⚙️ + id: check-if-release-exists + uses: insightsengineering/release-existence-action@v1 + - name: Download artifact ⏬ if: >- steps.check-if-release-exists.outputs.release-exists == 'true'