Skip to content
This repository has been archived by the owner on May 2, 2024. It is now read-only.

Commit

Permalink
[hyperwasm] Consolidate workflows (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
ryangoree authored Nov 10, 2023
1 parent 11aa862 commit 18d2463
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 51 deletions.
38 changes: 20 additions & 18 deletions .github/workflows/build_wasm.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,11 @@
name: build wasm package

on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_call:
inputs:
# Allows other workflows to explicitly control whether this workflow runs
build:
description: 'Whether to build the package'
type: boolean
default: false
required: true
secrets:
HYPERDRIVE_ACCESS_KEY:
description: 'SSH key for checking out hyperdrive'
required: true
release:
types: [published]

jobs:
detect-changes:
Expand All @@ -28,12 +15,12 @@ jobs:

build:
needs: detect-changes
# Run if changes are detected OR if explicitly requested by another workflow
if: needs.detect-changes.outputs.changed == 'true' || inputs.build
# Run if changes are detected OR if triggered by a release
if: (needs.detect-changes.outputs.changed == 'true') || (github.event_name == 'release' && startsWith(github.ref, 'refs/tags/hyperwasm@v'))
name: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
token: ${{github.token}}

Expand All @@ -49,6 +36,7 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: 16
registry-url: https://npm.pkg.github.com/

- name: setup foundry
uses: foundry-rs/foundry-toolchain@v1
Expand All @@ -66,3 +54,17 @@ jobs:
- name: build wasm package
working-directory: crates/hyperwasm
run: sh build.sh

publish:
# Run only if triggered by a release
if: github.event_name == 'release' && startsWith(github.ref, 'refs/tags/hyperwasm@v')
needs: build
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- run: npm publish
working-directory: crates/hyperwasm/pkg
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33 changes: 0 additions & 33 deletions .github/workflows/publish_wasm.yml

This file was deleted.

0 comments on commit 18d2463

Please sign in to comment.