-
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
2 changed files
with
118 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,43 @@ | ||
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 }} | ||
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,75 @@ | ||
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 | ||
# Run the selected Docker image | ||
docker run \ | ||
-e $APPDIR --rm -v $(pwd):/workspace \ | ||
--platform ${{ inputs.platform }} \ | ||
andy5995/linuxdeploy:latest /bin/sh -c " | ||
export -p | ||
sudo chmod 777 /workspace | ||
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 | ||
" |