Skip to content

Release v1 NPM Package #9

Release v1 NPM Package

Release v1 NPM Package #9

Workflow file for this run

name: "Release v1 NPM Package"
on:
workflow_dispatch:
inputs:
tag:
description: |
Enter the version for the release tag.
Must be larger than last tag.
Use patch (0.0.x) for bug fixes.
Use minor (0.x.0) for new actions.
type: string
required: true
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false
jobs:
merge-to-v1-branch:
name: Create release by rebasing master to v1 and create a new tag
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'yarn'
registry-url: 'https://registry.npmjs.org'
- run: yarn install
- name: Set git name, mail and origin
run: |
git config --global user.name "Josef Fröhle"
git config --global user.email "[email protected]"
git remote set-url origin https://${{ secrets.BOT_PIPELINE_TOKEN }}@github.com/${{ github.repository }}
- name: Checkout v1 branch and merge
run: |
git checkout v1
git merge --ff-only master
- name: Generate new tag, push tag and branch
run: |
yarn run build
yarn version --non-interactive --no-git-tag-version --new-version ${{ github.event.inputs.tag }}
yarn run changelog
yarn run documentation
git add -A
yarn version --non-interactive --no-git-tag-version --new-version 0.0.0
yarn version --non-interactive --new-version ${{ github.event.inputs.tag }}
git push
git push --tags
git checkout master
git merge --ff-only v1
git push
git subtree split --prefix docs -b gh-pages
git push -f origin gh-pages:gh-pages
- run: yarn publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}