This tool automates some aspects of releasing a new version of Stack. It currently handles some tasks that need to be performed on each platform: building the release, running some pre-release checks, and uploading binaries to a Github release.
See Checklist of additional manual release steps.
These must be installed in the PATH to use the release tool:
- stack
- git (for Windows, msysgit is recommended).
To create a signed binary package, you need:
- GPG installed and in the PATH (included with msysgit on Windows)
dev@fpcomplete.comsecret key in GPG keyring. You may also use the environment variableSTACK_RELEASE_GPG_KEY, which should be set to the hexadecimal (0xLONG) identifier of the GPG key.
To upload a binary to a Github release, you also need:
- A Github authorization token with
public_reposcope. - Set
GITHUB_AUTH_TOKENenvironment variable to the authorization token. - A Github release
(probably as a draft) with a tag for the stack package's version (e.g.
vX.Y.Z).
Usage: stack etc/scripts/release.hs [OPTIONS] TARGET
The tool must be run in the root of the working tree.
The release tool is shake-based, so all standard shake options apply. In addition, the following options are accepted:
--gpg-key: override GPG key used to sign the distribution packages. By default thedev@fpcomplete.comkey is used.--github-auth-token: override the Github authorization token.--github-release-tag: overrides the Github Release tag that binaries are--allow-dirty: by default, thecheckrule aborts if the working tree is dirty, but this will allow it to continue. uploaded to.
You may also use the following environment variables in order to use a custom GPG key:
STACK_RELEASE_GPG_KEYshould be set to the hexadecimal identifier (0xLONG) of the GPG key
release: check, build, and upload.check: run pre-release checks.build: build and sign the binary distribution.upload: upload the binary distribution to the Github release.build-<distro>-<ver>: build package for Linux distribution.upload-<distro>-<ver>: upload package for Linux distribution to private package repository.clean: delete the build artifacts.
<distro> can have one of these values: ubuntu, debian, centos, fedora.
<ver> is the version of the distribution (e.g., 14.04 for Ubuntu).