-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (73 loc) · 2.32 KB
/
ci.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: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
release:
types:
- published
# Automatically cancel in-progress actions on the same branch
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request_target' && github.head_ref || github.ref }}
cancel-in-progress: true
# Cancel previous running workflow in case of a new push
# concurrency:
# group: ci-${{ github.head_ref || 'main' }}
# cancel-in-progress: true
jobs:
build:
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN || '' }}
HUSKY: 0
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
# - name: Install pnpm
# uses: pnpm/action-setup@v2
# id: pnpm-install
# with:
# version: 8
# run_install: false
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
# cache: 'pnpm'
registry-url: 'https://registry.npmjs.org'
- name: 📥 Monorepo install
uses: ./.github/actions/pnpm-install
- name: 'Lint'
run: pnpm run lint
# - name: 'NPM Identity'
# run: |
# echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc
- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
version: pnpm ci:version
commit: 'chore: update versions'
title: 'chore: update versions'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish
if: steps.changesets.outputs.hasChangesets == 'false'
# You can do something when a publish should happen.
run: pnpm ci:publish
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
# Publish to NPM
- name: Publish Latest Release
if: github.event_name == 'release' && github.event.release.prerelease == false && env.NODE_AUTH_TOKEN != ''
run: pnpm run publish-ci
# Publish to NPM with prerelease dist-tag
- name: Publish Latest Prerelease
if: github.event_name == 'release' && github.event.release.prerelease && env.NODE_AUTH_TOKEN != ''
run: pnpm run publish-ci --dist-tag prerelease