Release #29
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: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: 'The version to release. Format vx.x.x(-[rc|beta].x)' | |
required: true | |
type: string | |
jobs: | |
publish-release: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
registry-url: 'https://registry.npmjs.org' | |
cache: 'npm' | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- run: npm ci | |
- name: 'Set version in package.json files to ${{ inputs.version }}' | |
run: | | |
npm version ${{ inputs.version }} --force --no-git-tag-version | |
npm version ${{ inputs.version }} -w libraries/ --force --no-git-tag-version | |
- name: 'Commit changes to release branch' | |
run: | | |
git config user.name "GitHub action" | |
git config user.email "<>" | |
git checkout -b feature/${{ inputs.version }} | |
git add package*.json libraries/ui-library/package*.json libraries/ui-library-vue/package*.json libraries/ui-library-angular/package*.json | |
git commit -m "${{ inputs.version }}" | |
git push origin feature/${{ inputs.version }} | |
- name: 'Build project with new version' | |
run: npm run build | |
- name: 'Publish to NPM' | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }} | |
run: | | |
npm publish --tag=latest --access=public libraries/ui-library/ | |
npm publish --tag=latest --access=public libraries/ui-library-vue/ | |
npm publish --tag=latest --access=public libraries/ui-library-angular/dist/ui-library-angular/ | |
- name: 'Create tag' | |
run: | | |
git tag ${{ inputs.version }} | |
git push origin ${{ inputs.version }} | |
- name: 'Create Pull Request' | |
run: gh pr create -B main -H feature/${{ inputs.version }} --title 'Release ${{ inputs.version }}' --body 'Created by Github action' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: 'Create GitHub release' | |
uses: actions/create-release@latest | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ inputs.version }} | |
release_name: '${{ inputs.version }}' | |
body: '${{ inputs.version }}' | |
- name: 'Deploy Documentation' | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
folder: docs/.vitepress/dist | |
target-folder: docs |