Skip to content

Commit

Permalink
Update conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
walkowif committed Jun 25, 2024
1 parent bba3d92 commit e9d18c0
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions .github/workflows/wasm.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
---
name: WASM 🧭

# Running this workflow is only supported for git tags.
# TODO: should we fail the workflow if someone tries to run it not for tag?
# TODO: should we support running this workflow in any other way?

on:
workflow_call:
inputs:
Expand All @@ -19,40 +15,50 @@ jobs:
name: WASM 🧭
runs-on: ubuntu-latest
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/[email protected]
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 }}
path: |
_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'
Expand Down

0 comments on commit e9d18c0

Please sign in to comment.