Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch from XZ to ZSTD and improve release artifact transparency #343

Merged
merged 8 commits into from
Apr 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
./configure --with-standalone --bindir=/
make DESTDIR=. install-exec
echo VERSION=$(cat .version) >> $GITHUB_ENV
sha256sum vcsh-standalone.sh
- name: Post standalone script artifact
uses: actions/upload-artifact@v4
with:
Expand Down Expand Up @@ -48,7 +49,7 @@ jobs:
- name: Configure
run: |
./bootstrap.sh
./configure
./configure --enable-developer-mode
- name: Run tests
run: |
make check
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
echo "VERSION=${GITHUB_REF#refs/*/v}" >> $GITHUB_ENV
echo "${GITHUB_REF#refs/*/v}" > .tarball-version
./bootstrap.sh
./configure
./configure --enable-developer-mode
- name: Generate release-specific changelog
run: |
echo "PRERELEASE=${{ contains(env.VERSION, '-alpha') || contains(env.VERSION, '-beta') || contains(env.VERSION, '-rc') }}" >> $GITHUB_ENV
Expand All @@ -41,8 +41,9 @@ jobs:
prerelease: ${{ env.PRERELEASE }}
body_path: changelog-HEAD
files: |
vcsh-${{ env.VERSION }}.tar.zst
vcsh-${{ env.VERSION }}.zip
vcsh-${{ env.VERSION }}.tar.xz
vcsh-${{ env.VERSION }}.sha256.txt

deploy-standalone:
runs-on: ubuntu-latest
Expand All @@ -56,9 +57,11 @@ jobs:
./bootstrap.sh
./configure --with-standalone --bindir=/
make DESTDIR=. install-exec
sha256sum vcsh-standalone.sh | tee vcsh-standalone.sha256.txt
- name: Add standalone deployment to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ github.token }}
file: vcsh-standalone.sh
tag: ${{ github.ref }}
file_glob: true
file: vcsh-standalone.{sh,sha256.txt}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
vcsh.1
doc/vcsh.1.ronn
*.patch
*.swp
.swp
Expand All @@ -16,5 +17,6 @@ completions/vcsh
config.log
config.status
configure
aminclude.am
/vcsh
vcsh-*
4 changes: 4 additions & 0 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,16 @@ Harendra Kumar <[email protected]>
James Davidson <[email protected]>
Jeff Fein-Worton <[email protected]>
Jochen Keil <[email protected]>
John Karahalis <[email protected]>
John Whitley <[email protected]>
Jonathan Sternberg <[email protected]>
Julien Lecomte <[email protected]>
Kevin Lyda <[email protected]>
leycec <[email protected]>
Lyderic Landry <[email protected]>
Markus Martin <[email protected]>
martin f. krafft <[email protected]>
Martin Kühl <[email protected]>
Mathias Svensson <[email protected]>
mek-apelsin <[email protected]>
Mert Dirik <[email protected]>
Expand Down
38 changes: 31 additions & 7 deletions Makefile.am
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
ACLOCAL_AMFLAGS = -I build-aux
AM_DISTCHECK_CONFIGURE_FLAGS = --enable-developer-mode

.ONESHELL:
.SECONDARY:
Expand All @@ -23,12 +24,22 @@ EXTRA_DIST += t/000-tear-env.t t/001-setup-env.t t/100-init.t t/300-add.t t/950-
BUILT_SOURCES =
CLEANFILES = $(dist_man_MANS) $(bin_SCRIPTS)

include $(top_srcdir)/build-aux/git_version.mk
include $(top_srcdir)/build-aux/shell_completion_dirs.mk
# A classical use of the autoconf-archive include macro would expand
# INC_AMINCLUDE here, but the perl script that inlines include statements
# runs before the automake that organizes logic and performs substitution.
# Consequentially with a substitution here it becomes impossible to use
# automake conditionals and substitutions in the included Makefile fragments.
# By entering the expanded value directly we are ready in time for the inlining
# functionality and hence can use conditionals in included makefile fragments.
include $(top_srcdir)/aminclude.am

DISTCLEANFILES = @AMINCLUDE@

if !SOURCE_IS_DIST

if !IS_SDIST
doc/vcsh.1: doc/vcsh.1.ronn
$(RONN) < $< > $@

endif

