Skip to content

Commit

Permalink
Merge pull request #336 from wasmerio/release-please
Browse files Browse the repository at this point in the history
Add a release-please workflow for automated publishing
  • Loading branch information
Michael Bryan authored Nov 24, 2023
2 parents 571c431 + db0079b commit 741db1b
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 4 deletions.
13 changes: 13 additions & 0 deletions .github/release-please/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"release-type": "node",
"packages": {
".": {
"exclude-paths": [
"examples/"
]
}
},
"bump-minor-pre-major": true,
"bootstrap-sha": "80b158341965d6d3203f68ae2be26d5b6858d65b",
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json"
}
3 changes: 3 additions & 0 deletions .github/release-please/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
".": "0.1.0"
}
10 changes: 6 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,15 @@ jobs:
run: sudo apt-get update && sudo apt-get install -y wabt binaryen
- name: Rust Cache
uses: Swatinem/rust-cache@v2
- name: Install JS Dependencies
run: npm ci
- name: Type Checking
run: cargo check --workspace --verbose --locked
- name: Install JS Dependencies
run: npm install
- name: Build
- name: Unit Tests
run: wasm-pack test --headless --firefox
- name: Build Package
run: npm run build:dev
- name: Test
- name: Integration Tests
run: npm run test

api-docs:
Expand Down
57 changes: 57 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
on:
push:
branches:
- main

permissions:
contents: write
pull-requests: write

name: Run Release Please
jobs:
release-please:
runs-on: ubuntu-latest
outputs:
releases_created: ${{ steps.release.outputs.releases_created }}
steps:
- uses: google-github-actions/release-please-action@v2
id: release
with:
release-type: node
config-file: ./.github/release-please/config.json
manifest-file: ./.github/release-please/manifest.json
token: ${{secrets.GITHUB_TOKEN}}
default-branch: main

publish-to-npm:
runs-on: ubuntu-latest
needs: [
"release-please"
]
if: ${{ needs.release-please.outputs.releases_created }}
steps:
# The logic below handles the npm publication:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: 16
- name: Setup Rust
uses: dsherret/rust-toolchain-file@v1
- name: Install wasm-pack
uses: taiki-e/install-action@wasm-pack
- name: Install wasm-strip and wasm-opt
run: sudo apt-get update && sudo apt-get install -y wabt binaryen
- name: Rust Cache
uses: Swatinem/rust-cache@v2
- name: Install JS Dependencies
run: npm ci
- name: Build Packages
run: npm run build
# Release Please has already incremented versions and published tags, so
# we just need to publish to NPM
- name: Publish to NPM
run: npm publish --access=public
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

0 comments on commit 741db1b

Please sign in to comment.