-
Notifications
You must be signed in to change notification settings - Fork 235
131 lines (112 loc) · 3.91 KB
/
release.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
name: Release
on:
# Run manually from UI
workflow_dispatch:
inputs:
skip_version_bump:
description: Skip version bump
type: boolean
skip_tag_and_release:
description: Skip tag-and-release
type: boolean
env:
TZ: "America/New_York"
jobs:
release:
name: Release
runs-on: ubuntu-latest
environment: Production
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
token: ${{ secrets.RELEASE_GITHUB_TOKEN }} # for sync-repos pull/push later on
fetch-depth: 0 # fetches ALL history. needed for sync-repos operations
# for sync-repos pull/push later on
- name: Setup Git User
run: |
git config --global user.name "${{ github.triggering_actor }}" && \
git config --global user.email "${{ github.triggering_actor }}@users.noreply.github.com"
- name: Setup PNPM
uses: pnpm/[email protected]
with:
version: 8.6.3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 20.14.0
cache: 'pnpm'
# Mutates .npmrc to allow for NPM publishing
# Will expect the NODE_AUTH_TOKEN environment variable (see below)
registry-url: 'https://registry.npmjs.org'
# - name: Setup Turbo Cache
# uses: actions/cache@v3
# with:
# path: node_modules/.cache/turbo
# key: turbo-${{ github.job }}-${{ github.ref_name }}-${{ github.sha }}
# restore-keys: turbo-${{ github.job }}-${{ github.ref_name }}-
- name: Install Dependencies
run: |
pnpm \
--filter '!./standard' \
--filter '!./examples/**' \
--filter '!@fullcalendar-tests/*' \
install
- name: Lint
run: |
pnpm \
--filter '!./standard' \
--filter '!./examples/**' \
--filter '!@fullcalendar-tests/*' \
run lint
- name: Bump Versions
if: success() && !inputs.skip_version_bump
run: pnpm run version-bump
- name: Build
run: |
pnpm \
--filter '!./standard' \
--filter '!./examples/**' \
--filter '!@fullcalendar-tests/*' \
run build
pnpm run archive
# execute only contrib tests, as "smoke" tests. they're fast
- name: Test
run: |
pnpm \
--filter './contrib/**' \
run test
# Must happen before tag-and-release. Would prefer to do it after as a
# `continue-on-error:true` optional task, in case pushing back to main fails,
# but the tag-and-release script expects everything to be ready.
#
# Also, do as few pushes as possible, because each triggers CI.
#
# Also, RELEASE_GITHUB_TOKEN must have permissions to push to protected branches.
#
- name: Sync Repos
run: |
echo "Pulling latest and rebasing version-bump commit atop..."
git pull --rebase
echo "Updating subrepo configs..."
pnpm run meta:update
git diff-index --quiet HEAD || \
git commit -m 'meta:update'
echo "Checking Git status (for sync-repos debugging)..."
git status
echo "Syncing subrepos with latest commits..."
echo "(Will record new state of subrepos on HEAD and push...)"
pnpm run sync-repos
- name: Tag & Create GitHub Releases
if: success() && !inputs.skip_tag_and_release
env:
GH_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN }} # for GitHub CLI
run: pnpm run tag-and-release
# NOTE: NPM_TOKEN needs write access to all @fullcalendar/* packages
# AND fullcalendar/fullcalendar-scheduler
#
- name: Publish to NPM
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: pnpm run publish