-
Notifications
You must be signed in to change notification settings - Fork 225
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b590aa2
commit 5c8553f
Showing
1 changed file
with
6 additions
and
39 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 |
---|---|---|
|
@@ -8,25 +8,13 @@ on: | |
required: false | ||
|
||
jobs: | ||
update-and-publish: | ||
publish-noir-wasm: | ||
runs-on: ubuntu-22.04 | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- uses: actions/checkout@v3 | ||
with: | ||
repository: "noir-lang/noir" | ||
ref: ${{ inputs.noir-ref || 'master' }} | ||
path: ".cache/noir" | ||
|
||
- name: Collect Revision | ||
id: collect-rev | ||
working-directory: ".cache/noir" | ||
run: | | ||
echo "NOIR_REV_SHORT=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | ||
- uses: actions/cache@v3 | ||
with: | ||
path: | | ||
|
@@ -45,37 +33,16 @@ jobs: | |
run: | | ||
nix build -L github:noir-lang/noir/master#wasm | ||
- name: Configure git | ||
run: | | ||
git config user.name kobyhallx | ||
git config user.email [email protected] | ||
- name: Copy output | ||
run: | | ||
cp -r $(readlink result)/* . | ||
- name: Authenticate with npm | ||
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc | ||
|
||
- name: Update version with git hash | ||
if: ${{ !inputs.noir-ref }} | ||
# This will generate the prerelease with something like `.0` but that is okay because it is proper SemVer | ||
run: | | ||
npm version --no-git-tag-version --preid ${{ steps.collect-rev.outputs.NOIR_REV_SHORT }} prerelease | ||
- name: Commit updates | ||
run: | | ||
git add . | ||
git commit -m "tracking noir@${{ steps.collect-rev.outputs.NOIR_REV_SHORT }}" | ||
git push --force | ||
- name: Publish to npm (nightly tag) | ||
if: ${{ !inputs.noir-ref }} | ||
run: | | ||
npm publish --tag nightly | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
|
||
- name: Publish to npm (latest tag) | ||
- name: Publish to npm | ||
if: ${{ inputs.noir-ref }} | ||
run: | | ||
npm publish --tag latest | ||
npm publish --access public | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |