Skip to content

Commit

Permalink
ci: Auto update yarn.lock as part of release (#3059)
Browse files Browse the repository at this point in the history
Signed-off-by: Danny Chiao <danny@tecton.ai>

Signed-off-by: Danny Chiao <danny@tecton.ai>
  • Loading branch information
adchia authored Aug 10, 2022
1 parent 74c75f1 commit e04ad63
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 29 deletions.
27 changes: 1 addition & 26 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ jobs:
publish-python-sdk:
if: github.repository == 'feast-dev/feast'
runs-on: ubuntu-latest
needs: [build_wheels, publish-web-ui-npm]
needs: [build_wheels]
steps:
- uses: actions/download-artifact@v2
with:
Expand Down Expand Up @@ -181,28 +181,3 @@ jobs:
mkdir -p /root/.m2/
echo -n "$MAVEN_SETTINGS" > /root/.m2/settings.xml
infra/scripts/publish-java-sdk.sh --revision ${VERSION_WITHOUT_PREFIX} --gpg-key-import-dir /root
publish-web-ui-npm:
if: github.repository == 'feast-dev/feast'
runs-on: ubuntu-latest
env:
# This publish is working using an NPM automation token to bypass 2FA
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '17.x'
registry-url: 'https://registry.npmjs.org'
- 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
run: npm publish
env:
# This publish is working using an NPM automation token to bypass 2FA
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
58 changes: 58 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,67 @@ on:
type: string

jobs:

get_dry_release_versions:
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@v2
with:
persist-credentials: false
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '16'
- 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}"
publish-web-ui-npm:
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 }}
CURRENT_VERSION: ${{ needs.get_dry_release_versions.outputs.current_version }}
NEXT_VERSION: ${{ needs.get_dry_release_versions.outputs.next_version }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '17.x'
registry-url: 'https://registry.npmjs.org'
- 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
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
Expand Down
7 changes: 4 additions & 3 deletions .releaserc.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ module.exports = {
// Validate the type of release we are doing
"verifyReleaseCmd": "./infra/scripts/validate-release.sh ${nextRelease.type} " + current_branch,

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

["@semantic-release/release-notes-generator", {
Expand All @@ -66,7 +66,8 @@ module.exports = {
"CHANGELOG.md",
"java/pom.xml",
"infra/charts/**/*.*",
"ui/package.json"
"ui/package.json",
"sdk/python/feast/ui/yarn.lock"
],
message: "chore(release): release ${nextRelease.version}\n\n${nextRelease.notes}"
}
Expand Down

0 comments on commit e04ad63

Please sign in to comment.