Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add bump git tags workflow #4074

Merged
merged 5 commits into from
Sep 26, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions .github/workflows/bump-tags.yml
Original file line number Diff line number Diff line change
@@ -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
})
}
66 changes: 34 additions & 32 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,15 +117,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
Expand All @@ -135,27 +140,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 }}
8 changes: 4 additions & 4 deletions .github/workflows/create_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand All @@ -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"
Expand All @@ -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: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/helm-charts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Loading