-
Notifications
You must be signed in to change notification settings - Fork 1k
162 lines (157 loc) · 5.97 KB
/
release.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
154
155
156
157
158
159
160
161
162
name: release
on:
workflow_dispatch:
inputs:
dry_run:
description: 'Dry Run'
required: true
default: true
type: boolean
token:
description: 'Personal Access Token'
required: true
default: ""
type: string
publish_ui:
description: 'Publish to NPM?'
required: true
default: true
type: boolean
jobs:
get_dry_release_versions:
if: github.repository == 'feast-dev/feast'
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ github.event.inputs.token }}
outputs:
current_version: ${{ steps.get_versions.outputs.current_version }}
next_version: ${{ steps.get_versions.outputs.next_version }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "lts/*"
- name: Release (Dry Run)
id: get_versions
run: |
CURRENT_VERSION=$(npx -p @semantic-release/changelog -p @semantic-release/git -p @semantic-release/exec -p semantic-release semantic-release --dry-run | grep "associated with version " | sed -E 's/.* version//' | sed -E 's/ on.*//')
NEXT_VERSION=$(npx -p @semantic-release/changelog -p @semantic-release/git -p @semantic-release/exec -p semantic-release semantic-release --dry-run | grep 'The next release version is' | sed -E 's/.* ([[:digit:].]+)$/\1/')
echo ::set-output name=current_version::$CURRENT_VERSION
echo ::set-output name=next_version::$NEXT_VERSION
echo "Current version is ${CURRENT_VERSION}"
echo "Next version is ${NEXT_VERSION}"
validate_version_bumps:
if: github.repository == 'feast-dev/feast'
needs: get_dry_release_versions
runs-on: ubuntu-latest
env:
# This publish is working using an NPM automation token to bypass 2FA
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
HELM_VERSION: v3.8.0
CURRENT_VERSION: ${{ needs.get_dry_release_versions.outputs.current_version }}
NEXT_VERSION: ${{ needs.get_dry_release_versions.outputs.next_version }}
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "lts/*"
- name: Bump file versions
run: python ./infra/scripts/release/bump_file_versions.py ${CURRENT_VERSION} ${NEXT_VERSION}
- name: Install yarn dependencies
working-directory: ./ui
run: yarn install
- name: Build yarn rollup
working-directory: ./ui
run: yarn build:lib
- name: Bundle UI in SDK
run: make build-ui
- name: Remove previous Helm
run: sudo rm -rf $(which helm)
- name: Set up Homebrew
uses: Homebrew/actions/setup-homebrew@master
- name: Setup Helm-docs
run: |
brew install norwoodj/tap/helm-docs
- name: Generate helm chart READMEs
run: make build-helm-docs
- name: Install Helm
run: ./infra/scripts/helm/install-helm.sh
- name: Validate Helm chart prior to publishing
run: ./infra/scripts/helm/validate-helm-chart-publish.sh
- name: Validate all version consistency
run: ./infra/scripts/helm/validate-helm-chart-versions.sh $NEXT_VERSION
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: 1.21.x
- name: Build & version operator-specific release files
run: |
cd infra/feast-operator/
make build-installer bundle
publish-web-ui-npm:
needs: [ validate_version_bumps, get_dry_release_versions ]
runs-on: ubuntu-latest
env:
# This publish is working using an NPM automation token to bypass 2FA
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
CURRENT_VERSION: ${{ needs.get_dry_release_versions.outputs.current_version }}
NEXT_VERSION: ${{ needs.get_dry_release_versions.outputs.next_version }}
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version-file: './ui/.nvmrc'
- name: Bump file versions (temporarily for Web UI publish)
run: python ./infra/scripts/release/bump_file_versions.py ${CURRENT_VERSION} ${NEXT_VERSION}
- name: Install yarn dependencies
working-directory: ./ui
run: yarn install
- name: Build yarn rollup
working-directory: ./ui
run: yarn build:lib
- name: Publish UI package
working-directory: ./ui
if: github.event.inputs.dry_run == 'false' && github.event.inputs.publish_ui == 'true'
run: npm publish
env:
# This publish is working using an NPM automation token to bypass 2FA
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
release:
name: release
runs-on: ubuntu-latest
needs: publish-web-ui-npm
env:
GITHUB_TOKEN: ${{ github.event.inputs.token }}
GIT_AUTHOR_NAME: feast-ci-bot
GIT_AUTHOR_EMAIL: [email protected]
GIT_COMMITTER_NAME: feast-ci-bot
GIT_COMMITTER_EMAIL: [email protected]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version-file: './ui/.nvmrc'
- name: Set up Homebrew
id: set-up-homebrew
uses: Homebrew/actions/setup-homebrew@master
- name: Setup Helm-docs
run: |
brew install norwoodj/tap/helm-docs
- name: Release (Dry Run)
if: github.event.inputs.dry_run == 'true'
run: |
npx -p @semantic-release/changelog -p @semantic-release/git -p @semantic-release/exec -p semantic-release semantic-release --dry-run
- name: Release
if: github.event.inputs.dry_run == 'false'
run: |
npx -p @semantic-release/changelog -p @semantic-release/git -p @semantic-release/exec -p semantic-release semantic-release