Skip to content

Commit

Permalink
release-without-version-input
Browse files Browse the repository at this point in the history
  • Loading branch information
friedrichwilken committed Jan 15, 2024
1 parent 06f9d6b commit e9e7252
Showing 1 changed file with 22 additions and 25 deletions.
47 changes: 22 additions & 25 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,10 @@ name: "Create release"

on:
workflow_dispatch:
inputs:
name:
description: 'Release name ( e.g. "2.1.3" )'
default: ""
required: true

jobs:
verify-head-status:
name: Verify head (image version and prow job)
verify-release:
name: Verify release
runs-on: ubuntu-latest

steps:
Expand All @@ -19,23 +14,28 @@ jobs:
with:
fetch-depth: 0

- name: Verify that the current branch has a name that starts with 'release-'
- name: Generate version number
id: version
run: |
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
if [[ "$CURRENT_BRANCH" == release-* ]]; then
echo "Branch name starts with 'release-'."
else
echo "Branch name does not start with 'release-'."
exit 1
fi
GET_VERSION=$(mktemp /tmp/get-version-from-branch.sh)
curl -L https://raw.githubusercontent.com/kyma-project/eventing-tools/main/hack/scripts/get-version-from-branch.sh -o "${GET_VERSION}"
chmod +x "${GET_VERSION}"
VERSION="${GET_VERSION}"
echo "::set-output name=version::$version"
- name: Check image Tag
run: ./scripts/check_tag_info.sh ${{ github.event.inputs.name }}
env:
VERSION: ${{ steps.gen-version.outputs.VERSION }}
run: ./scripts/check_tag_info.sh $VERSION

create-draft:
name: Create draft release
needs: verify-head-status
runs-on: ubuntu-latest
env:
VERSION: ${{ needs.verify-release.outputs.VERSION }}
outputs:
release_id: ${{ steps.create-draft.outputs.release_id }}

steps:
- name: Checkout code
Expand All @@ -46,37 +46,34 @@ jobs:
- name: Create changelog
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./scripts/create_changelog.sh ${{ github.event.inputs.name }}
run: ./scripts/create_changelog.sh $VERSION

- name: Create draft release
id: create-draft
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
RELEASE_ID=$(./scripts/create_draft_release.sh ${{ github.event.inputs.name }})
RELEASE_ID=$(./scripts/create_draft_release.sh $VERSION
echo "release_id=$RELEASE_ID" >> $GITHUB_OUTPUT
- name: Create lightweight tag
run: |
git tag ${{ github.event.inputs.name }}
git push origin ${{ github.event.inputs.name }}
git tag $VERSION
git push origin $VERSION
- name: Verify job status
run: ./scripts/verify-status.sh ${{ github.ref_name }} 600 10 30

- name: Create and upload eventing-manager.yaml and eventing-default-cr.yaml
env:
PULL_BASE_REF: ${{ github.event.inputs.name }}
PULL_BASE_REF: $VERSION
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
IMG: "europe-docker.pkg.dev/kyma-project/prod/eventing-manager:${{ github.event.inputs.name }}"
IMG: "europe-docker.pkg.dev/kyma-project/prod/eventing-manager:${VERSION}"
MODULE_REGISTRY: "europe-docker.pkg.dev/kyma-project/prod/unsigned"
KUSTOMIZE_VERSION: "v4.5.6"
run: |
./scripts/render_and_upload_manifests.sh
outputs:
release_id: ${{ steps.create-draft.outputs.release_id }}

publish-release:
name: Publish release
needs: [verify-head-status, create-draft]
Expand Down

0 comments on commit e9e7252

Please sign in to comment.