-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #336 from wasmerio/release-please
Add a release-please workflow for automated publishing
- Loading branch information
Showing
4 changed files
with
79 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
".": "0.1.0" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}} |