Anno lib path & Release #10
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: Continuous Delivery | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
release: | |
name: Create Release | |
runs-on: ubuntu-latest | |
# Only run this job if one of the following is true: | |
# - It was run manually. | |
# - A PR was merged that was not from Dependabot or a fork. | |
if: | | |
github.event_name == 'workflow_dispatch' || | |
( | |
startsWith(github.head_ref, 'dependabot/') == false && | |
github.event.pull_request.head.repo.fork == false | |
) | |
outputs: | |
tag: v${{ steps.tag.outputs.version }} | |
steps: | |
- name: Checkout | |
id: checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-tags: true | |
- name: Tag | |
id: tag | |
uses: issue-ops/[email protected] | |
with: | |
manifest-path: package.json | |
workspace: ${{ github.workspace }} | |
ref: master | |
- name: Create Release | |
id: release | |
uses: issue-ops/[email protected] | |
with: | |
tag: v${{ steps.tag.outputs.version }} | |
publish-npm: | |
needs: release | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
id-token: write | |
steps: | |
- name: Checkout | |
id: checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-tags: true | |
- name: Setup Node.js | |
id: setup-node | |
uses: actions/setup-node@v4 | |
with: | |
cache: npm | |
node-version: 20.x | |
registry-url: https://registry.npmjs.org/ | |
- name: Install Dependencies | |
id: install | |
run: npm ci | |
- name: Build | |
id: build | |
run: npm run build | |
- name: Test | |
id: test | |
run: npm run test | |
- name: Publish | |
id: publish | |
env: | |
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} | |
run: | | |
npm whoami | |
npm publish --provenance --access public |