generated from kyma-project/template-repository
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
split create release pipeline into two workloads
- Loading branch information
Showing
3 changed files
with
93 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
# This workflow is part of the release process and is automatically run when the .github/workflows/create-release.yaml one | ||
# creates a tag because create-release.yaml pushes a new commit to the branch and building jobs can't resolve such a situation. | ||
# Because of this, we run the second part of the process in a separate workflow that has its own context based on the tag created. | ||
|
||
name: create release | ||
|
||
on: | ||
push: | ||
tags-ignore: | ||
- latest | ||
|
||
permissions: # used by build images steps | ||
id-token: write # This is required for requesting the JWT token | ||
contents: write # This is required for actions/checkout and builds | ||
|
||
jobs: | ||
builds: | ||
uses: ./.github/workflows/_build.yaml | ||
with: | ||
tag: "${{ github.ref_name }}" | ||
|
||
create-draft: | ||
name: Create draft release | ||
needs: builds | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- uses: ./.github/actions/setup-go | ||
|
||
- name: Create draft release | ||
id: create-draft | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
RELEASE_ID=$(./.github/scripts/create-draft-release.sh ${{ github.ref_name }}) | ||
echo "release_id=$RELEASE_ID" >> $GITHUB_OUTPUT | ||
- name: Create release assets | ||
id: create-assets | ||
env: | ||
IMG: "europe-docker.pkg.dev/kyma-project/prod/serverless-operator:${{ github.ref_name }}" | ||
PULL_BASE_REF: ${{ github.ref_name }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
RELEASE_ID: ${{ steps.create-draft.outputs.release_id }} | ||
run: ./.github/scripts/release.sh | ||
|
||
outputs: | ||
release_id: ${{ steps.create-draft.outputs.release_id }} | ||
|
||
integrations: | ||
needs: create-draft | ||
secrets: inherit | ||
uses: ./.github/workflows/_integration-tests.yaml | ||
with: | ||
image: europe-docker.pkg.dev/kyma-project/prod/serverless-operator:${{ github.ref_name }} | ||
trigger_btp: true | ||
|
||
publish-release: | ||
name: Publish release | ||
needs: [integrations, create-draft] | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
fetch-tags: true | ||
|
||
- name: Publish release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
latest_release="false" | ||
if test $(git rev-parse latest) == $(git rev-parse ) | ||
./.github/scripts/publish-release.sh ${{ needs.create-draft.outputs.release_id }} ${latest_release} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters