Skip to content

Commit

Permalink
chore: add noir-source-resolver (#2485)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonybur authored Sep 4, 2023
1 parent 158f231 commit 99cf768
Show file tree
Hide file tree
Showing 16 changed files with 3,603 additions and 10 deletions.
8 changes: 2 additions & 6 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ jobs:
with:
path: ${{ env.CACHED_PATHS }}
key: ${{ steps.cache.outputs.cache-primary-key }}

- name: Package artifacts
run: |
mkdir dist
Expand Down Expand Up @@ -120,11 +120,7 @@ jobs:
strategy:
fail-fast: false
matrix:
target:
[
x86_64-unknown-linux-gnu,
x86_64-unknown-linux-musl,
]
target: [x86_64-unknown-linux-gnu, x86_64-unknown-linux-musl]

steps:
- name: Checkout
Expand Down
53 changes: 53 additions & 0 deletions .github/workflows/release-source-resolver.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Release and Publish Source Resolver

on:
workflow_dispatch:
inputs:
version:
description: "Version number"
required: false

jobs:
release-source-resolver:
name: Release and Publish Source Resolver
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Bump version
working-directory: ./crates/source-resolver
id: bump_version
run: |
if [ -z "${{ github.event.inputs.version }}" ]; then
NEW_VERSION=$(npm version patch --no-git-tag-version)
else
NEW_VERSION=$(npm version ${{ github.event.inputs.version }} --no-git-tag-version)
fi
echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV
- name: Install dependencies
working-directory: ./crates/source-resolver
run: npm install

- name: Build noir-source-resolver
working-directory: ./crates/source-resolver
run: npm run build

- name: Publish to NPM
working-directory: ./crates/source-resolver
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Configure git
run: |
git config user.name kevaundray
git config user.email [email protected]
- name: Commit updates
run: |
git add crates/source-resolver/package-lock.json
git add crates/source-resolver/package.json
git commit -m "chore: Update source-resolver to ${{ env.NEW_VERSION }}"
git push
29 changes: 29 additions & 0 deletions .github/workflows/test-source-resolver.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Test Source Resolver

on:
push:
paths:
- "crates/source-resolver/**"
pull_request:
paths:
- "crates/source-resolver/**"

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install dependencies
working-directory: ./crates/source-resolver
run: npm install

- name: Build noir-source-resolver
working-directory: ./crates/source-resolver
run: npm run build

- name: Run tests
working-directory: ./crates/source-resolver
run: npm run test
2 changes: 1 addition & 1 deletion .github/workflows/wasm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
# Don't create cache entries for the merge queue.
if: ${{ steps.cache.outputs.cache-hit != 'true' && github.event_name != 'merge_group' }}
with:
path: ${{ env.CACHED_PATHS }}
path: ${{ env.CACHED_PATHS }}
key: ${{ steps.cache.outputs.cache-primary-key }}

- name: Package artifacts
Expand Down
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ examples/9
node_modules
pkg/

# Source resolver
crates/source-resolver/node_modules
crates/source-resolver/lib
crates/source-resolver/lib-node

# Nix stuff
**/outputs
result
Expand Down
Loading

0 comments on commit 99cf768

Please sign in to comment.