|
| 1 | +# This workflow is triggered manually and only releases the v1 flyte package. |
| 2 | +name: Create a flyte release |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + inputs: |
| 6 | + version: |
| 7 | + description: "version name. example v0.1.1, v1.16.0-b0" |
| 8 | + required: true |
| 9 | + |
| 10 | +jobs: |
| 11 | + generate-tags: |
| 12 | + name: Generate git tags |
| 13 | + runs-on: ubuntu-latest |
| 14 | + steps: |
| 15 | + - uses: actions/checkout@v4 |
| 16 | + with: |
| 17 | + fetch-depth: '0' |
| 18 | + - uses: actions/github-script@v6 |
| 19 | + with: |
| 20 | + github-token: ${{ secrets.FLYTE_BOT_PAT }} |
| 21 | + script: | |
| 22 | + github.rest.git.createRef({ |
| 23 | + owner: context.repo.owner, |
| 24 | + repo: context.repo.repo, |
| 25 | + ref: `refs/tags/${{ github.event.inputs.version }}`, |
| 26 | + sha: context.sha |
| 27 | + }) |
| 28 | + const components = [ |
| 29 | + "datacatalog", |
| 30 | + "flyteadmin", |
| 31 | + "flytecopilot", |
| 32 | + "flyteplugins", |
| 33 | + "flytepropeller", |
| 34 | + "flytestdlib", |
| 35 | + ]; |
| 36 | + for (const c of components) { |
| 37 | + github.rest.git.createRef({ |
| 38 | + owner: context.repo.owner, |
| 39 | + repo: context.repo.repo, |
| 40 | + ref: `refs/tags/${c}/${{ github.event.inputs.version }}`, |
| 41 | + sha: context.sha |
| 42 | + }) |
| 43 | + } |
| 44 | +
|
| 45 | + build-docker-images: |
| 46 | + needs: |
| 47 | + - generate-tags |
| 48 | + uses: ./.github/workflows/publish-images.yml |
| 49 | + with: |
| 50 | + version: ${{ github.event.inputs.version }} |
| 51 | + push: true |
| 52 | + secrets: |
| 53 | + FLYTE_BOT_PAT: ${{ secrets.FLYTE_BOT_PAT }} |
| 54 | + FLYTE_BOT_USERNAME: ${{ secrets.FLYTE_BOT_USERNAME }} |
| 55 | + |
| 56 | + publish-flyte-binary-image: |
| 57 | + name: Publish flyte binary image for the release version |
| 58 | + runs-on: ubuntu-latest |
| 59 | + needs: |
| 60 | + - generate-tags |
| 61 | + steps: |
| 62 | + - name: Checkout |
| 63 | + uses: actions/checkout@v4 |
| 64 | + with: |
| 65 | + fetch-depth: "0" |
| 66 | + |
| 67 | + - name: Login to GitHub Container Registry |
| 68 | + uses: docker/login-action@v1 |
| 69 | + with: |
| 70 | + registry: ghcr.io |
| 71 | + username: "${{ secrets.FLYTE_BOT_USERNAME }}" |
| 72 | + password: "${{ secrets.FLYTE_BOT_PAT }}" |
| 73 | + |
| 74 | + - name: Tag image to release version |
| 75 | + run: | |
| 76 | + for release in latest ${{ github.event.inputs.version }}; do |
| 77 | + docker buildx imagetools create --tag "ghcr.io/${{ github.repository_owner }}/flyte-binary-release:${release}" "ghcr.io/${{ github.repository_owner }}/flyte-binary:sha-${{ github.sha }}" |
| 78 | + done |
| 79 | +
|
| 80 | + publish-flyte-component-image: |
| 81 | + name: Publish flyte component image for the release version |
| 82 | + runs-on: ubuntu-latest |
| 83 | + needs: |
| 84 | + - build-docker-images |
| 85 | + strategy: |
| 86 | + matrix: |
| 87 | + component: |
| 88 | + [ |
| 89 | + datacatalog, |
| 90 | + flyteadmin, |
| 91 | + flyteagent, |
| 92 | + flyteconsole, |
| 93 | + flytecopilot, |
| 94 | + flytepropeller, |
| 95 | + flytescheduler, |
| 96 | + ] |
| 97 | + steps: |
| 98 | + - name: Checkout |
| 99 | + uses: actions/checkout@v4 |
| 100 | + with: |
| 101 | + fetch-depth: "0" |
| 102 | + |
| 103 | + - name: yq - portable yaml processor |
| 104 | + uses: mikefarah/yq@v4.15.1 |
| 105 | + |
| 106 | + - name: Get Latest Version of component |
| 107 | + id: set_version |
| 108 | + run: | |
| 109 | + if [ ${{ matrix.component }} = "flytecopilot" ]; then |
| 110 | + echo ::set-output name=version::$(yq eval '.configmap.copilot.plugins.k8s.co-pilot.image' charts/flyte-core/values.yaml | cut -d ":" -f 2 ) |
| 111 | + elif [ ${{ matrix.component }} = "flyteagent" ]; then |
| 112 | + echo ::set-output name=version::$(yq eval '.image.tag' charts/flyteconnector/values.yaml) |
| 113 | + else |
| 114 | + echo ::set-output name=version::$(yq eval '.${{ matrix.component }}.image.tag' charts/flyte-core/values.yaml) |
| 115 | + fi |
| 116 | + shell: bash |
| 117 | + |
| 118 | + - name: Login to GitHub Container Registry |
| 119 | + uses: docker/login-action@v1 |
| 120 | + with: |
| 121 | + registry: ghcr.io |
| 122 | + username: "${{ secrets.FLYTE_BOT_USERNAME }}" |
| 123 | + password: "${{ secrets.FLYTE_BOT_PAT }}" |
| 124 | + |
| 125 | + - name: Tag Image to release version |
| 126 | + run: | |
| 127 | + for release in latest ${{ github.event.inputs.version }}; do |
| 128 | + 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 }}" |
| 129 | + done |
| 130 | +
|
| 131 | + helm-release: |
| 132 | + name: Flyte helm release |
| 133 | + runs-on: ubuntu-latest |
| 134 | + needs: |
| 135 | + - build-docker-images |
| 136 | + steps: |
| 137 | + - name: Checkout |
| 138 | + uses: actions/checkout@v4 |
| 139 | + with: |
| 140 | + fetch-depth: "0" |
| 141 | + |
| 142 | + - name: Install Helm |
| 143 | + uses: azure/setup-helm@v3 |
| 144 | + with: |
| 145 | + version: 'latest' # default is latest (stable) |
| 146 | + token: ${{ secrets.GITHUB_TOKEN }} # only needed if version is 'latest' |
| 147 | + id: install |
| 148 | + - name: Configure Git |
| 149 | + run: | |
| 150 | + git config user.name "${{ github.actor }}" |
| 151 | + git config user.email "${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>" |
| 152 | + - name: Prepare Flyte Helm Release |
| 153 | + env: |
| 154 | + VERSION: ${{ github.event.inputs.version }} |
| 155 | + REPOSITORY: "https://flyteorg.github.io/flyte" |
| 156 | + run: | |
| 157 | + make prepare_artifacts |
| 158 | + - name: Run chart-releaser |
| 159 | + uses: stefanprodan/helm-gh-pages@v1.4.1 |
| 160 | + with: |
| 161 | + token: "${{ secrets.FLYTE_BOT_PAT }}" |
| 162 | + linting: off |
| 163 | + |
| 164 | + manifest-release: |
| 165 | + name: Flyte manifest release |
| 166 | + runs-on: ubuntu-latest |
| 167 | + needs: |
| 168 | + - build-docker-images |
| 169 | + steps: |
| 170 | + - name: Checkout |
| 171 | + uses: actions/checkout@v4 |
| 172 | + with: |
| 173 | + fetch-depth: "0" |
| 174 | + |
| 175 | + - name: Prepare Flyte Release |
| 176 | + env: |
| 177 | + VERSION: ${{ github.event.inputs.version }} |
| 178 | + run: | |
| 179 | + make prepare_artifacts |
| 180 | + git stash |
| 181 | +
|
| 182 | + - name: Run GoReleaser |
| 183 | + uses: goreleaser/goreleaser-action@v6.3.0 |
| 184 | + with: |
| 185 | + version: latest |
| 186 | + args: release --release-notes=CHANGELOG/CHANGELOG-${{ github.event.inputs.version }}.md |
| 187 | + env: |
| 188 | + GITHUB_TOKEN: ${{ secrets.FLYTE_BOT_PAT }} |
0 commit comments