diff options
author | Alex Chernyakhovsky <achernya@google.com> | 2022-07-05 15:51:53 -0400 |
---|---|---|
committer | Benjamin Barenblat <bbarenblat@gmail.com> | 2022-07-11 21:21:18 -0400 |
commit | f0b0108c85616e05f647db0b8aa5a3ebb854dfc7 (patch) | |
tree | 6d2d2038bbf6c3608e68d6ffe433934b6bd4e8de | |
parent | 581bd67c5ad51cb59176472101f6a0b03703e494 (diff) |
Add release action on Linux
This Github Actions workflow uses a Linux-based running to create the
release tarball for mosh. This is necessary since mosh does not check
in the autoconf/automake generated files, so the default release
action source download is missing files that are needed for
distributions that use the upstream-provided ./configure script.
-rw-r--r-- | .github/workflows/release.yml | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..e9e56e2 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,59 @@ +name: Release + +on: + push: + tags: + # This syntax is globs, not regex, so it's matching any tag that + # contains the prefix "mosh-" and the 3 version elements. + - "mosh-*.*.*" + +jobs: + release: + runs-on: ${{ matrix.os }} + + strategy: + matrix: + os: [ubuntu-20.04] + + steps: + - uses: actions/checkout@v2 + + + - name: "ensure version bumped" + run: | + expected_tag=$(echo ${{ github.ref }} | cut -d'/' -f3) + have_tag=$(sed -n 's/AC_INIT(\[[^]]*\], \[\([^]]*\)\].*/\1/p' <configure.ac) + echo "Expected tag <$expected_tag>, got <$have_tag>" + [[ "$expected_tag" != "$have_tag" ]] && exit 1 + + - name: "setup linux build environment" + if: ${{ startsWith(matrix.os, 'ubuntu') }} + run: sudo apt install -y protobuf-compiler libprotobuf-dev libutempter-dev autoconf automake nettle-dev + + - name: "setup macos build environment" + if: ${{ startsWith(matrix.os, 'macos') }} + run: brew install protobuf automake + + - name: "generate build scripts" + run: ./autogen.sh + + - name: "configure" + run: ./configure --enable-compile-warnings=error --enable-examples + + - name: "build" + run: make V=1 + + - name: "test" + run: make V=1 distcheck -j + + - name: "Upload Release" + # v1 aka v0.1.14 as of 2022-07-05; pinned to avoid potential code injection + uses: softprops/action-gh-release@1e07f4398721186383de40550babbdf2b84acfc5 + with: + # Action always creates releases in "draft" mode, and requires + # a maintainer to publish them + draft: True + prerelease: contains(github.ref, 'rc') + generate_release_notes: True + files: | + mosh-*.tar.gz |