Linux CI (AppImage) #542
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
name: Linux CI (AppImage) | |
on: | |
push: | |
workflow_dispatch: | |
pull_request: | |
release: | |
types: [published] | |
jobs: | |
build: | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
fail-fast: false | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v1 | |
with: | |
submodules: 'recursive' | |
- name: "Install .NET" | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: '8.0.x' | |
- name: "Build Project" | |
run: dotnet publish BnbnavNetClient.Linux/BnbnavNetClient.Linux.csproj -c Release -r linux-x64 --self-contained | |
- name: "Create AppDir" | |
run: | | |
mkdir -p bnbnav.AppDir | |
cp -r BnbnavNetClient.Linux/bin/Release/net8.0/linux-x64/publish/* bnbnav.AppDir | |
cp dist/io.github.Vrabbers.bnbnav.desktop bnbnav.AppDir | |
cp dist/io.github.Vrabbers.bnbnav.svg bnbnav.AppDir | |
ln -s BnbnavNetClient.Linux bnbnav.AppDir/AppRun | |
- name: "Create AppImage" | |
run: | | |
curl https://github.com/AppImage/AppImageKit/releases/download/13/appimagetool-x86_64.AppImage -o appimagetool-x86_64.AppImage -L | |
chmod +x appimagetool-x86_64.AppImage | |
./appimagetool-x86_64.AppImage --appimage-extract-and-run bnbnav.AppDir | |
- uses: actions/upload-artifact@v4 | |
name: "Upload Artifact" | |
with: | |
name: "bnbnav-linux.AppImage" | |
path: "./bnbnav-x86_64.AppImage" | |
release: | |
runs-on: ubuntu-latest | |
needs: build | |
if: github.event_name == 'release' | |
steps: | |
- uses: actions/download-artifact@v3 | |
name: "Download Artifact" | |
id: download | |
with: | |
name: "bnbnav-linux.AppImage" | |
- name: "Upload to Release" | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: bnbnav-x86_64.AppImage | |