$(COMPLETIONS_OUT_DIR)/$(TRANSFORMED_PACKAGE_NAME): completions/vcsh.bash
Expand All @@ -40,7 +51,7 @@ $(COMPLETIONS_OUT_DIR)/_$(TRANSFORMED_PACKAGE_NAME): completions/vcsh.zsh
install $< $@

if ENABLE_TESTS
_CHECKDEPS = prove
_CHECKDEPS = $(PROVE)
endif

check-local: $(_CHECKDEPS)
Expand All @@ -58,17 +69,28 @@ prove:
.PHONY: test
test: prove

.PHONY: lint
PHONY_DEVELOPER_TARGETS = lint lint-editor-config lint-shellheck
.PHONY: $(PHONY_DEVELOPER_TARGETS)

if DEVELOPER_MODE

lint: lint-editor-config lint-shellcheck

.PHONY: lint-editor-config
lint-editor-config:
ec

.PHONY: lint-shellheck
lint-shellcheck: $(PACKAGE_NAME)
shellcheck $<

else !DEVELOPER_MODE

$(PHONY_DEVELOPER_TARGETS):
@: $(error "Please reconfigure using --enable-developer-mode to use developer tooling")

endif !DEVELOPER_MODE

if SOURCE_IS_GIT

CONTRIBUTORS:
exec > $@
echo 'Alphabetical list of names of everyone who ever committed to this repository.'
Expand All @@ -78,3 +100,5 @@ CONTRIBUTORS:

changelog-HEAD: changelog
sed -nEe '2d;s/^\t//p;/^$$/q;' $< > $@

endif SOURCE_IS_GIT
10 changes: 10 additions & 0 deletions bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,14 @@ else
./build-aux/git-version-gen .tarball-version > .version
fi

# Autoreconf uses a perl script to inline includes from Makefile.am into
# Makefile.in before ./configure is ever run even once ... which typically means
# AX_AUTOMAKE_MACROS forfeit access to substitutions or conditional logic
# because they enter the picture after those steps. We're intentially using the
# expanded value of @INC_AMINCLUDE@ directly so the include will be inlined. To
# bootstrap we must pre-seed an empty file to avoid a 'file not found' error on
# first run. Subsequently running ./configure will generate the correct content
# based on the configuration flags and also get re-inline into Makefile.in.
touch aminclude.am

autoreconf --install
29 changes: 29 additions & 0 deletions build-aux/ax_add_am_macro.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# ===========================================================================
# https://www.gnu.org/software/autoconf-archive/ax_add_am_macro.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_ADD_AM_MACRO([RULE])
#
# DESCRIPTION
#
# Adds the specified rule to $AMINCLUDE. This macro will only work
# properly with implementations of Make which allow include statements.
# See also AX_ADD_AM_MACRO_STATIC.
#
# LICENSE
#
# Copyright (c) 2009 Tom Howard <[email protected]>
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice
# and this notice are preserved. This file is offered as-is, without any
# warranty.

#serial 10

AC_DEFUN([AX_ADD_AM_MACRO],[
AC_REQUIRE([AX_AM_MACROS])
AX_APPEND_TO_FILE([$AMINCLUDE],[$1])
])
44 changes: 44 additions & 0 deletions build-aux/ax_am_macros.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# ===========================================================================
# https://www.gnu.org/software/autoconf-archive/ax_am_macros.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_AM_MACROS
#
# DESCRIPTION
#
# Adds support for macros that create Make rules. You must manually add
# the following line
#
# @INC_AMINCLUDE@
#
# to your Makefile.in (or Makefile.am if you use Automake) files.
#
# LICENSE
#
# Copyright (c) 2009 Tom Howard <[email protected]>
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice
# and this notice are preserved. This file is offered as-is, without any
# warranty.

#serial 11

AC_DEFUN([AX_AM_MACROS],
[
AC_MSG_NOTICE([adding automake macro support])
AMINCLUDE="aminclude.am"
AC_SUBST(AMINCLUDE)
AC_MSG_NOTICE([creating $AMINCLUDE])
AMINCLUDE_TIME=`LC_ALL=C date`
AX_PRINT_TO_FILE([$AMINCLUDE],[[
# generated automatically by configure from AX_AUTOMAKE_MACROS
# on $AMINCLUDE_TIME

]])

INC_AMINCLUDE="include \$(top_builddir)/$AMINCLUDE"
AC_SUBST(INC_AMINCLUDE)
])
27 changes: 27 additions & 0 deletions build-aux/ax_append_to_file.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# ===========================================================================
# https://www.gnu.org/software/autoconf-archive/ax_append_to_file.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_APPEND_TO_FILE([FILE],[DATA])
#
# DESCRIPTION
#
# Appends the specified data to the specified file.
#
# LICENSE
#
# Copyright (c) 2008 Tom Howard <[email protected]>
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice
# and this notice are preserved. This file is offered as-is, without any
# warranty.

