Skip to content

Commit cf7021a

Browse files
committed
Implement first working version
Squashed commit of the following: commit 30020d3 Author: Paul Colby <[email protected]> Date: Sun Oct 20 18:30:55 2024 +1100 Describe the plugin versions in the README.md commit a3db136 Author: Paul Colby <[email protected]> Date: Sun Oct 20 18:20:41 2024 +1100 Revert "Fail it one time to prove it works" This reverts commit eb01849. commit eb01849 Author: Paul Colby <[email protected]> Date: Sun Oct 20 18:19:49 2024 +1100 Fail it one time to prove it works commit 8b941c0 Author: Paul Colby <[email protected]> Date: Sun Oct 20 18:18:23 2024 +1100 Check that all plugins are installed and available commit 1dfba72 Author: Paul Colby <[email protected]> Date: Sun Oct 20 17:57:21 2024 +1100 Remove debug code commit 7b840db Author: Paul Colby <[email protected]> Date: Sun Oct 20 17:53:16 2024 +1100 Gstreamer is raw sh too commit 9951c5b Author: Paul Colby <[email protected]> Date: Sun Oct 20 17:51:37 2024 +1100 Gtk is raw sh too commit 047a2a8 Author: Paul Colby <[email protected]> Date: Sun Oct 20 17:49:57 2024 +1100 Add missing ext separators commit 8ad2000 Author: Paul Colby <[email protected]> Date: Sun Oct 20 17:48:44 2024 +1100 Add missing `-` for python URL commit b4f24b5 Author: Paul Colby <[email protected]> Date: Sun Oct 20 17:47:35 2024 +1100 Add missing `}` commit e1534c1 Author: Paul Colby <[email protected]> Date: Sun Oct 20 17:45:11 2024 +1100 Correct parameter expansion commit 76b29fb Author: Paul Colby <[email protected]> Date: Sun Oct 20 17:40:57 2024 +1100 Correct parameter expansion commit b058d54 Author: Paul Colby <[email protected]> Date: Sun Oct 20 17:39:38 2024 +1100 Correct variable name commit 9332ea2 Author: Paul Colby <[email protected]> Date: Sun Oct 20 17:38:44 2024 +1100 Add missing `)` commit 25b39a6 Author: Paul Colby <[email protected]> Date: Sun Oct 20 17:37:27 2024 +1100 Correct typo commit de5fdf3 Author: Paul Colby <[email protected]> Date: Sun Oct 20 17:36:31 2024 +1100 Refactor the URLs generation to be format based commit 3112054 Author: Paul Colby <[email protected]> Date: Sun Oct 20 16:04:41 2024 +1100 Allow for raw plugins having a `.sh` extension commit f78c103 Author: Paul Colby <[email protected]> Date: Sun Oct 20 15:54:39 2024 +1100 Correct variablae name commit 2a1efd5 Author: Paul Colby <[email protected]> Date: Sun Oct 20 15:51:50 2024 +1100 Allow for conda and ncurses plugins having no releases commit acc7a9b Author: Paul Colby <[email protected]> Date: Sun Oct 20 14:45:17 2024 +1100 Omit --remove-on-error for now Since Ubuntu 22.04 does not support it. commit b0c7f4f Author: Paul Colby <[email protected]> Date: Sun Oct 20 14:42:40 2024 +1100 Fail on HTTP errors commit bff40b8 Author: Paul Colby <[email protected]> Date: Sun Oct 20 13:09:24 2024 +1100 Correct path to test file commit ea1ceb8 Author: Paul Colby <[email protected]> Date: Sun Oct 20 13:07:54 2024 +1100 Remove redundant test commit 26a2fa1 Author: Paul Colby <[email protected]> Date: Sun Oct 20 13:05:58 2024 +1100 Remvoe the superfluous --binary flag commit 9aa0193 Author: Paul Colby <[email protected]> Date: Sun Oct 20 13:03:56 2024 +1100 Check sha hashes commit 456a956 Author: Paul Colby <[email protected]> Date: Sun Oct 20 12:41:26 2024 +1100 Get some checksums commit 5347d61 Author: Paul Colby <[email protected]> Date: Sun Oct 20 12:29:16 2024 +1100 Correct workflow syntaxf commit cbb799f Author: Paul Colby <[email protected]> Date: Sun Oct 20 12:28:04 2024 +1100 Split the check step and improve error logging commit e03f709 Author: Paul Colby <[email protected]> Date: Sun Oct 20 10:52:27 2024 +1100 Check that the files are *not* executable commit 18c1e6a Author: Paul Colby <[email protected]> Date: Sun Oct 20 10:46:39 2024 +1100 Define INSTALL_DIR earlier And use unified diffs commit 00f4a4b Author: Paul Colby <[email protected]> Date: Sun Oct 20 10:20:29 2024 +1100 Assign `INSTALL_DIR` in a workflow step Because context vars are not accessible in `env` properties. commit 8e5f026 Author: Paul Colby <[email protected]> Date: Sun Oct 20 10:14:01 2024 +1100 Use runner.temp because runner.workspace is deprecated Or more specifically: > The `runner.workspace` property is purposefully not documented. > It is an early Actions property that now isn't relevant for > users, compared to `github.workspace`. It is kept around for > compatibility. See https://github.com/github/docs/blob/8c2a58a347a41624dbc3dfea84f0b8d25b67d897/content/actions/learn-github-actions/contexts.md?plain=1#L584C1-L585C36 commit de7c7bf Author: Paul Colby <[email protected]> Date: Sun Oct 20 10:01:21 2024 +1100 Default the INPUTS_DIR within Bash commit e8e40bf Author: Paul Colby <[email protected]> Date: Sun Oct 20 09:52:02 2024 +1100 Correct CI workflow badge commit 8a6b7a4 Author: Paul Colby <[email protected]> Date: Sun Oct 20 09:51:17 2024 +1100 Use runner (not GitHub) workspace and runner temp dirs commit 0df2b14 Author: Paul Colby <[email protected]> Date: Sun Oct 20 09:44:28 2024 +1100 Log the URLs we'll be fetching commit 8f1495d Author: Paul Colby <[email protected]> Date: Sun Oct 20 09:42:27 2024 +1100 See what happened to the checkrt plugin commit a49c560 Author: Paul Colby <[email protected]> Date: Sun Oct 20 09:36:46 2024 +1100 Show the installed files commit 15e9a62 Author: Paul Colby <[email protected]> Date: Sun Oct 20 09:34:01 2024 +1100 Don't compare `GITHUB_*` env variables commit ae8a16c Author: Paul Colby <[email protected]> Date: Sun Oct 20 09:32:02 2024 +1100 Correct page to AppImage commit 8fbf318 Author: Paul Colby <[email protected]> Date: Sun Oct 20 09:31:11 2024 +1100 Remove erroneous `}` commit 495a134 Author: Paul Colby <[email protected]> Date: Sun Oct 20 09:29:47 2024 +1100 Ensure env and apt weren't touched commit b790361 Author: Paul Colby <[email protected]> Date: Sun Oct 20 09:22:38 2024 +1100 Install libfuse2 unless told not to commit 093a7a2 Author: Paul Colby <[email protected]> Date: Sun Oct 20 09:17:32 2024 +1100 Drop Ubuntu 20.04 support Ubuntu 20.04's curl is tool old for the --output-dir option. commit f7b1219 Author: Paul Colby <[email protected]> Date: Sun Oct 20 09:16:53 2024 +1100 Download in parallel commit 1100119 Author: Paul Colby <[email protected]> Date: Sun Oct 20 09:08:42 2024 +1100 Build the URLs and binaries lists commit a31f0d5 Author: Paul Colby <[email protected]> Date: Sat Oct 19 23:21:06 2024 +1100 Clean-up some test code commit 744818a Author: Paul Colby <[email protected]> Date: Sat Oct 19 23:19:05 2024 +1100 Test two ways of defaulting the dir option commit 2ad2bdc Author: Paul Colby <[email protected]> Date: Sat Oct 19 23:12:03 2024 +1100 Correct Bash syntax commit 04d7129 Author: Paul Colby <[email protected]> Date: Sat Oct 19 23:10:42 2024 +1100 Correct Bash syntax commit 8369a77 Author: Paul Colby <[email protected]> Date: Sat Oct 19 23:08:57 2024 +1100 Correct workflow syntax commit 7125ebb Author: Paul Colby <[email protected]> Date: Sat Oct 19 23:08:02 2024 +1100 Tweak the README.md slightly commit 27899d4 Author: Paul Colby <[email protected]> Date: Sat Oct 19 23:06:49 2024 +1100 Flesh out the CI workflow
1 parent 629a9ac commit cf7021a

