diff --git a/.github/workflows/bump-tags.yml b/.github/workflows/bump-tags.yml new file mode 100644 index 0000000000..fe1c432be6 --- /dev/null +++ b/.github/workflows/bump-tags.yml @@ -0,0 +1,57 @@ +name: Bump git tags + +on: + workflow_call: + outputs: + next_version: + description: "Tag name" + value: ${{ jobs.bump_version.outputs.next_version }} + secrets: + FLYTE_BOT_PAT: + required: true +jobs: + bump_version: + name: Bump Version + runs-on: ubuntu-latest + outputs: + next_version: ${{ steps.get_semver.outputs.next_version }} + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: '0' + # Bump patch version + - uses: rickstaa/action-get-semver@v1 + id: get_semver + with: + bump_level: "patch" + - name: Print current and next versions + run: | + echo "Current version: ${{ steps.get_semver.outputs.current_version }}" + echo "Next version: ${{ steps.get_semver.outputs.next_version }}" + # Generate all tags for all components + - uses: actions/github-script@v6 + with: + github-token: ${{ secrets.FLYTE_BOT_PAT }} + script: | + github.rest.git.createRef({ + owner: context.repo.owner, + repo: context.repo.repo, + ref: `refs/tags/${{ steps.get_semver.outputs.next_version }}`, + sha: context.sha + }) + const components = [ + "datacatalog", + "flyteadmin", + "flytecopilot", + "flyteplugins", + "flytepropeller", + "flytestdlib", + ]; + for (const c of components) { + github.rest.git.createRef({ + owner: context.repo.owner, + repo: context.repo.repo, + ref: `refs/tags/${c}/${{ steps.get_semver.outputs.next_version }}`, + sha: context.sha + }) + } diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index bdae826546..66e2bf3c0e 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -2,9 +2,25 @@ name: Components Checks on: pull_request: + paths: + - 'datacatalog/**' + - 'flyteadmin/**' + - 'flytecopilot/**' + - 'flyteidl/**' + - 'flyteplugins/**' + - 'flytepropeller/**' + - 'flytestdlib/**' push: branches: - master + paths: + - 'datacatalog/**' + - 'flyteadmin/**' + - 'flytecopilot/**' + - 'flyteidl/**' + - 'flyteplugins/**' + - 'flytepropeller/**' + - 'flytestdlib/**' env: GO_VERSION: "1.19" PRIORITIES: "P0" @@ -117,15 +133,20 @@ jobs: component: ${{ matrix.component }} go-version: ${{ needs.unpack-envvars.outputs.go-version }} - # TODO(monorepo): enable bump_version - # bump_version: - # name: Bump Version - # if: ${{ github.event_name != 'pull_request' }} - # needs: [ endtoend, integration, lint, tests, generate ] # Only to ensure it can successfully build - # uses: flyteorg/flytetools/.github/workflows/bump_version.yml@master - # secrets: - # FLYTE_BOT_PAT: ${{ secrets.FLYTE_BOT_PAT }} + bump-tags: + name: Bump git tags + # TODO(monorepo): skip this if author is flyte-bot? + if: ${{ github.event_name != 'pull_request' }} + needs: + - integration + - lint + - unit-tests + - generate + uses: ./.github/workflows/bump-tags.yml + secrets: + FLYTE_BOT_PAT: ${{ secrets.FLYTE_BOT_PAT }} + # TODO(monorepo): we are not going to release any binary # goreleaser: # name: Goreleaser # needs: [ bump_version ] # Only to ensure it can successfully build @@ -135,27 +156,24 @@ jobs: # secrets: # FLYTE_BOT_PAT: ${{ secrets.FLYTE_BOT_PAT }} - # push_docker_image: - # name: Build & Push Image - # # TODO(monorepo): depend on bump_version - # # needs: [ bump_version ] - # strategy: - # fail-fast: false - # matrix: - # component: - # - datacatalog - # - flyteadmin - # - flytecopilot - # - flytepropeller - # - flytescheduler - # uses: ./.github/workflows/publish.yml - # with: - # version: "test-version-monorepo" - # component: ${{ matrix.component }} - # dockerfile: Dockerfile.${{ matrix.component }} - # # TODO(monorepo): set push to true once we depend on bump_version - # # push: true - # push: false - # secrets: - # FLYTE_BOT_PAT: ${{ secrets.FLYTE_BOT_PAT }} - # FLYTE_BOT_USERNAME: ${{ secrets.FLYTE_BOT_USERNAME }} + push_docker_image: + name: Build & Push Image + needs: [ bump-tags ] + strategy: + fail-fast: false + matrix: + component: + - datacatalog + - flyteadmin + - flytecopilot + - flytepropeller + - flytescheduler + uses: ./.github/workflows/publish.yml + with: + version: ${{ needs.bump-tags.outputs.next_version }} + component: ${{ matrix.component }} + dockerfile: Dockerfile.${{ matrix.component }} + push: true + secrets: + FLYTE_BOT_PAT: ${{ secrets.FLYTE_BOT_PAT }} + FLYTE_BOT_USERNAME: ${{ secrets.FLYTE_BOT_USERNAME }} diff --git a/.github/workflows/create_release.yml b/.github/workflows/create_release.yml index 2f29edc3dd..9f807887c2 100644 --- a/.github/workflows/create_release.yml +++ b/.github/workflows/create_release.yml @@ -46,7 +46,7 @@ jobs: - name: Tag image to release version run: | for release in latest ${{ needs.bump-version.outputs.version }}; do - docker buildx imagetools create --tag "ghcr.io/flyteorg/flyte-binary-release:${release}" "ghcr.io/flyteorg/flyte-binary:sha-${{ github.sha }}" + docker buildx imagetools create --tag "ghcr.io/${{ github.repository_owner }}/flyte-binary-release:${release}" "ghcr.io/${{ github.repository_owner }}/flyte-binary:sha-${{ github.sha }}" done publish-flyte-component-image: @@ -93,7 +93,7 @@ jobs: - name: Tag Image to release version run: | for release in latest ${{ needs.bump-version.outputs.version }}; do - docker buildx imagetools create --tag "ghcr.io/flyteorg/${{ matrix.component }}-release:${release}" "ghcr.io/flyteorg/${{ matrix.component }}:${{ steps.set_version.outputs.version }}" + docker buildx imagetools create --tag "ghcr.io/${{ github.repository_owner }}/${{ matrix.component }}-release:${release}" "ghcr.io/${{ github.repository_owner }}/${{ matrix.component }}:${{ steps.set_version.outputs.version }}" done helm-release: @@ -116,7 +116,7 @@ jobs: run: | git config user.name "${{ github.actor }}" git config user.email "${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>" - - name: Preprare Flyte Helm Release + - name: Prepare Flyte Helm Release env: VERSION: ${{ needs.bump-version.outputs.version }} REPOSITORY: "https://flyteorg.github.io/flyte" @@ -138,7 +138,7 @@ jobs: with: fetch-depth: "0" - - name: Preprare Flyte Release + - name: Prepare Flyte Release env: VERSION: ${{ needs.bump-version.outputs.version }} run: | diff --git a/.github/workflows/helm-charts.yaml b/.github/workflows/helm-charts.yaml index 016280b533..6c9264e58e 100644 --- a/.github/workflows/helm-charts.yaml +++ b/.github/workflows/helm-charts.yaml @@ -45,4 +45,4 @@ jobs: working-directory: charts if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }} run: - helm push ${{ matrix.chart }}-*.tgz oci://ghcr.io/flyteorg/helm-charts + helm push ${{ matrix.chart }}-*.tgz oci://ghcr.io/${{ github.repository_owner }}/helm-charts diff --git a/datacatalog/pull_request_template.md b/datacatalog/pull_request_template.md index 9cdab99b46..0907563271 100644 --- a/datacatalog/pull_request_template.md +++ b/datacatalog/pull_request_template.md @@ -1,5 +1,6 @@ ## _Read then delete this section_ + _- Make sure to use a concise title for the pull-request._ _- Use #patch, #minor or #major in the pull-request title to bump the corresponding version. Otherwise, the patch version