Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simplify CI and make it easy to get a standalone build
Browse files Browse the repository at this point in the history
The number of options that needed to be set to get a proper standalone
build is fairly large. Given that it was already repeated twice in
different CI contexts it occurred to me the whole batch of settings
should just be one preset so that people can build their own standalone
version easily from the source tarball if they want.
alerque committed Jun 17, 2021

Verified

This commit was signed with the committer’s verified signature.
alerque Caleb Maclennan
1 parent 37dd081 commit ba04951
Showing 3 changed files with 24 additions and 23 deletions.
18 changes: 5 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -16,20 +16,12 @@ jobs:
run: |
echo "VERSION=${GITHUB_REF#refs/*/v}" >> $GITHUB_ENV
./bootstrap.sh
./configure \
--without-man-page \
--disable-tests \
--without-bash-completion-dir \
--without-zsh-completion-dir \
--program-suffix=-standalone.sh \
--with-deployment=standalone \
--bindir=/ \
COMM=comm GIT=git GREP=grep SED=sed SHELL=/bin/sh
make DESTDIR=. install-exec
./configure --with-standalone --bindir=/
make DESTDIR=. install-exec
- name: Upload standalone script artifact
uses: actions/upload-artifact@v2
with:
name: vcsh-standalone
name: standalone-deployment
path: vcsh-standalone.sh

ghrelase:
@@ -61,14 +53,14 @@ jobs:
- name: Download standalone script artifact
uses: actions/download-artifact@v2
with:
name: vcsh-standalone
name: standalone-deployment
- name: Publish Release
uses: softprops/action-gh-release@v1
with:
body_path: changelog-HEAD
files: |
vcsh-${{ env.VERSION }}.zip
vcsh-${{ env.VERSION }}.tar.xz
standalone/vcsh-standalone.sh
vcsh-standalone.sh
env:
GITHUB_TOKEN: ${{ github.token }}
12 changes: 2 additions & 10 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -17,20 +17,12 @@ jobs:
- name: Configure standalone script
run: |
./bootstrap.sh
./configure
--without-man-page \
--disable-tests \
--without-bash-completion-dir \
--without-zsh-completion-dir \
--with-deployment=standalone \
--program-suffix=-standalone.sh \
--bindir=/ \
COMM=comm GIT=git GREP=grep SED=sed SHELL=/bin/sh
./configure --with-standalone --bindir=/
make DESTDIR=. install-exec
- name: Post standalone script artifact
uses: actions/upload-artifact@v2
with:
name: vcsh-standalone
name: standalone-deployment
path: vcsh-standalone.sh

test:
17 changes: 17 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -10,6 +10,23 @@ AC_DEFUN([AX_PROGVAR], [
test -n "$m4_toupper($1)" || AC_MSG_ERROR([m4_default($2,$1) is required])
])

AC_ARG_WITH([standalone],
AS_HELP_STRING([--with-standalone],
[Use configuration presets for a standalone script deployment @<:@default=no@:>@]),
[COMM=comm GIT=git GREP=grep SED=sed SHELL=/bin/sh
with_deployment=standalone
with_man_page=no
enable_tests=no
with_bash_completion_dir=no
with_zsh_completion_dir=no
program_suffix=-standalone.sh
# By this point program_suffix has already been processed so we have to redo what configure did
# Code copied from approx L2670-2671
program_transform_name="s&\$&$program_suffix&;$program_transform_name"
program_transform_name=`printf "%s\n" "$program_transform_name" | sed "$ac_script"`
],
[])

AC_PROG_AWK
AC_PROG_GREP
AC_PROG_SED

0 comments on commit ba04951

Please sign in to comment.