Skip to content

Commit

Permalink
ci: implement node package release (#55)
Browse files Browse the repository at this point in the history
  • Loading branch information
scarmuega authored Feb 9, 2024
1 parent 185557e commit 9e918d7
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 1 deletion.
32 changes: 32 additions & 0 deletions .github/actions/node-release/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: 'release npm package'
description: 'Transpiles and publishes the Node package from the codegen artifact'
inputs:
npm-registry-token:
description: token to authenticate to npmjs.org
required: true

runs:
using: 'composite'
steps:

- name: Setup npm
uses: actions/setup-node@v4
with:
node-version: 20.11.0
cache: "npm"
cache-dependency-path: "codegen/node/package.json"

- name: Typescript Transpile
shell: bash
working-directory: codegen/node
run: |
npm install
npm run build
- name: Publish to npm
working-directory: codegen/node
shell: bash
env:
NPM_REGISTRY_TOKEN: ${{ inputs.npm-registry-token }}
run: |
npm publish --dry-run
19 changes: 18 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: "Release"

on:
workflow_dispatch:
push:
tags: v*
workflow_dispatch:

jobs:
generate:
Expand All @@ -29,3 +29,20 @@ jobs:
- uses: ./.github/actions/rust-release
with:
cargo-registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}

node-release:
needs: [generate]
runs-on: ubuntu-latest

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

- uses: actions/download-artifact@v4
with:
name: codegen
path: ./codegen

- uses: ./.github/actions/node-release
with:
npm-registry-token: ${{ secrets.NPM_REGISTRY_TOKEN }}

0 comments on commit 9e918d7

Please sign in to comment.