File tree

4 files changed

+134
-63
lines changed

4 files changed

+134
-63
lines changed

.github/workflows/ci.yaml

+91
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
# SPDX-FileCopyrightText: 2024 Paul Colby <[email protected]>
2+
# SPDX-License-Identifier: MIT
3+
4+
name: CI
5+
6+
on:
7+
- push
8+
- pull_request
9+
10+
jobs:
11+
lint:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
- run: yamllint .
16+
17+
test-defaults:
18+
runs-on: ${{ matrix.os }}
19+
steps:
20+
- uses: actions/checkout@v4
21+
- uses: ./
22+
- run: linuxdeploy-x86_64.AppImage --list-plugins
23+
strategy:
24+
matrix:
25+
os:
26+
- ubuntu-22.04
27+
- ubuntu-24.04
28+
fail-fast: false
29+
30+
test-options:
31+
runs-on: ${{ matrix.os }}
32+
steps:
33+
- uses: actions/checkout@v4
34+
- name: Define test install dir
35+
run: tee -a "$GITHUB_ENV" <<< "INSTALL_DIR=${RUNNER_TEMP}/test/linuxdeploy/bin"
36+
- name: Record pre-state
37+
run: |
38+
apt list --installed > "${RUNNER_TEMP}/apt.pre"
39+
env | grep -v '^GITHUB_' | sort > "${RUNNER_TEMP}/env.pre"
40+
- name: Install linuxdeploy, overriding all options
41+
uses: ./
42+
with:
43+
arch: i386
44+
dir: ${{ env.INSTALL_DIR }}
45+
install-deps: false
46+
plugins: appimage@1-alpha-20230713-1 qt
47+
set-env: false
48+
version: 1-alpha-20240109-1
49+
- name: Check post-state
50+
run: |
51+
apt list --installed > "${RUNNER_TEMP}/apt.post"
52+
env | grep -v '^GITHUB_' | sort > "${RUNNER_TEMP}/env.post"
53+
diff -u "${RUNNER_TEMP}/apt."{pre,post}
54+
diff -u "${RUNNER_TEMP}/env."{pre,post}
55+
- name: Check installed binaries
56+
run: |
57+
sha384sum --check <<--
58+
695dbdd17adbf8bc0117fc6ad7e7054099965e7c65963b382373ca90d1b0b9409691ff7107d4bb1e83d4790636ce6b8f\
59+
${INSTALL_DIR}/linuxdeploy-i386.AppImage
60+
28550e5f1699bc826d645d8f8116575df31d7cc16d2ad566a81d11087695fa1445893c0c3ac464a2cb65808bafdd1acd\
61+
${INSTALL_DIR}/linuxdeploy-plugin-appimage-i386.AppImage
62+
a558dcc455997d36fa781ac60ef9bed4cabea4ba716865632fd86460d34de0dc39162cb1de5cd877d2f2d2c16a393003\
63+
${INSTALL_DIR}/linuxdeploy-plugin-qt-i386.AppImage
64+
-
65+
strategy:
66+
matrix:
67+
os:
68+
- ubuntu-22.04
69+
- ubuntu-24.04
70+
fail-fast: false
71+
72+
test-plugins:
73+
runs-on: ${{ matrix.os }}
74+
steps:
75+
- uses: actions/checkout@v4
76+
- name: Install linuxdeploy, and all supported plugins
77+
uses: ./
78+
with:
79+
plugins: appimage checkrt conda gstreamer gtk native_packages ncurses python qt
80+
- name: Check installed plugins
81+
run: |
82+
ls -l "${RUNNER_TEMP}/linuxdeploy"
83+
linuxdeploy-x86_64.AppImage --list-plugins | tee "${RUNNER_TEMP}/plugins.txt"
84+
plugins=($(sed -Ee '0,/^Available plugins:/d' -e 's/:.*//' "${RUNNER_TEMP}/plugins.txt" | sort))
85+
[[ "${plugins[@]}" = 'appimage checkrt conda gstreamer gtk native_packages ncurses python qt' ]]
86+
strategy:
87+
matrix:
88+
os:
89+
- ubuntu-22.04
90+
- ubuntu-24.04
91+
fail-fast: false

