diff options
author | Joe Chen <jc@unknwon.io> | 2022-01-18 11:58:09 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-18 11:58:09 +0800 |
commit | 2071eb634f33bb160ba86f79b2de06f122971279 (patch) | |
tree | 77e148a11aa9f49d873993fece08f784f0dd00fe /docs/dev | |
parent | e6c5633f580399c8f4dfc07166a63a01c6c70346 (diff) |
docs: update release templates and playbook (#6735)
[skip ci]
Diffstat (limited to 'docs/dev')
-rw-r--r-- | docs/dev/release/release_new_version.md | 81 | ||||
-rw-r--r-- | docs/dev/release/sha256.sh | 9 | ||||
-rw-r--r-- | docs/dev/release_new_version.md | 9 |
3 files changed, 90 insertions, 9 deletions
diff --git a/docs/dev/release/release_new_version.md b/docs/dev/release/release_new_version.md new file mode 100644 index 00000000..cb1a33e0 --- /dev/null +++ b/docs/dev/release/release_new_version.md @@ -0,0 +1,81 @@ +# Release a new version + +- To release a new minor version, use the GitHub issue template [Dev: Release a minor version](https://github.com/gogs/gogs/issues/new?title=Release+<MAJOR>.<MINOR>.0&labels=%F0%9F%93%B8%20release&template=dev_release_minor_version.md). +- To release a new patch version, use the GitHub issue template [Dev: Release a patch version](https://github.com/gogs/gogs/issues/new?title=Release+<MAJOR>.<MINOR>.<PATCH>&labels=%F0%9F%93%B8%20release&template=dev_release_patch_version.md). + +## Playbooks + +### Update Docker image tag + +1. Pull down images and create a manifest: + ```sh + $ export VERSION=0.12.4 + $ export MINOR_RELEASE=0.12 + + $ docker pull --platform linux/amd64 gogs/gogs:${VERSION} + $ docker tag gogs/gogs:${VERSION} gogs/gogs:${MINOR_RELEASE}-amd64 + $ docker push gogs/gogs:${MINOR_RELEASE}-amd64 + $ docker pull --platform linux/arm64 gogs/gogs:${VERSION} + $ docker tag gogs/gogs:${VERSION} gogs/gogs:${MINOR_RELEASE}-arm64 + $ docker push gogs/gogs:${MINOR_RELEASE}-arm64 + $ docker pull --platform linux/arm/v7 gogs/gogs:${VERSION} + $ docker tag gogs/gogs:${VERSION} gogs/gogs:${MINOR_RELEASE}-armv7 + $ docker push gogs/gogs:${MINOR_RELEASE}-armv7 + + $ docker manifest create \ + gogs/gogs:${MINOR_RELEASE} \ + --amend gogs/gogs:${MINOR_RELEASE}-amd64 \ + --amend gogs/gogs:${MINOR_RELEASE}-arm64 \ + --amend gogs/gogs:${MINOR_RELEASE}-armv7 + $ docker manifest push gogs/gogs:${MINOR_RELEASE} + + # Only push "linux/amd64" for now + $ echo ${GITHUB_CR_PAT} | docker login ghcr.io -u <USERNAME> --password-stdin + $ docker pull --platform linux/amd64 gogs/gogs:${VERSION} + $ docker tag gogs/gogs:${VERSION} ghcr.io/gogs/gogs:${MINOR_RELEASE} + $ docker push ghcr.io/gogs/gogs:${MINOR_RELEASE} + ``` +2. Delete ephemeral tags from the [Docker Hub](https://hub.docker.com/repository/docker/gogs/gogs/tags). + +### Compile and pack binaries + +All commands are starting at the repository root. + +- macOS: + ```sh + # Produce the ZIP archive + $ TAGS=cert task release + ``` +- Linux: + ```sh + # Produce the ZIP archive + $ TAGS="cert pam" task release + + # Produce the Tarball + $ export VERSION=0.12.4 + $ cd release && tar czf gogs_${VERSION}_linux_$(go env GOARCH).tar.gz gogs + ``` +- ARMv7: + ```sh + # Extract the binary from the Docker image + $ docker pull --platform linux/arm/v7 gogs/gogs:${VERSION} + $ docker run \ + --platform linux/arm/v7 \ + -v ${PWD}:/opt/mount/ \ + gogs/gogs:${VERSION} \ + bash -c "cp /app/gogs/gogs /opt/mount/" + ``` +- ARMv8: + ```sh + # Produce the ZIP archive + $ TAGS="cert pam" task release + + # Produce the Tarball + $ export VERSION=0.12.4 + $ cd release && tar czf gogs_${VERSION}_linux_armv8.tar.gz gogs + ``` +- Windows: + ```sh + $ TAGS=cert task release + $ TAGS="cert minwinsvc" task release + ``` diff --git a/docs/dev/release/sha256.sh b/docs/dev/release/sha256.sh new file mode 100644 index 00000000..700ffdb4 --- /dev/null +++ b/docs/dev/release/sha256.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +cd gogs || exit # "gogs" is the directory that stores all release archives +for file in * +do + if [ -f "$file" ]; then + shasum -a 256 "$file" >> checksum_sha256.txt + fi +done diff --git a/docs/dev/release_new_version.md b/docs/dev/release_new_version.md deleted file mode 100644 index 63b212c1..00000000 --- a/docs/dev/release_new_version.md +++ /dev/null @@ -1,9 +0,0 @@ -# Release a new version - -## Release a minor version - -To release a new minor version, use the GitHub issue template [Dev: Release a minor version](https://github.com/gogs/gogs/issues/new?title=Release+<MAJOR>.<MINOR>.0&labels=%F0%9F%93%B8%20release&template=dev_release_minor_version.md). - -## Release a patch version - -To release a new patch version, use the GitHub issue template [Dev: Release a patch version](https://github.com/gogs/gogs/issues/new?title=Release+<MAJOR>.<MINOR>.<PATCH>&labels=%F0%9F%93%B8%20release&template=dev_release_patch_version.md). |