Create release #45
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
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) | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Verify that the current branch has a name that starts with 'release-' | |
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 | |
- name: Check image Tag | |
run: ./scripts/check_tag_info.sh ${{ github.event.inputs.name }} | |
- name: Verify prow post jobs | |
run: ./scripts/verify-status.sh ${{ github.ref_name }} | |
# run-unit-tests: | |
# name: Unit tests | |
# needs: verify-head-status | |
# uses: "./.github/workflows/run-unit-tests.yaml" | |
create-draft: | |
name: Create draft release | |
needs: verify-head-status | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Create changelog | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: ./scripts/create_changelog.sh ${{ github.event.inputs.name }} | |
- 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 }}) | |
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 }} | |
- name: Verify prow post jobs | |
run: ./scripts/verify-status.sh ${{ github.ref_name }} | |
outputs: | |
release_id: ${{ steps.create-draft.outputs.release_id }} | |
# devOps-Insights: | |
# name: DevOps Insights | |
# needs: [verify-head-status, create-draft, run-unit-tests] | |
# uses: "./.github/workflows/metrics.yaml" | |
publish-release: | |
name: Publish release | |
needs: [verify-head-status, create-draft] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Publish release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: ./scripts/publish_release.sh ${{ needs.create-draft.outputs.release_id }} |