.github/workflows/test.yaml

-51
This file was deleted.

README.md

+13-7
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# `install-linuxdeploy-action`
22

3-
[![CI](https://github.com/pcolby/install-linuxdeploy-action/actions/workflows/test.yaml/badge.svg?branch=main)](
4-
https://github.com/pcolby/pcolby/install-linuxdeploy-action/actions/workflows/test.yaml)
3+
[![CI](https://github.com/pcolby/install-linuxdeploy-action/actions/workflows/ci.yaml/badge.svg?branch=main)](
4+
https://github.com/pcolby/pcolby/install-linuxdeploy-action/actions/workflows/ci.yaml)
55

66
GitHub Action for installing [linuxdeploy] with optional plugins.
77

@@ -20,7 +20,7 @@ for, but typically you'd want to leave it to default to `x86_64`.
2020

2121
### `dir`
2222

23-
The target directory to install [linuxdeploy] to. Defaults to `${GITHUB_WORKSPACE}/linuxdeploy`.
23+
The target directory to install [linuxdeploy] to. Defaults to `${RUNNER_TEMP}/linuxdeploy`.
2424

2525
### `install-deps`
2626

@@ -31,6 +31,12 @@ Whether or not to install known `apt` dependencies. Defaults to `true`.
3131
Space-separated list of optional [linuxdeploy] plugins to install. Any plugins directly listed in the
3232
[Awesome linuxdeploy!] listing should be supported, such as `appimage` and `qt`.
3333

34+
Each plugin may be suffixed with a version, like `[email protected]`, to specify which version of that plugin to install. Note,
35+
however, for plugins with actual releases (such as `appimage` and `qt`), the version is a GitHub release tag, but for
36+
unreleased plugins (such as `gtk` and `gstreamer`) the version is a ref name or commit hash. If no version suffix is
37+
provided, released plugins default to match the [`version`](#version) option, while unreleased plugins defualt to their
38+
default branch (ie `master`).
39+
3440
### `set-env`
3541

3642
Whether or not to update the `$PATH` environment variable to include the installation `dir`. Defaults to `true`.
@@ -41,8 +47,8 @@ The [linuxdeploy] version to install, as well as the _default_ version for any `
4147
version.
4248

4349
> [!IMPORTANT]
44-
> Currently this defaults to `continuous`, as [linuxdeploy] currently has no official stable release, but at some point
45-
> this will likely default to the most recent, current, tested stable [linuxdeploy] version.
50+
> Currently this defaults to `continuous`, as [linuxdeploy] has no official stable release yet. But at some point
51+
> this will likely default to the most recent stable [linuxdeploy] version that has been tested with this action.
4652

4753
### Example with all options
4854

@@ -51,9 +57,9 @@ version.
5157
uses: pcolby/install-linuxdeploy-action@v1
5258
with:
5359
arch: x86_64
54-
dir: ${{ github.workspace }}/linuxdeploy
60+
dir: ${{ runner.temp }}/linuxdeploy
5561
install-deps: true
56-
plugins: qt
62+
plugins: appimage gtk@master qt
5763
set-env: true
5864
version: continuous
5965
```

action.yaml

+30-5
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ inputs:
1313
default: x86_64
1414
dir:
1515
description: Target directory to install linuxdeploy
16-
required: false
16+
default: ${{ runner.temp }}/linuxdeploy
1717
install-deps:
1818
description: Install known OS dependencies
1919
default: true
@@ -32,11 +32,36 @@ runs:
3232
steps:
3333
- run: |
3434
set -o errexit -o noclobber -o nounset -o pipefail
35-
[[ ${INPUTS_INSTALL_DEPS}" = 'false' ]] || echo '\todo: install dependencies'
36-
# \todo Build URLs list, and binaries list (using arch, plugins, version)
37-
curl --create-dirs --location --output-dir "${INPUTS_DIR}" --remote-name-all "${urls[@}}"
38-
chmod a+x "${binaries}"
35+
[[ "${INPUTS_INSTALL_DEPS}" = 'false' ]] || sudo apt --assume-yes install libfuse2
36+
declare -r RELEASE_FORMAT='https://github.com/%s/%s/releases/download/%%s/%s'
37+
declare -r RAW_FORMAT='https://raw.githubusercontent.com/%s/%s/%%s/%s'
38+
declare -Ar PLUGIN_FORMAT=(
39+
[checkrt]=$(printf "${RELEASE_FORMAT}" darealshinji linuxdeploy-plugin-checkrt{,.sh})
40+
[conda]=$(printf "${RAW_FORMAT}" linuxdeploy linuxdeploy-plugin-conda{,.sh})
41+
[gstreamer]=$(printf "${RAW_FORMAT}" linuxdeploy linuxdeploy-plugin-gstreamer{,.sh})
42+
[gtk]=$(printf "${RAW_FORMAT}" linuxdeploy linuxdeploy-plugin-gtk{,.sh})
43+
[ncurses]=$(printf "${RAW_FORMAT}" linuxdeploy linuxdeploy-plugin-ncurses{,.sh})
44+
[python]=$(printf "${RELEASE_FORMAT}" niess linuxdeploy-plugin-python{,-${INPUTS_ARCH}.AppImage})
45+
)
46+
declare -a binaries=("${INPUTS_DIR}/linuxdeploy-${INPUTS_ARCH}.AppImage")
47+
declare -a urls=(
48+
$(printf "$(printf "${RELEASE_FORMAT}" linuxdeploy{,,-${INPUTS_ARCH}.AppImage})" "${INPUTS_VERSION}")
49+
)
50+
for plugin in ${INPUTS_PLUGINS}; do
51+
IFS='@' read -r name version <<< "${plugin}"
52+
[[ -v "PLUGIN_FORMAT[${name}]" ]] && urlFormat="${PLUGIN_FORMAT[${name}]}" ||
53+
urlFormat=$(printf "${RELEASE_FORMAT}" linuxdeploy{,-plugin-${name}{,-${INPUTS_ARCH}.AppImage}})
54+
[[ "${urlFormat}" == 'https://raw.'* ]] && : "${version:=master}" || : "${version:=${INPUTS_VERSION}}"
55+
printf -v url "${urlFormat}" "${version}"
56+
binaries+=("${INPUTS_DIR}/${url##*/}")
57+
urls+=("${url}")
58+
done
59+
printf "%s\n" "${urls[@]}"
60+
curl --create-dirs --fail --fail-early --location --output-dir "${INPUTS_DIR}" --parallel --remote-name-all \
61+
--silent --write-out '[%{urlnum}][%{http_code}] %{errormsg}: %{url}\n' "${urls[@]}"
62+
chmod a+x "${binaries[@]}"
3963
[[ "${INPUTS_SET_ENV}" = 'false' ]] || tee -a "${GITHUB_PATH}" <<< "${INPUTS_DIR}"
64+
ls -l "${INPUTS_DIR}"
4065
shell: bash
4166
env:
4267
INPUTS_ARCH: ${{ inputs.arch }}

0 commit comments

Comments
 (0)