diff options
author | Giuseppe Scrivano <gscrivan@redhat.com> | 2020-06-08 08:28:53 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-08 08:28:53 +0200 |
commit | fcda5d9088fdca98e92e4058822504fb870b11fd (patch) | |
tree | 7e0c9ce51c6ff790f8964fd1f2f8b3d41879be98 | |
parent | 483e85547b22a6f8b9230e23b3e9815a41347771 (diff) | |
parent | 751238a7da0bcf1acd05627f09f4205fe315bf49 (diff) |
Merge pull request #209 from AkihiroSuda/a
remove unused script: hack/release.sh
-rw-r--r-- | .github/workflows/release.yaml | 10 | ||||
-rw-r--r-- | MAINTAINERS | 23 | ||||
-rwxr-xr-x | hack/release.sh | 148 |
3 files changed, 18 insertions, 163 deletions
diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 5bc2b45..6eb2fd5 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -29,8 +29,8 @@ jobs: mv /tmp/linux_arm_v7/slirp4netns /tmp/artifact/slirp4netns-armv7l mv /tmp/linux_s390x/slirp4netns /tmp/artifact/slirp4netns-s390x mv /tmp/linux_ppc64le/slirp4netns /tmp/artifact/slirp4netns-ppc64le - - name: "SHA256SUM" - run: (cd /tmp/artifact; sha256sum *) | tee /tmp/SHA256SUM + - name: "SHA256SUMS" + run: (cd /tmp/artifact; sha256sum *) | tee /tmp/SHA256SUMS - name: "Create release" uses: actions/create-release@v1 id: create_release @@ -85,12 +85,12 @@ jobs: asset_path: /tmp/artifact/slirp4netns-ppc64le asset_name: slirp4netns-ppc64le asset_content_type: application/octet-stream - - name: "Upload SHA256SUM" + - name: "Upload SHA256SUMS" uses: actions/upload-release-asset@v1.0.2 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: /tmp/SHA256SUM - asset_name: SHA256SUM + asset_path: /tmp/SHA256SUMS + asset_name: SHA256SUMS asset_content_type: text/plain diff --git a/MAINTAINERS b/MAINTAINERS index 9c1f808..ab0deed 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -8,16 +8,19 @@ # An approver may approve PRs and ship releases without waiting for LGTMs from other approvers. # However, the approver should try to get LGTMs from other approvers for significant changes. # -# Release guide (since v0.4.3): -# 1. Bump up the version string to `vX.Y.Z` (or `vX.Y.Z-beta.W`) in `configure.ac`. -# 2. `git commit -a -s -m vX.Y.Z` -# 3. Bump up the version string to `vX.Y.Z+dev` (or `vX.Y.Z-beta.W`+dev) in `configure.ac`. -# 4. `git commit -a -s -m vX.Y.Z+dev` -# 5. Open a PR and merge it. -# 6. Create a tag `v.X.Y.Z` for the `vX.Y.Z` commit, and push the tag to the upstream: `git push upstream vX.Y.Z` -# 7. GitHub Actions automatically ships a draft release with a statically compiled binary: https://github.com/rootless-containers/slirp4netns/releases -# If it fails, check the GitHub Actions log: https://github.com/rootless-containers/slirp4netns/actions?query=workflow%3ARelease -# 8. Add release notes to the draft release and ship the release. +# Release guide (since v1.1.1): +# 1. Bump up the version string in `configure.ac` to `vX.Y.Z` (or `vX.Y.Z-beta.W`) +# 2. `git commit -a -s -m vX.Y.Z` +# 3. Bump up the version string to `vX.Y.Z+dev` (or `vX.Y.Z-beta.W+dev`) +# 4. `git commit -a -s -m vX.Y.Z+dev` +# 5. Open a PR and merge it. +# 6. Create a tag `v.X.Y.Z` for the `vX.Y.Z` commit, with a GPG sign: `git tag -s vX.Y.Z <commit>` +# 7. Push the tag to the upstream: `git push upstream vX.Y.Z` +# 8. GitHub Actions automatically ships a draft release with statically compiled binaries `slirp4netns-$(uname -m)` and `SHA256SUMS`: https://github.com/rootless-containers/slirp4netns/releases +# If it fails, check the GitHub Actions log: https://github.com/rootless-containers/slirp4netns/actions?query=workflow%3ARelease +# 9. Sign `SHA256SUMS`: `gpg --detach-sign -a SHA256SUMS` +# This command will create `SHA256SUMS.asc`. Make sure to use the same GPG key used for `git tag -s vX.Y.Z <commit>`. +# 10. Attach `SHA256SUMS.asc` and add release note texts to the draft release, and ship the release. [Org.Approvers] people = [ "akihirosuda", diff --git a/hack/release.sh b/hack/release.sh deleted file mode 100755 index 5a5f384..0000000 --- a/hack/release.sh +++ /dev/null @@ -1,148 +0,0 @@ -#!/bin/bash -# release.sh: configurable signed-artefact release script -# Copyright (C) 2016-2019 SUSE LLC. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. - -set -Eeuo pipefail - -## ---> -# Project-specific options and functions. In *theory* you shouldn't need to -# touch anything else in this script in order to use this elsewhere. -project="slirp4netns" -root="$(readlink -f "$(dirname "${BASH_SOURCE}")/..")" - -# Make pushd and popd silent. -function pushd() { command pushd "$@" &>/dev/null ; } -function popd() { command popd "$@" &>/dev/null ; } - -# These functions allow you to configure how the defaults are computed. -function get_arch() { uname -m ; } -function get_version() { echo '@VERSION@' | "$root/config.status" --file - ; } - -# Any pre-configuration steps should be done here -- for instance ./configure. -function setup_project() { - pushd "$root" - [ -x ./configure ] || ./autogen.sh - ./configure LDFLAGS="-static" --prefix=/ --bindir=/bin - popd -} - -# This function takes an output path as an argument, where the built -# (preferably static) binary should be placed. -function build_project() { - tmprootfs="$(mktemp -d --tmpdir "$project-build.XXXXXX")" - - make -C "$root" clean all install DESTDIR="$tmprootfs" - - mv "$tmprootfs/bin/slirp4netns" "$1" - rm -rf "$tmprootfs" -} -# End of the easy-to-configure portion. -## <--- - -# Print usage information. -function usage() { - echo "usage: release.sh [-h] [-v <version>] [-c <commit>] [-o <output-dir>]" >&2 - echo " [-H <hashcmd>] [-S <gpg-key>]" >&2 -} - -# Log something to stderr. -function log() { - echo "[*]" "$@" >&2 -} - -# Log something to stderr and then exit with 0. -function quit() { - log "$@" - exit 0 -} - -# Conduct a sanity-check to make sure that GPG provided with the given -# arguments can sign something. Inability to sign things is not a fatal error. -function gpg_cansign() { - gpg "$@" --clear-sign </dev/null >/dev/null -} - -# When creating releases we need to build (ideally static) binaries, an archive -# of the current commit, and generate detached signatures for both. -keyid="" -version="" -arch="" -commit="HEAD" -hashcmd="sha256sum" -while getopts ":h:v:c:o:S:H:" opt; do - case "$opt" in - S) - keyid="$OPTARG" - ;; - c) - commit="$OPTARG" - ;; - o) - outputdir="$OPTARG" - ;; - v) - version="$OPTARG" - ;; - H) - hashcmd="$OPTARG" - ;; - h) - usage ; exit 0 - ;; - \:) - echo "Missing argument: -$OPTARG" >&2 - usage ; exit 1 - ;; - \?) - echo "Invalid option: -$OPTARG" >&2 - usage ; exit 1 - ;; - esac -done - -# Run project setup first... -( set -x ; setup_project ) - -# Generate the defaults for version and so on *after* argument parsing and -# setup_project, to avoid calling get_version() needlessly. -version="${version:-$(get_version)}" -arch="${arch:-$(get_arch)}" -outputdir="${outputdir:-release/$version}" - -log "[[ $project ]]" -log "version: $version" -log "commit: $commit" -log "output_dir: $outputdir" -log "key: ${keyid:-(default)}" -log "hash_cmd: $hashcmd" - -# Make explicit what we're doing. -set -x - -# Make the release directory. -rm -rf "$outputdir" && mkdir -p "$outputdir" - -# Build project. -build_project "$outputdir/$project.$arch" - -# Generate new archive. -git archive --format=tar --prefix="$project-$version/" "$commit" | xz > "$outputdir/$project.tar.xz" - -# Generate sha256 checksums for both. -( cd "$outputdir" ; "$hashcmd" "$project".{"$arch",tar.xz} > "$project.$hashcmd" ; ) - -# Set up the gpgflags. -gpgflags=() -[[ -z "$keyid" ]] || gpgflags+=("--default-key=$keyid") -gpg_cansign "${gpgflags[@]}" || quit "Could not find suitable GPG key, skipping signing step." - -# Sign everything. -gpg "${gpgflags[@]}" --detach-sign --armor "$outputdir/$project.$arch" -gpg "${gpgflags[@]}" --detach-sign --armor "$outputdir/$project.tar.xz" -gpg "${gpgflags[@]}" --clear-sign --armor \ - --output "$outputdir/$project.$hashcmd"{.tmp,} && \ - mv "$outputdir/$project.$hashcmd"{.tmp,} |