-
Notifications
You must be signed in to change notification settings - Fork 672
119 lines (119 loc) · 4.39 KB
/
unstableRelease.yml
File metadata and controls
119 lines (119 loc) · 4.39 KB
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
# 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: 📦 Unstable Release
'on':
workflow_dispatch:
inputs:
branch:
description: Branch to release from
required: true
default: next
type: string
jobs:
constants:
name: Create constants
outputs:
global-cache-key: ${{ steps.global-cache-key.outputs.global-cache-key }}
run-cache-key: ${{ steps.run-cache-key.outputs.run-cache-key }}
steps:
- uses: actions/setup-node@v4
with:
node-version: 24
- uses: actions/checkout@v4
- name: Create global cache key
id: global-cache-key
run: >-
echo "global-cache-key=${{ github.event.inputs.branch }}-${{ runner.os
}}-$(/bin/date -u "+%m%d")-${{ vars.RANDOM_CACHE_KEY_SUFFIX }}" >>
$GITHUB_OUTPUT
- 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: 24
- uses: actions/checkout@v4
with:
path: ${{ github.event.inputs.branch }}
ref: ${{ github.event.inputs.branch }}
- uses: actions/cache@v4
with:
path: ${{ github.event.inputs.branch }}/.yarn/cache
key: yarn-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- uses: actions/cache@v4
with:
path: ${{ github.event.inputs.branch }}/.webiny/cached-packages
key: ${{ needs.constants.outputs.global-cache-key }}
- name: Install dependencies
run: yarn --immutable
working-directory: ${{ github.event.inputs.branch }}
- name: Build packages
run: yarn build
working-directory: ${{ github.event.inputs.branch }}
- uses: actions/cache@v4
with:
path: ${{ github.event.inputs.branch }}/.webiny/cached-packages
key: ${{ needs.constants.outputs.run-cache-key }}
env:
NODE_OPTIONS: '--max_old_space_size=4096'
YARN_ENABLE_IMMUTABLE_INSTALLS: false
npmReleaseUnstable:
needs:
- constants
- build
name: NPM release ("unstable" tag)
env:
NODE_OPTIONS: '--max_old_space_size=4096'
YARN_ENABLE_IMMUTABLE_INSTALLS: false
GH_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
UNSTABLE_VERSION: ${{ vars.UNSTABLE_VERSION }}
steps:
- uses: actions/setup-node@v4
with:
node-version: 24
- uses: actions/checkout@v4
with:
path: ${{ github.event.inputs.branch }}
ref: ${{ github.event.inputs.branch }}
fetch-depth: 0
- uses: actions/cache@v4
with:
path: ${{ github.event.inputs.branch }}/.yarn/cache
key: yarn-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- uses: actions/cache@v4
with:
path: ${{ github.event.inputs.branch }}/.webiny/cached-packages
key: ${{ needs.constants.outputs.run-cache-key }}
- name: Install dependencies
run: yarn --immutable
working-directory: ${{ github.event.inputs.branch }}
- name: Build packages
run: yarn build
working-directory: ${{ github.event.inputs.branch }}
- name: Create ".npmrc" file in the project root
run: echo "//registry.npmjs.org/:_authToken=\${NPM_TOKEN}" > .npmrc
working-directory: ${{ github.event.inputs.branch }}
- name: Set git email
run: git config --global user.email "[email protected]"
working-directory: ${{ github.event.inputs.branch }}
- name: Set git username
run: git config --global user.name "webiny-bot"
working-directory: ${{ github.event.inputs.branch }}
- name: Version and publish "unstable" tag to NPM
working-directory: ${{ github.event.inputs.branch }}
run: yarn release --type=unstable
runs-on: ubuntu-latest