Skip to content

Create a flyte release #91

Create a flyte release

Create a flyte release #91

name: Create a flyte release
on:
workflow_dispatch:
inputs:
version:
description: "version name. example v0.1.1"
required: true
jobs:
generate-tags:
name: Generate git tags
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- 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/${{ github.event.inputs.version }}`,
sha: context.sha
})
const components = [
"datacatalog",
"flyteadmin",
"flytecopilot",
"flyteidl",
"flyteplugins",
"flytepropeller",
"flytestdlib",
];
for (const c of components) {
github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: `refs/tags/${c}/${{ github.event.inputs.version }}`,
sha: context.sha
})
}
build-docker-images:
needs:
- generate-tags
uses: ./.github/workflows/publish-images.yml
with:
version: ${{ github.event.inputs.version }}
push: true
secrets:
FLYTE_BOT_PAT: ${{ secrets.FLYTE_BOT_PAT }}
FLYTE_BOT_USERNAME: ${{ secrets.FLYTE_BOT_USERNAME }}
publish-flyte-binary-image:
name: Publish flyte binary image for the release version
runs-on: ubuntu-latest
needs:
- generate-tags
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: "0"
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: "${{ secrets.FLYTE_BOT_USERNAME }}"
password: "${{ secrets.FLYTE_BOT_PAT }}"
- name: Tag image to release version
run: |
for release in latest ${{ github.event.inputs.version }}; do
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:
name: Publish flyte component image for the release version
runs-on: ubuntu-latest
needs:
- build-docker-images
strategy:
matrix:
component:
[
datacatalog,
flyteadmin,
flyteagent,
flyteconsole,
flytecopilot,
flytepropeller,
flytescheduler,
]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: "0"
- name: yq - portable yaml processor
uses: mikefarah/[email protected]
- name: Get Latest Version of component
id: set_version
run: |
if [ ${{ matrix.component }} = "flytecopilot" ]; then
echo ::set-output name=version::$(yq eval '.configmap.copilot.plugins.k8s.co-pilot.image' charts/flyte-core/values.yaml | cut -d ":" -f 2 )
elif [ ${{ matrix.component }} = "flyteagent" ]; then
echo ::set-output name=version::$(yq eval '.image.tag' charts/flyteagent/values.yaml)
else
echo ::set-output name=version::$(yq eval '.${{ matrix.component }}.image.tag' charts/flyte-core/values.yaml)
fi
shell: bash
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: "${{ secrets.FLYTE_BOT_USERNAME }}"
password: "${{ secrets.FLYTE_BOT_PAT }}"
- name: Tag Image to release version
run: |
for release in latest ${{ github.event.inputs.version }}; do
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:
name: Flyte helm release
runs-on: ubuntu-latest
needs:
- build-docker-images
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: "0"
- name: Install Helm
uses: azure/setup-helm@v3
with:
version: 'latest' # default is latest (stable)
token: ${{ secrets.GITHUB_TOKEN }} # only needed if version is 'latest'
id: install
- name: Configure Git
run: |
git config user.name "${{ github.actor }}"
git config user.email "${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>"
- name: Prepare Flyte Helm Release
env:
VERSION: ${{ github.event.inputs.version }}
REPOSITORY: "https://flyteorg.github.io/flyte"
run: |
make prepare_artifacts
- name: Run chart-releaser
uses: stefanprodan/[email protected]
with:
token: "${{ secrets.FLYTE_BOT_PAT }}"
linting: off
manifest-release:
name: Flyte manifest release
runs-on: ubuntu-latest
needs:
- build-docker-images
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: "0"
- name: Prepare Flyte Release
env:
VERSION: ${{ github.event.inputs.version }}
run: |
make prepare_artifacts
git stash
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
version: latest
args: release --rm-dist --release-notes=CHANGELOG/CHANGELOG-${{ github.event.inputs.version }}.md
env:
GITHUB_TOKEN: ${{ secrets.FLYTE_BOT_PAT }}