Add build dependencies to release workflow #3
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
name: Release | |
on: | |
push: | |
branches: ['main'] | |
tags: ['*-v[0-9]+.[0-9]+.[0-9]+'] | |
jobs: | |
build-and-test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '20.x' | |
cache: 'npm' | |
- run: npm config set //npm.pkg.github.com/:_authToken="${{ secrets.GITHUB_TOKEN }}" | |
- run: npm ci | |
- run: npm run build --workspaces | |
- run: npm run test --workspaces | |
publish-criteria-json-pointer: | |
if: startsWith(github.ref, 'refs/tags/criteria-json-pointer-v') | |
needs: build-and-test | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '20.x' | |
registry-url: 'https://registry.npmjs.org' | |
- run: npm ci | |
- id: check-package-version | |
uses: ./.github/actions/check-package-version | |
with: | |
tag-prefix: criteria-json-pointer-v | |
package-path: packages/criteria-json-pointer/package.json | |
- run: npm run build -w packages/criteria-json-pointer | |
- run: npm publish --access public -w packages/criteria-json-pointer | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
publish-criteria-json-schema: | |
if: startsWith(github.ref, 'refs/tags/criteria-json-schema-v') && !startsWith(github.ref, 'refs/tags/criteria-json-schema-validation-v') | |
needs: build-and-test | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '20.x' | |
registry-url: 'https://registry.npmjs.org' | |
- run: npm ci | |
- id: check-package-version | |
uses: ./.github/actions/check-package-version | |
with: | |
tag-prefix: criteria-json-schema-v | |
package-path: packages/criteria-json-schema/package.json | |
- run: npm run build -w packages/criteria-json-pointer -w packages/criteria-json-schema | |
- run: npm publish --access public -w packages/criteria-json-schema | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
publish-criteria-json-schema-validation: | |
if: startsWith(github.ref, 'refs/tags/criteria-json-schema-validation-v') | |
needs: build-and-test | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '20.x' | |
registry-url: 'https://registry.npmjs.org' | |
- run: npm ci | |
- id: check-package-version | |
uses: ./.github/actions/check-package-version | |
with: | |
tag-prefix: criteria-json-schema-validation-v | |
package-path: packages/criteria-json-schema-validation/package.json | |
- run: npm run build -w packages/criteria-json-pointer -w packages/criteria-json-schema -w packages/criteria-json-schema-validation | |
- run: npm publish --access public -w packages/criteria-json-schema-validation | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
publish-criteria-openapi: | |
if: startsWith(github.ref, 'refs/tags/criteria-openapi-v') | |
needs: build-and-test | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '20.x' | |
registry-url: 'https://registry.npmjs.org' | |
- run: npm ci | |
- id: check-package-version | |
uses: ./.github/actions/check-package-version | |
with: | |
tag-prefix: criteria-openapi-v | |
package-path: packages/criteria-openapi/package.json | |
- run: npm run build -w packages/criteria-json-pointer -w packages/criteria-json-schema -w packages/criteria-openapi | |
- run: npm publish --access public -w packages/criteria-openapi | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
publish-criteria-synthetic-data: | |
if: startsWith(github.ref, 'refs/tags/criteria-synthetic-data-v') | |
needs: build-and-test | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '20.x' | |
registry-url: 'https://registry.npmjs.org' | |
- run: npm ci | |
- id: check-package-version | |
uses: ./.github/actions/check-package-version | |
with: | |
tag-prefix: criteria-synthetic-data-v | |
package-path: packages/criteria-synthetic-data/package.json | |
- run: npm run build -w packages/criteria-json-pointer -w packages/criteria-json-schema -w packages/criteria-synthetic-data | |
- run: npm publish --access public -w packages/criteria-synthetic-data | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |