fix linuxdeploy arch

This commit is contained in:
raojinlin 2024-02-27 21:24:04 +08:00
parent 0dff4530b2
commit e6d61a3220
1 changed files with 17 additions and 5 deletions

View File

@ -18,6 +18,7 @@ jobs:
matrix: matrix:
platform: platform:
- linux/amd64 - linux/amd64
- linux/aarch64
steps: steps:
- name: Checkout source code - name: Checkout source code
uses: actions/checkout@v3 uses: actions/checkout@v3
@ -29,6 +30,15 @@ jobs:
tag=$(echo ${{ matrix.platform }} | sed -e 's/\//_/g') tag=$(echo ${{ matrix.platform }} | sed -e 's/\//_/g')
echo "tag=$tag" >> "$GITHUB_OUTPUT" echo "tag=$tag" >> "$GITHUB_OUTPUT"
- name: Normalise platform arch
id: normalise_platform_arch
run: |
if [ "${{ matrix.platform }}" == "linux/amd64" ]; then
echo "arch=x86_64" >> "$GITHUB_OUTPUT"
else if [ "${{ matrix.platform }}" == "linux/aarch64" ]; then
echo "arch=aarch64" >> "$GITHUB_OUTPUT"
fi
- name: Normalise version tag - name: Normalise version tag
id: normalise_version id: normalise_version
shell: bash shell: bash
@ -108,11 +118,13 @@ jobs:
mv tiny-rdm_0.0.0_amd64 "tiny-rdm_${{ steps.normalise_version.outputs.version }}_amd64" mv tiny-rdm_0.0.0_amd64 "tiny-rdm_${{ steps.normalise_version.outputs.version }}_amd64"
sed -i 's/0.0.0/${{ steps.normalise_version.outputs.version }}/g' "tiny-rdm_${{ steps.normalise_version.outputs.version }}_amd64/DEBIAN/control" sed -i 's/0.0.0/${{ steps.normalise_version.outputs.version }}/g' "tiny-rdm_${{ steps.normalise_version.outputs.version }}_amd64/DEBIAN/control"
dpkg-deb --build -Zxz "tiny-rdm_${{ steps.normalise_version.outputs.version }}_amd64" dpkg-deb --build -Zxz "tiny-rdm_${{ steps.normalise_version.outputs.version }}_amd64"
- name: Package up appimage file - name: Package up appimage file
run: | run: |
curl https://github.com/linuxdeploy/linuxdeploy/releases/download/1-alpha-20240109-1/linuxdeploy-x86_64.AppImage -O -L curl https://github.com/linuxdeploy/linuxdeploy/releases/download/1-alpha-20240109-1/linuxdeploy-${{ steps.normalise_platform_arch.outputs.arch }}.AppImage -O linuxdeploy -L
chmod u+x linuxdeploy-x86_64.AppImage chmod u+x linuxdeploy
./linuxdeploy-x86_64.AppImage --appdir AppDir
./linuxdeploy --appdir AppDir
mkdir -p AppDir/usr/share/icons/hicolor/512x512/apps mkdir -p AppDir/usr/share/icons/hicolor/512x512/apps
build_dir="build/linux/tiny-rdm_${{ steps.normalise_version.outputs.version }}_amd64" build_dir="build/linux/tiny-rdm_${{ steps.normalise_version.outputs.version }}_amd64"
@ -120,7 +132,7 @@ jobs:
cp $build_dir/usr/local/bin/tiny-rdm AppDir/usr/bin/ cp $build_dir/usr/local/bin/tiny-rdm AppDir/usr/bin/
sed -i 's#/usr/local/bin/tiny-rdm#tiny-rdm#g' $build_dir/usr/share/applications/tiny-rdm.desktop sed -i 's#/usr/local/bin/tiny-rdm#tiny-rdm#g' $build_dir/usr/share/applications/tiny-rdm.desktop
./linuxdeploy-x86_64.AppImage --appdir AppDir \ ./linuxdeploy --appdir AppDir \
--output=appimage \ --output=appimage \
-e $build_dir/usr/local/bin/tiny-rdm \ -e $build_dir/usr/local/bin/tiny-rdm \
-d $build_dir/usr/share/applications/tiny-rdm.desktop -d $build_dir/usr/share/applications/tiny-rdm.desktop
@ -130,7 +142,7 @@ jobs:
run: mv "tiny-rdm_${{ steps.normalise_version.outputs.version }}_amd64.deb" "tiny-rdm_${{ steps.normalise_version.outputs.version }}_${{ steps.normalise_platform.outputs.tag }}.deb" run: mv "tiny-rdm_${{ steps.normalise_version.outputs.version }}_amd64.deb" "tiny-rdm_${{ steps.normalise_version.outputs.version }}_${{ steps.normalise_platform.outputs.tag }}.deb"
- name: Rename appimage - name: Rename appimage
run: mv Tiny_RDM-x86_64.AppImage "tiny-rdm_${{ steps.normalise_version.outputs.version }}_${{ steps.normalise_platform.outputs.tag }}.AppImage" run: mv Tiny_RDM-${{ steps.normalise_platform_arch.outputs.arch }}.AppImage "tiny-rdm_${{ steps.normalise_version.outputs.version }}_${{ steps.normalise_platform.outputs.tag }}.AppImage"
- name: Upload release asset - name: Upload release asset
uses: softprops/action-gh-release@v1 uses: softprops/action-gh-release@v1