Skip to content

Commit

Permalink
feat: support new release process
Browse files Browse the repository at this point in the history
  • Loading branch information
pasha-codefresh committed Dec 6, 2023
1 parent c4af25d commit c79b7d5
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
# Target branch is the release branch we're going to operate on
# Its name is 'release-<major>.<minor>'
TARGET_BRANCH=$(echo "$TARGET_VERSION" | grep -oE '^[0-9]+\.[0-9]+')
TARGET_BRANCH=release-$(echo "$TARGET_VERSION" | grep -oE '^[0-9]+\.[0-9]+')
# The release tag is the source tag, minus the release- prefix
RELEASE_TAG="${SOURCE_TAG#*release-}"
# Whether this is a pre-release (indicated by -rc suffix)
Expand Down
25 changes: 25 additions & 0 deletions hack/release/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,3 +130,28 @@ func release() error {
}
return exec.Command("git", "push", "origin", "--delete", release).Run()
}

func commitChanges(version string) error {

Check failure on line 134 in hack/release/main.go

View workflow job for this annotation

GitHub Actions / Lint Go code

`commitChanges` is unused (deadcode)
// git add VERSION
cmd := exec.Command("git", "add", "VERSION")
if err := cmd.Run(); err != nil {
return err
}

cmd = exec.Command("git", "add", fmt.Sprintf("changelog/CHANGELOG-%s.md", version))
if err := cmd.Run(); err != nil {
return err
}

cmd = exec.Command("git", "commit", fmt.Sprintf("chore: update version to %s", version))
if err := cmd.Run(); err != nil {
return err
}

cmd = exec.Command("git", "push")
if err := cmd.Run(); err != nil {
return err
}

return nil
}

0 comments on commit c79b7d5

Please sign in to comment.