Skip to content

chore: update github release and coverage actions and remove deprecat… #115

chore: update github release and coverage actions and remove deprecat…

chore: update github release and coverage actions and remove deprecat… #115

Workflow file for this run

name: Release
on:
workflow_dispatch:
inputs:
version:
description: 'The version to release. Format vx.x.x(-[rc|beta].x)'
required: false
default: ''
deploy_docs:
description: 'Deploy Docs. Set to false for non-stable releases!'
default: true
type: boolean
release_type:
description: 'Release Type'
required: true
default: 'insider'
type: choice
options:
- insider
- regular
push:
branches:
- main
permissions:
id-token: write # Required for OIDC
pages: write
contents: write
pull-requests: write
jobs:
### publish insider release
publish-insider-release:
if: ${{ inputs.release_type == 'insider' || github.event_name == 'push' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: 24
registry-url: 'https://registry.npmjs.org'
cache: 'npm'
- run: npm ci
- name: 'Build project with new version'
run: npm run build
- name: Resolve version
id: vars
run: |
SHORT_SHA=$(git rev-parse --short HEAD)
echo "sha_short=${SHORT_SHA}" >> $GITHUB_OUTPUT
- name: 'Version based on commit: 0.0.0-insider.${{ steps.vars.outputs.sha_short }}'
run: npm version -w libraries 0.0.0-insider.${{ steps.vars.outputs.sha_short }} --force --no-git-tag-version
- name: 'rebuild ui-library-angular to reflect version in libraries/ui-library-angular/dist/ui-library-angular/package.json'
run: npm run build -w libraries/ui-library-angular
- name: 'Publish insider release to NPM'
env:
NPM_CONFIG_PROVENANCE: true
run: |
npm publish --tag=insider --access=public libraries/ui-library/
npm publish --tag=insider --access=public libraries/ui-library-vue/
npm publish --tag=insider --access=public libraries/ui-library-angular/dist/ui-library-angular/
npm publish --tag=insider --access=public libraries/ui-library-react/
- name: 'Deploy Documentation'
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: docs/.vitepress/dist
# this folder needs to be kept in sync with the base property in /docs/.vitepress/config.mts
target-folder: docs/v5
### publish regular release
publish-release:
if: ${{ inputs.release_type == 'regular' && inputs.version != '' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: 24
registry-url: 'https://registry.npmjs.org'
cache: 'npm'
- 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 release/package-updates-${{ inputs.version }}
git add package*.json libraries/ui-library/package*.json libraries/ui-library-vue/package*.json libraries/ui-library-angular/package*.json libraries/ui-library-react/package*.json
git commit -m "${{ inputs.version }}"
git push origin release/package-updates-${{ inputs.version }}
- name: 'Build project with new version'
run: npm run build
- name: 'Publish to NPM'
env:
NPM_CONFIG_PROVENANCE: true
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-react/
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 ${{ github.ref_name }} -H release/package-updates-${{ inputs.version }} --title 'Update package.json Versions for Release ${{ inputs.version }}' --body 'Created by Github action. Merge this Pull Request, if you created this Release from main.'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: 'Create GitHub release'
uses: softprops/action-gh-release@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ inputs.version }}
name: '${{ inputs.version }}'
generate_release_notes: true
make_latest: true
- name: 'Deploy Documentation'
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: docs/.vitepress/dist
# this folder needs to be kept in sync with the base property in /docs/.vitepress/config.mts
target-folder: docs/v5