Skip to content

Commit

Permalink
Release Automation: Generate version of website to push (googleforgam…
Browse files Browse the repository at this point in the history
  • Loading branch information
mangalpalli authored and chiayi committed Dec 13, 2022
1 parent 38fa171 commit 1473d31
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 4 deletions.
9 changes: 9 additions & 0 deletions build/includes/release.mk
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,15 @@ example-image-markdown.%:
tag=$$(make -silent echo-image-tag) && \
echo "- [$$tag](https://$$tag)"


# Deploys the site by taking in the base version and deploying the previous version
release-deploy-site: $(ensure-build-image)
release-deploy-site: DOCKER_RUN_ARGS += -e GOFLAGS="-mod=mod" --entrypoint=/usr/local/go/bin/go
release-deploy-site:
version=$$($(DOCKER_RUN) run $(mount_path)/build/scripts/previousversion/main.go -version $(base_version)) && \
echo "Deploying Site Version: $$version" && \
$(MAKE) site-deploy SERVICE=$$version

# Creates a release. Version defaults to the base_version
# - Checks out a release branch
# - Build binaries and images
Expand Down
5 changes: 5 additions & 0 deletions build/scripts/previousversion/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module github.com/agones/agones/build/scripts/previousversion

go 1.19

require github.com/blang/semver/v4 v4.0.0
2 changes: 2 additions & 0 deletions build/scripts/previousversion/go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM=
github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ=
30 changes: 30 additions & 0 deletions build/scripts/previousversion/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// Copyright 2017 Google LLC All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package main

import (
"flag"
"fmt"

semver "github.com/blang/semver/v4"
)

func main() {
baseVersion := flag.String("version", "", "the base version to be taken in as input for release")
flag.Parse()
v, _ := semver.Parse(*baseVersion)
releaseVersion := fmt.Sprintf("%d-%d-%d", v.Major, v.Minor-1, v.Patch)
fmt.Println(releaseVersion)
}
7 changes: 3 additions & 4 deletions docs/governance/templates/release_issue.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,9 @@ and copy it into a release issue. Fill in relevant values, found inside {}
- [ ] Any issues in the current milestone that are not closed, move to next milestone.
- [ ] If release candidate add the label `feature-freeze-do-not-merge` to any feature pull requests.
- [ ] `git checkout main && git pull --rebase upstream main`
- [ ] If full release, run `make site-deploy SERVICE={version}-1`, (replace . with -)
- For example, if you are creating the 1.18.0 release, then you would deploy the 1-17-0 service (release minus one, and then replace dots with dashes).
- [ ] Run `make gen-changelog` to generate the CHANGELOG.md (if release candidate
`make gen-changelog RELEASE_VERSION={version}-rc`). You will need your
- [ ] If full release, run `make release-deploy-site`
- [ ] Run `make gen-changelog` to generate the CHANGELOG.md (if release candidate
`make gen-changelog RELEASE_VERSION={version}-rc`). You will need your
[GitHub Personal Access Token](https://github.com/settings/tokens) for this.
- [ ] Ensure the [helm `tag` value][values] is correct (should be {version} if a full release, {version}-rc if release candidate)
- [ ] Ensure the [helm `Chart` version values][chart] are correct (should be {version} if a full release, {version}-rc if release candidate)
Expand Down

0 comments on commit 1473d31

Please sign in to comment.