-
Notifications
You must be signed in to change notification settings - Fork 4
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 #310 from NorskHelsenett/feature/ror-typescript-re…
…source-models Generating typescript interfaces and publishing npm package
- Loading branch information
Showing
16 changed files
with
511 additions
and
92 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,61 @@ | ||
name: Release ROR resource models to npm | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
|
||
env: | ||
PACKAGE_NAME: ror-resources | ||
PACKAGE_ORG: "@rork8s" | ||
|
||
jobs: | ||
setenv: | ||
permissions: | ||
contents: read | ||
runs-on: ubuntu-latest | ||
outputs: | ||
rorversion: ${{ steps.env.outputs.ROR_VERSION }} | ||
version: ${{ steps.env.outputs.VERSION }} | ||
shortsha: ${{ steps.env.outputs.SHA_SHORT }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- id: env | ||
name: Set env | ||
run: | | ||
echo "ROR_VERSION=${GITHUB_REF#refs/*/}" >> "$GITHUB_OUTPUT" | ||
echo "VERSION=$(echo $ROR_VERSION | cut -d'v' -f 2)" | ||
echo "SHA_SHORT=$(git rev-parse --short HEAD)" >> "$GITHUB_OUTPUT" | ||
publish-ror-resource-models: | ||
if: github.ref_type == 'tag' | ||
runs-on: ubuntu-latest | ||
needs: setenv | ||
|
||
permissions: | ||
contents: read | ||
packages: write | ||
id-token: write | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Install jq | ||
uses: dcarbone/[email protected] | ||
|
||
- name: Use node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '22.x' | ||
- name: Build package | ||
run: | | ||
echo "Building ${{ env.PACKAGE_ORG }}/${{ env.PACKAGE_NAME }} ${{ needs.setenv.outputs.rorversion}} (${{ needs.setenv.outputs.shortsha}})" | ||
- run: mv package.json package-backup.json | ||
- run: jq --arg rorversion ${{ needs.setenv.outputs.version}} --arg shortsha ${{ needs.setenv.outputs.shortsha}} '.version = $rorversion | .commit = $shortsha' package-backup.json > package.json | ||
- run: npm ci | ||
- run: npm run build | ||
- run: npm pack | ||
- name: Publish package | ||
run: | | ||
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPMPUBLISHTOKEN }}" > ~/.npmrc | ||
npm publish --access public | ||
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
Oops, something went wrong.