Skip to content

Deploy Release

Deploy Release #31

name: 'Deploy Release'
on:
workflow_dispatch:
inputs:
configuration:
description: 'Release mode'
required: true
default: release
type: choice
options:
- dryRun
- prerelease
- release
loglevel:
description: 'npm loglevel'
required: false
default: warn
type: choice
options:
- error
- warn
- notice
- verbose
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write # needed for GitHub releases
outputs:
version: v${{ steps.package-version.outputs.current-version }}
if: github.ref == 'refs/heads/master' || inputs.configuration == 'dryRun'
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.PUSH_PAT }}
- name: Track master branch to make nx affected work
run: git branch --track main origin/master
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
registry-url: https://registry.npmjs.org
scope: '@inovex.de' # important for yarn
always-auth: true
- uses: ./.github/workflows/dependencies-install
- name: Setup Git
run: |
git config --global user.name "${{ github.actor }}"
git config --global user.email "${{ github.actor}}@users.noreply.github.com"
- name: Set npm loglevel
run: npm config set loglevel ${{ inputs.loglevel }}
- name: Build libs
run: yarn run nx run-many -t build -p elements,elements-angular,elements-react,elements-vue
env:
NX_REJECT_UNKNOWN_LOCAL_CACHE: 0
- name: Version and Release
shell: bash
run: yarn nx run workspace:publish:${{ inputs.configuration }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Get current package version
id: package-version
uses: martinbeentjes/[email protected]
ShowVersion:
needs: release
runs-on: ubuntu-latest
steps:
- name: Show version
run: echo ${{ needs.release.outputs.version }}
deployStorybook:
needs: release
if: ${{ inputs.configuration == 'release' }}
uses: ./.github/workflows/deploy-storybook.yml
with:
version: ${{ needs.release.outputs.version }}