Skip to content

Commit a13b974

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

File tree

3 files changed

+62
-29
lines changed

3 files changed

+62
-29
lines changed

.github/workflows/publish.yml

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ jobs:
133133
publish-python-sdk:
134134
if: github.repository == 'feast-dev/feast'
135135
runs-on: ubuntu-latest
136-
needs: [build_wheels, publish-web-ui-npm]
136+
needs: [build_wheels]
137137
steps:
138138
- uses: actions/download-artifact@v2
139139
with:
@@ -181,28 +181,3 @@ jobs:
181181
mkdir -p /root/.m2/
182182
echo -n "$MAVEN_SETTINGS" > /root/.m2/settings.xml
183183
infra/scripts/publish-java-sdk.sh --revision ${VERSION_WITHOUT_PREFIX} --gpg-key-import-dir /root
184-
185-
publish-web-ui-npm:
186-
if: github.repository == 'feast-dev/feast'
187-
runs-on: ubuntu-latest
188-
env:
189-
# This publish is working using an NPM automation token to bypass 2FA
190-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
191-
steps:
192-
- uses: actions/checkout@v2
193-
- uses: actions/setup-node@v2
194-
with:
195-
node-version: '17.x'
196-
registry-url: 'https://registry.npmjs.org'
197-
- name: Install yarn dependencies
198-
working-directory: ./ui
199-
run: yarn install
200-
- name: Build yarn rollup
201-
working-directory: ./ui
202-
run: yarn build:lib
203-
- name: Publish UI package
204-
working-directory: ./ui
205-
run: npm publish
206-
env:
207-
# This publish is working using an NPM automation token to bypass 2FA
208-
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)