-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
135 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: Test Action | ||
|
||
on: | ||
push: | ||
branches: trunk | ||
pull_request: | ||
branches: trunk | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
platform: ['linux/amd64'] | ||
env: | ||
APPDIR: $GITHUB_WORKSPACE/AppDir | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Use action from self | ||
id: linuxdeploy | ||
uses: ./ | ||
with: | ||
platform: ${{ matrix.platform }} | ||
install_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 | ||
cd _build | ||
ninja | ||
meson install --destdir=$APPDIR --skip-subprojects | ||
ld_desktop_file: packaging/rmw.desktop | ||
ld_icon_file: packaging/rmw_icon_32x32.png | ||
ld_icon_filename: rmw | ||
ld_executable_dir: ${{ env.APPDIR }}/usr/bin/rmw | ||
|
||
- name: Upload AppImage | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: appimage | ||
path: ${{ steps.linuxdeploy.outputs.destination_dir }}/out/*.AppImage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/bash | ||
|
||
export -p | ||
# Run user-provided build commands | ||
if [ -n '${{ inputs.install_commands }}' ]; then | ||
eval '${{ inputs.install_commands }}' | ||
fi | ||
# Run user-provided build commands | ||
if [ -n '${{ inputs.build_commands }}' ]; then | ||
eval '${{ inputs.build_commands }}' | ||
fi | ||
|
||
linuxdeploy \ | ||
--appdir $APPDIR \ | ||
-d ${{ inputs.ld_desktop_file }} \ | ||
--icon-file=${{ inputs.ld_icon_file }} \ | ||
--icon-filename=${{ inputs.ld_icon_filename }} \ | ||
--executable ${{ inputs.ld_executable }} \ | ||
--output appimage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
name: 'LinuxDeploy Action' | ||
inputs: | ||
platform: | ||
description: 'Target platform for LinuxDeploy' | ||
required: true | ||
default: 'linux/amd64' | ||
install_commands: | ||
description: 'Commands to install dependencies' | ||
required: false | ||
default: '' | ||
build_commands: | ||
description: 'Commands to build the project' | ||
required: false | ||
default: '' | ||
ld_desktop_file: | ||
description: '' | ||
required: true | ||
ld_icon_file: | ||
description: '' | ||
required: true | ||
ld_icon_filename: | ||
description: '' | ||
required: true | ||
ld_executable_dir: | ||
description: 'Executable to deploy' | ||
required: true | ||
ld_appdir: | ||
description: 'Path to target AppDir' | ||
required: true | ||
|
||
runs: | ||
using: 'composite' | ||
steps: | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- name: Run LinuxDeploy | ||
id: linuxdeploy | ||
shell: bash | ||
run: | | ||
export -p | ||
case ${{ inputs.platform }} in | ||
'linux/amd64') | ||
docker_image='your-docker-image-amd64:latest' | ||
;; | ||
'linux/arm64') | ||
docker_image='your-docker-image-arm64:latest' | ||
;; | ||
*) | ||
echo "Unsupported platform: ${{ inputs.platform }}" | ||
exit 1 | ||
;; | ||
esac | ||
export HOSTUID=$(id -u) | ||
docker run \ | ||
-e HOSTUID -e APPDIR --rm -v $(pwd):/workspace -w /workspace \ | ||
--platform ${{ inputs.platform }} -u root andy5995/linuxdeploy:latest /bin/sh -c \ | ||
"usermod -u $HOSTUID builder && su builder -c 'export -p' && \ | ||
if [ -n '${{ inputs.install_commands }}' ]; then \ | ||
eval '${{ inputs.install_commands }}'; \ | ||
fi && \ | ||
if [ -n '${{ inputs.build_commands }}' ]; then \ | ||
eval '${{ inputs.build_commands }}'; \ | ||
fi && \ | ||
linuxdeploy \ | ||
--appdir $APPDIR \ | ||
-d ${{ inputs.ld_desktop_file }} \ | ||
--icon-file=${{ inputs.ld_icon_file }} \ | ||
--icon-filename=${{ inputs.ld_icon_filename }} \ | ||
--executable ${{ inputs.ld_executable }} \ | ||
--output appimage" |