-
Notifications
You must be signed in to change notification settings - Fork 617
153 lines (153 loc) · 4.9 KB
/
pushStable.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
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
# This file was automatically generated by github-actions-wac.
# DO NOT MODIFY IT BY HAND. Instead, modify the source *.wac.ts file(s)
# and run "github-actions-wac build" (or "ghawac build") to regenerate this file.
# For more information, run "github-actions-wac --help".
name: Stable Branch - Push
'on':
push:
branches:
- stable
jobs:
validateWorkflows:
name: Validate workflows
steps:
- uses: actions/setup-node@v4
with:
node-version: 20
- uses: actions/checkout@v4
- name: Install dependencies
run: yarn --immutable
- name: Validate
run: npx github-actions-wac validate
runs-on: ubuntu-latest
env:
NODE_OPTIONS: '--max_old_space_size=4096'
YARN_ENABLE_IMMUTABLE_INSTALLS: false
constants:
name: Create constants
outputs:
run-cache-key: ${{ steps.run-cache-key.outputs.run-cache-key }}
steps:
- uses: actions/setup-node@v4
with:
node-version: 20
- uses: actions/checkout@v4
- name: Create workflow run cache key
id: run-cache-key
run: >-
echo "run-cache-key=${{ github.run_id }}-${{ github.run_attempt }}-${{
vars.RANDOM_CACHE_KEY_SUFFIX }}" >> $GITHUB_OUTPUT
runs-on: ubuntu-latest
env:
NODE_OPTIONS: '--max_old_space_size=4096'
YARN_ENABLE_IMMUTABLE_INSTALLS: false
build:
name: Build
needs: constants
runs-on: webiny-build-packages
steps:
- uses: actions/setup-node@v4
with:
node-version: 20
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: .yarn/cache
key: yarn-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- name: Install dependencies
run: yarn --immutable
working-directory: ''
- name: Build packages
run: yarn build:quick
working-directory: ''
- uses: actions/cache@v4
with:
path: .webiny/cached-packages
key: ${{ needs.constants.outputs.run-cache-key }}
env:
NODE_OPTIONS: '--max_old_space_size=4096'
YARN_ENABLE_IMMUTABLE_INSTALLS: false
npmReleaseBeta:
needs:
- constants
- build
name: NPM release ("beta" tag)
env:
NODE_OPTIONS: '--max_old_space_size=4096'
YARN_ENABLE_IMMUTABLE_INSTALLS: false
GH_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
BETA_VERSION: ${{ vars.BETA_VERSION }}
steps:
- uses: actions/setup-node@v4
with:
node-version: 20
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/cache@v4
with:
path: .yarn/cache
key: yarn-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- uses: actions/cache@v4
with:
path: .webiny/cached-packages
key: ${{ needs.constants.outputs.run-cache-key }}
- name: Install dependencies
run: yarn --immutable
working-directory: ''
- name: Build packages
run: yarn build:quick
working-directory: ''
- name: Create ".npmrc" file in the project root
run: echo "//registry.npmjs.org/:_authToken=\${NPM_TOKEN}" > .npmrc
- name: Set git email
run: git config --global user.email "[email protected]"
- name: Set git username
run: git config --global user.name "webiny-bot"
- name: Version and publish "beta" tag to NPM
run: yarn release --type=beta
runs-on: ubuntu-latest
npmReleaseLatest:
needs:
- constants
- npmReleaseBeta
name: NPM release ("latest" tag)
environment: release
env:
NODE_OPTIONS: '--max_old_space_size=4096'
YARN_ENABLE_IMMUTABLE_INSTALLS: false
GH_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
LATEST_VERSION: ${{ vars.LATEST_VERSION }}
steps:
- uses: actions/setup-node@v4
with:
node-version: 20
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
fetch-depth: 0
- uses: actions/cache@v4
with:
path: .yarn/cache
key: yarn-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- uses: actions/cache@v4
with:
path: .webiny/cached-packages
key: ${{ needs.constants.outputs.run-cache-key }}
- name: Install dependencies
run: yarn --immutable
working-directory: ''
- name: Build packages
run: yarn build:quick
working-directory: ''
- name: Create ".npmrc" file in the project root
run: echo "//registry.npmjs.org/:_authToken=\${NPM_TOKEN}" > .npmrc
- name: Set git email
run: git config --global user.email "[email protected]"
- name: Set git username
run: git config --global user.name "webiny-bot"
- name: Version and publish "latest" tag to NPM
run: yarn release --type=latest
runs-on: ubuntu-latest