Skip to content

Commit

Permalink
Include build action for an AppImage
Browse files Browse the repository at this point in the history
  • Loading branch information
mgrojo committed Nov 16, 2023
1 parent c77f913 commit 3e67700
Show file tree
Hide file tree
Showing 4 changed files with 96 additions and 0 deletions.
66 changes: 66 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Build using Alire.
name: Build

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build:
name: CI on ${{ matrix.os }}

runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [windows-latest, ubuntu-latest]

steps:
- name: Checkout
uses: actions/checkout@v2
- name: ada-actions/toolchain
uses: ada-actions/toolchain@ce2021
with:
distrib: community
target: native
- name: alire-project/setup-alire
uses: alire-project/setup-alire@v1
with:
version: 1.2.1
- name: Update apt
if: runner.os == 'Linux'
run: sudo apt-get update
- name: Update
run: alr index --update-all
- name: Build
run: alr --non-interactive build

release:
name: Continuous AppImage
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: ada-actions/toolchain
uses: ada-actions/toolchain@ce2021
with:
distrib: community
target: native
- name: alire-project/setup-alire
uses: alire-project/setup-alire@v1
- name: Update apt
run: sudo apt-get update
- name: Update
run: alr index --update-all
- name: Build
run: alr --non-interactive build
- name: Build AppImage
run: VERSION=${GITHUB_BASE_REF:-${GITHUB_REF#refs/heads/}} make AppImage
- name: Release
uses: softprops/action-gh-release@v1
with:
files: Open_URL*.AppImage
prerelease: true
tag_name: continuous
21 changes: 21 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MAIN = open_url
DESTDIR = /opt/$(MAIN)

.PHONY: all install AppImage

all:
alr build

install: all
alr exec -P -- gprinstall --prefix=$(DESTDIR) --create-missing-dirs --mode=usage -f
cp -p $(MAIN).png $(DESTDIR)/

AppImage:
rm -rf AppDir
make install DESTDIR=AppDir/usr
wget -nv -c https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
chmod +x linuxdeploy-x86_64.AppImage
./linuxdeploy-x86_64.AppImage \
--executable bin/$(MAIN) \
--desktop-file $(MAIN).desktop --icon-file=AppDir/usr/$(MAIN).png \
--appdir AppDir --output appimage
9 changes: 9 additions & 0 deletions open_url.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[Desktop Entry]
Name=Open URL
Comment=Open *.url files under Linux
Exec=open_url
Icon=open_url
Terminal=false
Type=Application
Categories=Utility

Binary file added open_url.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 3e67700

Please sign in to comment.