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 workflow_call: 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.22.9 - name: Build & version operator-specific release files run: make -C infra/feast-operator 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: 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@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: Install Go uses: actions/setup-go@v2 with: go-version: 1.22.9 - name: Compile Go Test Binaries run: | cd infra/feast-operator mkdir -p dist go test -c -o dist/operator-e2e-tests ./test/e2e/ - 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 --github-assets "infra/feast-operator/dist/operator-e2e-tests" update_stable_branch: name: Update Stable Branch after release if: github.event.inputs.dry_run == 'false' runs-on: ubuntu-latest needs: release 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 GITHUB_REPOSITORY: ${{ github.repository }} steps: - name: Checkout code uses: actions/checkout@v4 with: persist-credentials: false - name: Set up Git credentials run: | git config --global user.name "$GIT_AUTHOR_NAME" git config --global user.email "$GIT_AUTHOR_EMAIL" git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY} - name: Fetch all branches run: git fetch --all - name: Reset stable branch to match release branch run: | git checkout -B stable origin/${GITHUB_REF#refs/heads/} git push origin stable --force