Skip to content

fix(actions): add instruction and fix workflow trigger condition #788

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/create-release-draft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@ name: Create release draft
on:
workflow_dispatch:
pull_request:
types:
- closed
branches:
- 'release-*'

jobs:
create-draft:
if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'release')
name: Create release draft
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -35,6 +38,7 @@ jobs:
run: |
gh release create "v${{ steps.version.outputs.version }}" \
--title "v${{ steps.version.outputs.version }}" \
--target "${{ github.base_ref }}" \
--generate-notes \
--draft \
dist/release/*
10 changes: 9 additions & 1 deletion hack/create-release-pr.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
#!/bin/bash

### This script creates a new release PR
# - install gh cli and semver-cli (go install github.com/davidrjonas/semver-cli@latest)
# - create and push "release-X.Y" branch
# - checkout this branch locally
# - run this script from repo root: ./hack/create-release-pr.sh
# - merge the PR
# It will trigger the release workflow that would create release draft on github

RELEASE_BRANCH="$(git rev-parse --abbrev-ref HEAD || true)"
set -eux
set -o pipefail
Expand All @@ -20,7 +28,7 @@ make manifests

git checkout -b "feat/new-version-${NEW_VERSION}"
git commit -m "Release ${NEW_VERSION}" VERSION manifests/
git push
git push --set-upstream origin "feat/new-version-${NEW_VERSION}"
gh label --repo $(git remote get-url origin) create --force release
gh pr --repo $(git remote get-url origin) \
create \
Expand Down