Skip to content

Release

Release #1912

Workflow file for this run

name: Release
on:
workflow_run:
workflows: ['Test']
branches: ['main']
types:
- completed
jobs:
main:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
token: '${{ secrets.TOLGEE_MACHINE_PAT }}'
# fetch full history for lerna version to work
fetch-depth: 0
- name: Build
uses: actions/setup-node@v4
with:
node-version: '20'
- uses: pnpm/action-setup@v3
name: Install pnpm
id: pnpm-install
with:
version: 8.6.12
run_install: false
- name: Set git globals
run: |
git config --local user.email "[email protected]"
git config --local user.name "Tolgee Machine"
- name: Install
run: pnpm i
- name: Get next version by semantic-release
id: version
run: npx semantic-release --dry-run && echo "VERSION=$(cat .VERSION)" >> $GITHUB_OUTPUT
- name: Update version locally
if: ${{ steps.version.outputs.VERSION != '' }}
run: |
lerna version ${{ steps.version.outputs.VERSION }} --yes --exact --force-publish \
--no-push --no-git-tag-version
# Set TOLGEE_UI_VERSION for @tolgee/core build
- name: Set env
if: ${{ steps.version.outputs.VERSION != '' }}
run: |
echo "TOLGEE_UI_VERSION=$(pnpm run --silent ui-version)" >> $GITHUB_ENV
pnpm run --silent ui-version
- name: Build all packages
if: ${{ steps.version.outputs.VERSION != '' }}
run: pnpm build || pnpm build
- name: Recreate release with push
if: ${{ steps.version.outputs.VERSION != '' }}
run: |
git stash
lerna version ${{ steps.version.outputs.VERSION }} --yes --exact --force-publish \
--create-release github
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}' > ~/.npmrc
- name: Publish
if: ${{ steps.version.outputs.VERSION != '' }}
run: lerna publish from-package --yes
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- uses: actions/upload-artifact@v4
if: always()
with:
name: cypress
path: |
cypress/videos/**/*
cypress/screenshots/**/*