#serial 9

AC_DEFUN([AX_APPEND_TO_FILE],[
AC_REQUIRE([AX_FILE_ESCAPES])
printf "%s" "$2" >> "$1"
])
30 changes: 30 additions & 0 deletions build-aux/ax_file_escapes.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# ===========================================================================
# https://www.gnu.org/software/autoconf-archive/ax_file_escapes.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_FILE_ESCAPES
#
# DESCRIPTION
#
# Writes the specified data to the specified file.
#
# LICENSE
#
# Copyright (c) 2008 Tom Howard <[email protected]>
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice
# and this notice are preserved. This file is offered as-is, without any
# warranty.

#serial 8

AC_DEFUN([AX_FILE_ESCAPES],[
AX_DOLLAR="\$"
AX_SRB="\\135"
AX_SLB="\\133"
AX_BS="\\\\"
AX_DQ="\""
])
9 changes: 0 additions & 9 deletions build-aux/ax_git_version.m4

This file was deleted.

27 changes: 27 additions & 0 deletions build-aux/ax_print_to_file.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# ===========================================================================
# https://www.gnu.org/software/autoconf-archive/ax_print_to_file.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_PRINT_TO_FILE([FILE],[DATA])
#
# DESCRIPTION
#
# Writes the specified data to the specified file.
#
# LICENSE
#
# Copyright (c) 2008 Tom Howard <[email protected]>
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice
# and this notice are preserved. This file is offered as-is, without any
# warranty.

#serial 8

AC_DEFUN([AX_PRINT_TO_FILE],[
AC_REQUIRE([AX_FILE_ESCAPES])
printf "$2" > "$1"
])
19 changes: 19 additions & 0 deletions build-aux/que_developer_mode.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Like AM_MAINTAINER_MODE, but doesn't touch automake internals and so
# can be used freely to control access to project specific developer
# tooling without breaking autotools if disabled.
AC_DEFUN([QUE_DEVELOPER_MODE], [
m4_case(m4_default([$1], [disable]),
[enable], [m4_define([_que_developer_def], [disable])],
[disable], [m4_define([_que_developer_def], [enable])],
[m4_define([_que_developer_def], [enable])
m4_warn([syntax], [unexpected argument to AM@&t@_DEVELOPER_MODE: $1])])
AC_MSG_CHECKING([whether to enable developer-specific portions of Makefiles])
AC_ARG_ENABLE([developer-mode],
[AS_HELP_STRING([--]_que_developer_def[-developer-mode],
_que_developer_def[ dependencies and make targets only useful for developers])],
[USE_DEVELOPER_MODE=$enableval],
[USE_DEVELOPER_MODE=]m4_if(_que_developer_def, [enable], [no], [yes]))
AC_MSG_RESULT([$USE_DEVELOPER_MODE])
AM_CONDITIONAL([DEVELOPER_MODE], [test $USE_DEVELOPER_MODE = yes])

])
19 changes: 19 additions & 0 deletions build-aux/que_dist_checksums.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Output both a file that can be attatched to releases and also write STDOUT
# for the sake of CI build logs so they can be audited as matching what is
# eventually posted. The list of files checksummed is a glob (even though we
# know an exact pattern) to avoid errors for formats not generated.
checksum_dist = \
shopt -s nullglob ; \
$(SHA256SUM) $(distdir)*.{tar.{gz,bz2,lz,xz,zst},zip} |\
$(TEE) $(distdir).sha256.txt

# Since the checksums file isn't an artifact produced by the default source dist
# creation process, we have to clean it up ourselves so distcheck can see that
# everything round-tripped cleanly.
distclean-local:
rm -f $(distdir).sha256.txt

# Append checksum operation to function that runs after compressing dist archives
am__post_remove_distdir = $(am__remove_distdir); $(checksum_dist)

# vim: ft=automake
Loading
Loading