Release and Publish #13
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 and Publish | |
on: | |
workflow_dispatch: | |
jobs: | |
test: | |
uses: ./.github/workflows/test.yml | |
release: | |
needs: test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- run: mkdir -p ./dist | |
- name: Download the build artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: distribution | |
path: ./dist | |
- run: cat <<< $(jq 'del(.scripts.prepare)' ./dist/package.json) > ./dist/package.json | |
- name: Package the build artifact | |
run: npm pack ./dist | |
- name: Get Package Version | |
run: | | |
echo "RELEASE_NAME=$(npm info ./ version)" >> $GITHUB_ENV | |
- name: Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
draft: false | |
prerelease: false | |
generate_release_notes: true | |
tag_name: ${{ env.RELEASE_NAME }} | |
files: typedoc-plugin-versions-*.tgz | |
publish: | |
needs: test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- run: mkdir -p ./dist | |
- name: Download the build artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: distribution | |
path: ./dist | |
- run: cat <<< $(jq 'del(.scripts.prepare)' ./dist/package.json) > ./dist/package.json | |
- name: Publish to npm | |
uses: actions/setup-node@v4 | |
with: | |
node-version: lts/* | |
cache: npm | |
registry-url: https://registry.npmjs.org | |
- run: npm publish --access public ./dist | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
document: | |
needs: release | |
uses: ./.github/workflows/docs.yml |