Skip to content

Commit

Permalink
Several minor changes (#2)
Browse files Browse the repository at this point in the history
* Test with NetPanzer

* docs: Grammar

* Add ACTION_WORKSPACE

* Don't cd before running linuxdeploy

* docs: update
  • Loading branch information
andy5995 authored Feb 3, 2024
1 parent cd48bec commit 3916456
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 6 deletions.
52 changes: 50 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
- '**test.yml'

jobs:
build:
test-rmw:
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -28,7 +28,6 @@ jobs:
dependency_commands: |
sudo apt install -y libncursesw5-dev
build_commands: |
export -p
git clone --depth 1 https://github.com/theimpossibleastronaut/rmw
cd rmw
meson setup _build -Dprefix=/usr
Expand All @@ -55,3 +54,52 @@ jobs:
name: ${{ env.IMAGE_FILENAME }}
path: ./out/*
if-no-files-found: error

test-netpanzer:
runs-on: ubuntu-latest
strategy:
matrix:
platform: [amd64]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Use action from self
uses: ./
with:
platform: ${{ matrix.platform }}
dependency_commands: |
sudo apt install -y \
gettext \
liblua5.1-0-dev \
libphysfs-dev \
libsdl2-dev \
libsdl2-mixer-dev \
libsdl2-ttf-dev
build_commands: |
git clone --depth 1 https://github.com/netpanzer/netpanzer
cd netpanzer
meson setup _build -Dprefix=/usr
cd _build
ninja
install_to_appdir_commands: |
meson install --destdir=$APPDIR --skip-subprojects
linuxdeploy_output_version: 0.9.1
linuxdeploy_args: |
-d netpanzer/support/win32/netpanzer.desktop \
--custom-apprun=netpanzer/support/appimage/AppRun \
--icon-file=netpanzer/netpanzer.png \
--icon-filename=netpanzer \
--executable $APPDIR/usr/bin/netpanzer \
--output appimage
- name: Create sha256sum
run: |
cd out
sha256sum $IMAGE_FILENAME > $IMAGE_FILENAME.sha256sum
- name: Upload AppImage
uses: actions/upload-artifact@v4
with:
name: ${{ env.IMAGE_FILENAME }}
path: ./out/*
if-no-files-found: error
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,20 +90,27 @@ Currently supported platforms:
```
## Notes
The AppImage will be placed in `./` (relative to your GitHub workspace).

The value of these variables are set in the action:

ACTION_WORKSPACE
APPDIR
IMAGE_FILENAME (after the AppImage has been created)

Use '$ACTION_WORKSPACE' if you need to specify an absolute path.
GITHUB_WORKSPACE won't work in most sections because the commands are run
inside a docker container as an unprivileged user.

The arm64 builds are done using
[qemu](https://github.com/docker/setup-qemu-action) and will take much longer
than on a native arm64 system. GitHub has a timeout and if your build takes
longer than the timeout setting, then the job will exit before the image is
created.

If you have access to a native arm64 system, you can use the docker image from
this action, which is `andy5995/linuxdeploy:latest` or use a release from the
linuxdeploy repository (link above).
this action, which is `andy5995/linuxdeploy:latest` or use a linuxdeploy
release from their repository (link above).

## Contributing

Expand Down
8 changes: 6 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ runs:
shell: bash
run: echo "APPDIR=/home/builder/AppDir" >> $GITHUB_ENV

- name: Set ACTION_WORKSPACE
shell: bash
run: echo "ACTION_WORKSPACE=/workspace" >> $GITHUB_ENV

- name: Run LinuxDeploy
id: linuxdeploy
shell: bash
Expand All @@ -53,7 +57,7 @@ runs:
esac
export HOSTUID=$(id -u)
docker run \
-e HOSTUID -e APPDIR=$APPDIR --rm -v $(pwd):/workspace -w /workspace \
-e HOSTUID -e APPDIR=$APPDIR --rm -v $(pwd):$ACTION_WORKSPACE -w $ACTION_WORKSPACE \
--platform linux/${{ inputs.platform }} -u root andy5995/linuxdeploy:latest \
/bin/sh -c "usermod -u $HOSTUID builder && su builder -c 'export -p && \
set -e && \
Expand All @@ -66,8 +70,8 @@ runs:
if [ -n \"${{ inputs.install_to_appdir_commands }}\" ]; then \
eval \"${{ inputs.install_to_appdir_commands }}\"; \
fi && \
cd /workspace && \
export LINUXDEPLOY_OUTPUT_VERSION=${{ inputs.linuxdeploy_output_version }} && \
cd $ACTION_WORKSPACE && \
linuxdeploy --appdir=$APPDIR ${{ inputs.linuxdeploy_args }}
mkdir out && \
mv *AppImage out'"
Expand Down

0 comments on commit 3916456

Please sign in to comment.