Skip to content

Commit b02adc9

Browse files
committed
ci: Auto update yarn.lock as part of release
Signed-off-by: Danny Chiao <[email protected]>
1 parent 67af727 commit b02adc9

File tree

3 files changed

+66
-25
lines changed

3 files changed

+66
-25
lines changed

.github/workflows/publish.yml

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77

88
jobs:
99
get-version:
10+
if: github.repository == 'feast-dev/feast'
1011
runs-on: ubuntu-latest
1112
outputs:
1213
release_version: ${{ steps.get_release_version.outputs.release_version }}
@@ -100,6 +101,7 @@ jobs:
100101
fi
101102
102103
publish-helm-charts:
104+
if: github.repository == 'feast-dev/feast'
103105
runs-on: ubuntu-latest
104106
needs: get-version
105107
env:
@@ -129,8 +131,9 @@ jobs:
129131
uses: ./.github/workflows/build_wheels.yml
130132

131133
publish-python-sdk:
134+
if: github.repository == 'feast-dev/feast'
132135
runs-on: ubuntu-latest
133-
needs: [build_wheels, publish-web-ui-npm]
136+
needs: [build_wheels]
134137
steps:
135138
- uses: actions/download-artifact@v2
136139
with:
@@ -142,6 +145,7 @@ jobs:
142145
password: ${{ secrets.PYPI_PASSWORD }}
143146

144147
publish-java-sdk:
148+
if: github.repository == 'feast-dev/feast'
145149
container: maven:3.6-jdk-11
146150
runs-on: ubuntu-latest
147151
needs: get-version
@@ -177,24 +181,3 @@ jobs:
177181
mkdir -p /root/.m2/
178182
echo -n "$MAVEN_SETTINGS" > /root/.m2/settings.xml
179183
infra/scripts/publish-java-sdk.sh --revision ${VERSION_WITHOUT_PREFIX} --gpg-key-import-dir /root
180-
181-
publish-web-ui-npm:
182-
runs-on: ubuntu-latest
183-
steps:
184-
- uses: actions/checkout@v2
185-
- uses: actions/setup-node@v2
186-
with:
187-
node-version: '17.x'
188-
registry-url: 'https://registry.npmjs.org'
189-
- name: Install yarn dependencies
190-
working-directory: ./ui
191-
run: yarn install
192-
- name: Build yarn rollup
193-
working-directory: ./ui
194-
run: yarn build:lib
195-
- name: Publish UI package
196-
working-directory: ./ui
197-
run: npm publish
198-
env:
199-
# This publish is working using an NPM automation token to bypass 2FA
200-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/release.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,63 @@ on:
1515
type: string
1616

1717
jobs:
18+
19+
get_dry_release_versions:
20+
runs-on: ubuntu-latest
21+
env:
22+
GITHUB_TOKEN: ${{ github.event.inputs.token }}
23+
outputs:
24+
current_version: ${{ steps.get_versions.outputs.current_version }}
25+
next_version: ${{ steps.get_versions.outputs.next_version }}
26+
steps:
27+
- name: Checkout
28+
uses: actions/checkout@v2
29+
with:
30+
persist-credentials: false
31+
- name: Setup Node.js
32+
uses: actions/setup-node@v2
33+
with:
34+
node-version: '16'
35+
- name: Release (Dry Run)
36+
id: get_versions
37+
run: |
38+
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.*//')
39+
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/')
40+
echo ::set-output name=current_version::$CURRENT_VERSION
41+
echo ::set-output name=next_version::$NEXT_VERSION
42+
echo "Current version is ${CURRENT_VERSION}"
43+
echo "Next version is ${NEXT_VERSION}"
44+
45+
publish-web-ui-npm:
46+
if: github.repository == 'feast-dev/feast'
47+
needs: get_dry_release_versions
48+
runs-on: ubuntu-latest
49+
env:
50+
# This publish is working using an NPM automation token to bypass 2FA
51+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
52+
CURRENT_VERSION: ${{ needs.get_dry_release_versions.outputs.current_version }}
53+
NEXT_VERSION: ${{ needs.get_dry_release_versions.outputs.next_version }}
54+
steps:
55+
- uses: actions/checkout@v2
56+
- uses: actions/setup-node@v2
57+
with:
58+
node-version: '17.x'
59+
registry-url: 'https://registry.npmjs.org'
60+
- name: Bump file versions (temporarily for Web UI publish)
61+
run: python ./infra/scripts/release/bump_file_versions.py ${CURRENT_VERSION} ${NEXT_VERSION}
62+
- name: Install yarn dependencies
63+
working-directory: ./ui
64+
run: yarn install
65+
- name: Build yarn rollup
66+
working-directory: ./ui
67+
run: yarn build:lib
68+
- name: Publish UI package
69+
working-directory: ./ui
70+
run: npm publish
71+
env:
72+
# This publish is working using an NPM automation token to bypass 2FA
73+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
74+
1875
release:
1976
name: release
2077
runs-on: ubuntu-latest

.releaserc.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ module.exports = {
4040
// Validate the type of release we are doing
4141
"verifyReleaseCmd": "./infra/scripts/validate-release.sh ${nextRelease.type} " + current_branch,
4242

43-
// Bump all version files
44-
"prepareCmd": "python ./infra/scripts/release/bump_file_versions.py ${lastRelease.version} ${nextRelease.version}"
43+
// Bump all version files and build UI / update yarn.lock
44+
"prepareCmd": "python ./infra/scripts/release/bump_file_versions.py ${lastRelease.version} ${nextRelease.version}; make build-ui"
4545
}],
4646

4747
["@semantic-release/release-notes-generator", {
@@ -66,7 +66,8 @@ module.exports = {
6666
"CHANGELOG.md",
6767
"java/pom.xml",
6868
"infra/charts/**/*.*",
69-
"ui/package.json"
69+
"ui/package.json",
70+
"sdk/python/feast/ui/yarn.lock"
7071
],
7172
message: "chore(release): release ${nextRelease.version}\n\n${nextRelease.notes}"
7273
}

0 commit comments

Comments
 (0)