Skip to content
name: Publish Decision Spec Packages
on:
release:
types: [published]
env:
WORKINGDIRECTORY_DECISION: .build/ts/decision
jobs:
typescript:
name: Publish Typescript Package
runs-on: ubuntu-latest
steps:
- id: a9c19221-2149-41f2-91d7-e8411bf3ecc5
name: Checkout Repository
uses: actions/checkout@v3
- id: ba48f425-ccc1-4288-8ff6-4a1812e83224
name: Setup NodeJS
uses: actions/setup-node@v3
with:
node-version: 18
- id: f7414109-3255-4132-a3c9-6e38a68e54fe
name: Setup Java (Needed by Generator)
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17
- id: e75378b3-35d5-4f84-a871-d47e518f2d04
name: Install Dependencies
run: npm clean-install
- id: ced9f2a9-8b4a-4082-a0d1-7791c847d632
name: Build Typescript Components from Decision Spec
run: npm run build-decision-typescript
- id: db7f8f85-c695-48a1-acfc-a2898987dfa3
name: Copy Package Files into Working Directory
run: cp decision/package-config/npm/* ${WORKINGDIRECTORY_DECISION}
- id: db6068b8-f5ed-4968-847e-b642595243fd
name: Install Typescript Compiler Globally
run: |
npm install --global typescript@5.2.x
tsc --version
- id: e842d27d-141c-47f2-b64c-2c5702984edf
name: Compile Package
working-directory: ${{ env.WORKINGDIRECTORY_DECISION }}
run: |
tsc --outDir dist --declaration --target es5 --module nodenext --moduleResolution nodenext --lib es6,dom --showConfig *.ts
tsc --outDir dist --declaration --target es5 --module nodenext --moduleResolution nodenext --lib es6,dom *.ts
- id: edd89b5d-54fa-4951-8206-54b1cef91968
name: Configure Project-Level .npmrc File
working-directory: ${{ env.WORKINGDIRECTORY_DECISION }}
run: npm config set --location=project @adzerk:registry=https://'${NPM_REGISTRY}' //'${NPM_REGISTRY}'/:_authToken='${NPM_SECRET}'
- id: c8734e87-1bb8-4340-9ab2-fd5cabb1ac6b
name: Update Version package.json to Released Version
working-directory: ${{ env.WORKINGDIRECTORY_DECISION }}
run: npm pkg set "version"="${GITHUB_REF_NAME}"
- id: b5abe142-c11f-4951-8809-4bc118b4027d
name: Publish Package to NPM
env:
NPM_REGISTRY: registry.npmjs.org
NPM_SECRET: ${{ secrets.NPM_TOKEN }}
working-directory: ${{ env.WORKINGDIRECTORY_DECISION }}
run: |
echo "Publishing tag ${GITHUB_REF_NAME} to ${NPM_REGISTRY}."
npm publish --access=public
- id: c3c47fb3-2620-4dd1-898b-e867303278ea
name: Publish Package to GitHub Packages
env:
NPM_REGISTRY: npm.pkg.github.com
NPM_SECRET: ${{ secrets.GITHUB_TOKEN }}
working-directory: ${{ env.WORKINGDIRECTORY_DECISION }}
run: |
echo "Publishing tag ${GITHUB_REF_NAME} to ${NPM_REGISTRY}."
npm publish --access=public