-
Notifications
You must be signed in to change notification settings - Fork 46
75 lines (61 loc) · 1.85 KB
/
on-push-to-main.yaml
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
name: Release
on:
push:
branches: [main]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: Build
uses: ./.github/workflows/build.yaml
secrets: inherit
test:
name: Test E2E
uses: ./.github/workflows/e2e.yaml
secrets: inherit
changesets:
name: Changesets
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Clone repository
uses: actions/checkout@v3
with:
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
fetch-depth: 0
- name: Install core dependencies
uses: ./.github/actions/install-dependencies
- name: Install dependencies
run: pnpm install
- name: Create Version Pull Request
uses: changesets/action@v1
with:
version: pnpm run changeset:version
commit: "chore: version package"
title: "chore: version package"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
release:
name: Release
needs: [build, test]
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Clone repository
uses: actions/checkout@v3
- name: Install core dependencies
uses: ./.github/actions/install-dependencies
- name: Install dependencies
run: pnpm install
- name: Build
run: |
pnpm run build && pnpm run build:esm && jq '. + {type: "module"}' ./src/package.json > ./src/package.tmp.json && mv ./src/package.tmp.json ./src/package.json
- name: Publish to NPM
uses: changesets/action@v1
with:
publish: pnpm run changeset:release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_ORG_PIMLICO_TOKEN }}