release #295
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: | |
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@v3 | |
with: | |
persist-credentials: false | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18.x' | |
registry-url: 'https://registry.npmjs.org' | |
- 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@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: '18.x' | |
registry-url: 'https://registry.npmjs.org' | |
- 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 | |
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@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: '18.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 | |
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: feast-ci-bot@willem.co | |
GIT_COMMITTER_NAME: feast-ci-bot | |
GIT_COMMITTER_EMAIL: feast-ci-bot@willem.co | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
persist-credentials: false | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18.x' | |
registry-url: 'https://registry.npmjs.org' | |
- 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 |