summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Pope <alan.pope@canonical.com>2020-07-17 18:27:00 +0100
committerGitHub <noreply@github.com>2020-07-17 13:27:00 -0400
commitb609a25014cf732ec444c132dc9fb892818281dc (patch)
treeb03922e8f184a4344eda8cf8655228d20d23f508
parent0e24af6951fa65d5094ab6da0f182697aab2a6f0 (diff)
downloadgitea-b609a25014cf732ec444c132dc9fb892818281dc.tar.gz
gitea-b609a25014cf732ec444c132dc9fb892818281dc.zip
Add logic to build stable and edge builds (#12052)
This adds some logic to enable the snapcraft builds of the gitea snap to create both builds of the latest tip of master for edge channels, and stable releases. The logic simply looks for a new upstream release in github, and if that latest tagged release is not the same as the release in the candidate channel in the snap store, then it must be new, and so we checkout that tag and build that. If the current released tag is the same as what's in candidate, we build whatever is in git master. The process for using this is: Initially: When this lands, it will build the latest stable release of gitea and push to the edge channel in the snap store. Someone on the release team can go to https://snapcraft.io/gitea/releases and release that build to stable and candidate. Ongoing: The next build to be triggered will be a git master build, and can just sit in edge, nothing for the release team to do. On new release: The next build triggered will contain the stable release, and will be published to edge. Someone on the release team can login to the above URL and release that again to stable & candidate. Alternatively they can release to candidate, do some additional testing on that release before releasing to stable. Hope that all makes sense. Questions / comments welcome. I'm super keen to see stable releases of Gitea in the stable channel of the Snap Store. I'd like to promote it but I can't really until it's in stable. Co-authored-by: techknowlogick <techknowlogick@gitea.io>
-rw-r--r--snap/snapcraft.yaml9
1 files changed, 9 insertions, 0 deletions
diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml
index 29a4d28d16..dd2d98a391 100644
--- a/snap/snapcraft.yaml
+++ b/snap/snapcraft.yaml
@@ -48,6 +48,15 @@ parts:
- LDFLAGS: ""
override-pull: |
snapcraftctl pull
+
+ last_committed_tag="$(git for-each-ref --sort=taggerdate --format '%(tag)' refs/tags | tail -n 1)"
+ last_released_tag="$(snap info gitea | awk '$1 == "latest/candidate:" { print $2 }')"
+ # If the latest tag from the upstream project has not been released to
+ # stable, build that tag instead of master.
+ if [ "${last_committed_tag}" != "${last_released_tag}" ]; then
+ git fetch
+ git checkout "${last_committed_tag}"
+ fi
version="$(git describe --always | sed -e 's/-/+git/;y/-/./')"
[ -n "$(echo $version | grep "+git")" ] && grade=devel || grade=stable