release_new_version.md 2.7 KB

Release a new version

Playbooks

Update Docker image tag

  1. Pull down images and create a manifest:

    $ 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.

Compile and pack binaries

All commands are starting at the repository root.

  • macOS:

    # Produce the ZIP archive
    $ TAGS=cert task release
    
  • Linux:

    # 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:

    # 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:

    # 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:

    $ TAGS=cert task release
    $ TAGS="cert minwinsvc" task release