-
-
Notifications
You must be signed in to change notification settings - Fork 28
85 lines (71 loc) · 2.39 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
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: 22
- uses: pnpm/action-setup@v3
name: Install pnpm
id: pnpm-install
with:
version: 8.15.9
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/**/*