Publish Release #12
Workflow file for this run
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: Publish Release | |
on: | |
workflow_dispatch: | |
jobs: | |
publish_release: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: .node-version | |
cache: npm | |
registry-url: https://registry.npmjs.org | |
- run: npm ci | |
- uses: release-drafter/release-drafter@v6 | |
if: github.ref == 'refs/heads/main' | |
id: release_drafter | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: bump version & publish | |
if: github.ref == 'refs/heads/main' | |
run: | | |
npm version "${{ steps.release_drafter.outputs.tag_name }}" --no-git-tag-version | |
npm publish | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: bump preleease version & publish | |
if: github.ref != 'refs/heads/main' | |
run: | | |
npm version prerelease --no-git-tag-version | |
npm publish --tag next | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: push version | |
if: github.ref == 'refs/heads/main' | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "github-actions" | |
git add . | |
git commit -m ":bookmark: version bump" | |
git push | |
- uses: release-drafter/release-drafter@v6 | |
if: github.ref == 'refs/heads/main' | |
id: release_drafter_publish | |
with: | |
publish: true | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |