Skip to content

Commit

Permalink
Add dependabot.yml [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
andy5995 committed Feb 3, 2024
1 parent a8917be commit 6d1e3e8
Show file tree
Hide file tree
Showing 4 changed files with 144 additions and 22 deletions.
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 2
updates:
- package-ecosystem: "docker"
directory: "/"
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
19 changes: 11 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,15 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
platform: [amd64, arm64]
env:
APPDIR: '${{ github.workspace }}/AppDir'
platform: [amd64,arm64]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Use action from self
id: linuxdeploy
uses: ./
uses: andy5995/linuxdeploy-build-helper@${{ github.ref }}
with:
platform: ${{ matrix.platform }}
install_commands: |
dependency_commands: |
sudo apt install -y libncursesw5-dev
build_commands: |
export -p
Expand All @@ -31,18 +28,24 @@ jobs:
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 rmw/packaging/rmw.desktop \
--icon-file=rmw/packaging/rmw_icon_32x32.png \
--icon-filename=rmw \
--executable=$APPDIR/usr/bin/rmw \
--appdir=$APPDIR \
-o appimage
- name: Create sha256sum
run: |
cd out
sha256sum $IMAGE_FILENAME > $IMAGE_FILENAME.sha256sum
- name: Upload AppImage
uses: actions/upload-artifact@v4
with:
name: rmw_appimage_${{ matrix.platform }}
name: ${{ env.IMAGE_FILENAME }}
path: ./out/*
if-no-files-found: error
86 changes: 86 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,89 @@
An action that aims to help building an
[AppImage](https://github.com/AppImage/AppImageKit) using
[linuxdeploy](https://github.com/linuxdeploy/linuxdeploy).

Currently supported platforms:

amd64
arm64

Valid inputs are:

```
platform:
description: 'Target platform for LinuxDeploy'
required: true
default: 'amd64'
dependency_commands:
description: 'Commands to install dependencies'
required: false
default: ''
build_commands:
description: 'Commands to build the project'
required: true
default: ''
install_to_appdir_commands:
description: 'Commands to install and copy files to the destination AppDir'
required: true
default: ''
linuxdeploy_output_version:
description: 'Version string used by linuxdeploy used for the image filename'
required: true
default: ''
linuxdeploy_args:
description: 'Argument string to pass to linuxdeploy'
required: true
default: ''
```

Example usage:

```yaml
env:
APPDIR: '${{ github.workspace }}/AppDir'

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
platform: [amd64, arm64]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get helper action
uses: andy5995/linuxdeploy-build-helper@v1
with:
platform: ${{ matrix.platform }}
dependency_commands: |
sudo apt install -y libncursesw5-dev
build_commands: |
export -p
meson setup _build -Dprefix=/usr
cd _build
ninja
install_to_appdir_commands: |
cd _build
meson install --destdir=$APPDIR --skip-subprojects
linuxdeploy_output_version: 0.9.1
linuxdeploy_args: |
-d packaging/rmw.desktop \
--icon-file=packaging/rmw_icon_32x32.png \
--icon-filename=rmw \
--executable=$APPDIR/usr/bin/rmw \
--appdir=$APPDIR \
-o 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
```
51 changes: 37 additions & 14 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,38 @@ inputs:
platform:
description: 'Target platform for LinuxDeploy'
required: true
default: 'linux/amd64'
install_commands:
default: 'amd64'
dependency_commands:
description: 'Commands to install dependencies'
required: false
default: ''
build_commands:
description: 'Commands to build the project'
required: false
required: true
default: ''
install_to_appdir_commands:
description: 'Commands to install and copy files to the destination AppDir'
required: true
default: ''
linuxdeploy_output_version:
description: 'Version string used by linuxdeploy used for the image filename'
required: true
default: ''
linuxdeploy_args:
description: 'Argument string to pass to linuxdeploy'
required: true
default: ''

runs:
using: 'composite'
steps:
- name: Set up QEMU
- if: ${{ inputs.platform != 'amd64' }}
uses: docker/setup-qemu-action@v3

- name: Set APPDIR
shell: bash
run: echo "APPDIR=/home/builder/AppDir" >> $GITHUB_ENV

- name: Run LinuxDeploy
id: linuxdeploy
shell: bash
Expand All @@ -40,16 +53,26 @@ runs:
export HOSTUID=$(id -u)
docker run \
-e HOSTUID -e APPDIR=$APPDIR --rm -v $(pwd):/workspace -w /workspace \
--platform linux/${{ inputs.platform }} -u root andy5995/linuxdeploy:latest /bin/sh -c \
"usermod -u $HOSTUID builder && su builder -c 'export -p' && \
--platform linux/${{ inputs.platform }} -u root andy5995/linuxdeploy:latest \
/bin/sh -c "usermod -u $HOSTUID builder && su builder -c 'export -p && \
set -e && \
if [ -n '${{ inputs.install_commands }}' ]; then \
eval '${{ inputs.install_commands }}'; \
if [ -n \"${{ inputs.dependency_commands }}\" ]; then \
eval \"${{ inputs.dependency_commands }}\"; \
fi && \
if [ -n '${{ inputs.build_commands }}' ]; then \
eval '${{ inputs.build_commands }}'; \
if [ -n \"${{ inputs.build_commands }}\" ]; then \
eval \"${{ inputs.build_commands }}\"; \
fi && \
cd /workspace
linuxdeploy ${{ inputs.linuxdeploy_args }}
mkdir /workspace/out
mv *AppImage* out"
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 }} && \
linuxdeploy --appdir=$APPDIR ${{ inputs.linuxdeploy_args }}
mkdir out && \
mv *AppImage out'"
- name: Set filename
shell: bash
run: |
echo "IMAGE_FILENAME=$(basename `find out/*.AppImage`)" >> $GITHUB_ENV

0 comments on commit 6d1e3e8

Please sign in to comment.