generated from PAST3LLE/TRY-N-PT
-
Notifications
You must be signed in to change notification settings - Fork 3
63 lines (51 loc) · 1.84 KB
/
publish.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
name: Publish
on:
push:
branches: [V2,V2-development]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: "Checkout"
uses: actions/checkout@v4
with:
token: ${{secrets.PAT}}
# we need full depth here for lerna tags
fetch-depth: 0
clean: true
- name: Install dependencies
run: yarn install --immutable
- name: Build packages
# skip building apps
run: yarn build:packages
- name: "Set npm config"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
git config user.name "${{ github.actor }}"
git config user.email "${{ github.actor}}@users.noreply.github.com"
npm config set "//registry.npmjs.org/:_authToken" "$NPM_TOKEN"
- name: "Version and publish PRE-RELEASE V2"
if: github.ref_name == 'V2-development'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
echo "V2 pre-release detected. Creating alpha tags"
git reset --hard origin/V2-development
yarn version:ci --conventional-prerelease --preid alpha
yarn publish:ci --dist-tag alpha
- name: "Version and publish PRODUCTION V2"
if: github.ref_name == 'V2'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
echo "Production V2 release detected. Creating latest tags"
git reset --hard origin/V2
yarn version:ci --conventional-graduate
yarn publish:ci