Skip to content

Commit

Permalink
chore: fix github actions for release (macOS and AppImage)
Browse files Browse the repository at this point in the history
  • Loading branch information
speed47 committed Sep 17, 2023
1 parent 1577a7c commit 1338598
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 18 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/make-mac-app.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,18 @@ set -e
set -x

github_ref="$1"
archive="dvdisaster-$(echo "$github_ref" | grep -Eo '[^/]+$').dmg"

if ./dvdisaster --version | grep -q NOGUI; then
suffix="-cli-only"
else
suffix=""
fi

archive="dvdisaster-$(echo "$github_ref" | grep -Eo '[^/]+$')$suffix.dmg"
echo "Archive name is $archive"
echo "::set-output name=archive::$archive"

mkdir dist
mkdir -p dist

# Create directory structure for the macOS application bundle
mkdir -p dvdisaster.app/Contents/{MacOS,Resources}
Expand Down Expand Up @@ -42,4 +48,4 @@ mv dvdisaster.app dist

create-dmg "$archive" dist

echo "dist done ($archive)"
echo "dist done ($archive)"
34 changes: 19 additions & 15 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -155,36 +155,40 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: install prerequisites on host
run: sudo apt-get update && sudo apt-get install -y fuse
- name: docker
run: |
sudo apt-get update && sudo apt-get install fuse
mkdir /tmp/dist
mkdir -p /tmp/dist
docker run --device /dev/fuse --privileged --name uu -d -v $PWD:/code -v /tmp/dist:/dist ubuntu:14.04 sleep 1800
- name: install prerequisites
run: docker exec uu sh -c 'sudo apt update && sudo apt install -y libglib2.0-dev ghostscript man wget libgtk2.0-dev gtk2-engines-pixbuf gtk2-engines pkg-config gnome-themes-standard'
- name: configure
- name: install prerequisites in docker
run: docker exec uu sh -c 'sudo apt update && sudo apt install -y libglib2.0-dev ghostscript man libgtk2.0-dev gtk2-engines-pixbuf gtk2-engines pkg-config gnome-themes-standard fuse'
- name: configure in docker
run: docker exec uu sh -c 'cd /code && ./configure --prefix=/usr'
- name: make
- name: make in docker
run: docker exec uu sh -c 'make -C /code -j$(nproc) && make -C /code'
- name: make install
- name: make install in docker
run: docker exec uu sh -c 'cd /code && touch documentation/user-manual/manual.pdf && make install DESTDIR=/dist'
- name: copy things to dist
- name: copy things to dist in docker
run: docker exec uu sh -c 'install -d /dist/usr/lib/gtk-2.0 && cp -va $(pkg-config --variable=libdir gtk+-2.0)/gtk-2.0/$(pkg-config --variable=gtk_binary_version gtk+-2.0)/* /dist/usr/lib/gtk-2.0'
- name: build appimage
- name: build appimage in docker
run: |
wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
wget -q https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
chmod 755 linuxdeploy-x86_64.AppImage
export VERSION=$(echo "${{ github.ref }}" | grep -Eo '[^/]+$')
./linuxdeploy-x86_64.AppImage -d contrib/dvdisaster.desktop -i contrib/dvdisaster64.png -i contrib/dvdisaster48.png -i contrib/dvdisaster32.png -i contrib/dvdisaster16.png --icon-filename dvdisaster --custom-apprun=contrib/AppRun.sh --appdir /tmp/dist/ --output appimage
docker exec -e LINUXDEPLOY_OUTPUT_VERSION=$(echo "${{ github.ref }}" | grep -Eo '[^/]+$') -e ARCH=x86_64 uu sh -c 'cd /code && ./linuxdeploy-x86_64.AppImage -d contrib/dvdisaster.desktop -i contrib/dvdisaster64.png -i contrib/dvdisaster48.png -i contrib/dvdisaster32.png -i contrib/dvdisaster16.png --icon-filename dvdisaster --custom-apprun=contrib/AppRun.sh --appdir /dist/ --output appimage'
- name: fix perms
run: docker exec uu sh -c "chown -R $UID /dist /code/*.AppImage"
- name: apply glib workaround
env:
ARCH: x86_64
run: |
wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage
wget -q https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage
chmod 755 appimagetool-x86_64.AppImage
exe=$(ls -1 dvdisaster*.AppImage)
chmod 755 $exe
./$exe --appimage-extract
rm -vf $exe
./appimagetool-x86_64.AppImage -v squashfs-root
env LINUXDEPLOY_OUTPUT_VERSION=$(echo "${{ github.ref }}" | grep -Eo '[^/]+$') ./appimagetool-x86_64.AppImage -v squashfs-root
mv -v dvdisaster*AppImage $exe
chmod 755 $exe
- name: test appimage
Expand All @@ -203,4 +207,4 @@ jobs:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./${{ steps.dist.outputs.archive }}
asset_name: ${{ steps.dist.outputs.archive }}
asset_content_type: application/zip
asset_content_type: application/octet-stream

0 comments on commit 1338598

Please sign in to comment.