Skip to content

Commit

Permalink
Fix app image build workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchLeaders committed Feb 9, 2025
1 parent 093dd2b commit f2ea709
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 23 deletions.
36 changes: 17 additions & 19 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,13 @@ jobs:
build:
needs: release
permissions: write-all
name: ${{ matrix.target.name }} on ${{ matrix.config.name }}
name: ${{ matrix.target.project }} on ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: true
matrix:
target:
- project: Tkmm
name: tkmm
config:
- name: Windows (x64)
os: ubuntu-latest
Expand Down Expand Up @@ -96,7 +95,7 @@ jobs:
run: |
dotnet publish src/${{ matrix.target.project }} \
-c Release \
-o ${{ matrix.target.name }}-${{ matrix.config.runtime }} \
-o ${{ matrix.target.project }}-${{ matrix.config.runtime }} \
-r ${{ matrix.config.runtime }} \
--sc true \
--version-suffix ${{ needs.release.outputs.version }} \
Expand All @@ -106,24 +105,24 @@ jobs:
uses: TheDoctor0/[email protected]
with:
type: zip
filename: ../${{ matrix.target.name }}-${{ matrix.config.runtime }}.zip
directory: ${{ matrix.target.name }}-${{ matrix.config.runtime }}
filename: ../${{ matrix.target.project }}-${{ matrix.config.runtime }}.zip
directory: ${{ matrix.target.project }}-${{ matrix.config.runtime }}
path: ./**

- name: Create Checksum File
shell: bash
run: |
md5=($(md5sum -b ${{ matrix.target.name }}-${{ matrix.config.runtime }}.zip))
echo $md5 > ${{ matrix.target.name }}-${{ matrix.config.runtime }}.zip.checksum
md5=($(md5sum -b ${{ matrix.target.project }}-${{ matrix.config.runtime }}.zip))
echo $md5 > ${{ matrix.target.project }}-${{ matrix.config.runtime }}.zip.checksum
- name: Upload Release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.github_token }}
with:
upload_url: ${{ needs.release.outputs.release }}
asset_path: ${{ matrix.target.name }}-${{ matrix.config.runtime }}.zip
asset_name: ${{ matrix.target.name }}-${{ matrix.config.runtime_name }}.zip
asset_path: ${{ matrix.target.project }}-${{ matrix.config.runtime }}.zip
asset_name: ${{ matrix.target.project }}-${{ matrix.config.runtime_name }}.zip
asset_content_type: application/zip

- name: Upload Release Checksum
Expand All @@ -132,21 +131,20 @@ jobs:
GITHUB_TOKEN: ${{ secrets.github_token }}
with:
upload_url: ${{ needs.release.outputs.release }}
asset_path: ${{ matrix.target.name }}-${{ matrix.config.runtime }}.zip.checksum
asset_name: ${{ matrix.target.name }}-${{ matrix.config.runtime_name }}.zip.checksum
asset_path: ${{ matrix.target.project }}-${{ matrix.config.runtime }}.zip.checksum
asset_name: ${{ matrix.target.project }}-${{ matrix.config.runtime_name }}.zip.checksum
asset_content_type: application/zip

appimage:
needs: release
runs-on: ubuntu-latest
permissions: write-all
name: AppImage for ${{ matrix.target.name }} on ${{ matrix.config.name }}
name: AppImage for ${{ matrix.target.project }} on ${{ matrix.config.name }}
strategy:
fail-fast: true
matrix:
target:
- project: Tkmm
name: tkmm
config:
- name: Linux (x64)
os: ubuntu-latest
Expand All @@ -173,7 +171,7 @@ jobs:
run: |
dotnet publish src/${{ matrix.target.project }} \
-c Release \
-o ${{ matrix.target.name }}-${{ matrix.config.runtime }} \
-o ${{ matrix.target.project }}-${{ matrix.config.runtime }} \
-r ${{ matrix.config.runtime }} \
--sc true \
--version-suffix ${{ needs.release.outputs.version }} \
Expand All @@ -195,9 +193,9 @@ jobs:
cp distribution/appimage/AppRun AppDir/AppRun
cp distribution/appimage/tkmm.svg AppDir/tkmm.svg
cp -R ${{ matrix.target.name }}-${{ matrix.config.runtime }}/* AppDir/usr/bin/
cp -R ${{ matrix.target.project }}-${{ matrix.config.runtime }}/* AppDir/usr/bin/
chmod +x AppDir/AppRun AppDir/usr/bin/tkmm*
chmod +x AppDir/AppRun AppDir/usr/bin/${{ matrix.target.project }}*
# Set $ARCH for appimagetool based on the runtime
if [ "${{ matrix.config.runtime }}" = "linux-x64" ]; then
Expand All @@ -214,14 +212,14 @@ jobs:
export UFLAG="gh-releases-zsync|${{ github.repository_owner }}|${{ github.event.repository.name }}|latest|*-$ARCH_NAME.AppImage.zsync"
./tools/appimagetool --comp zstd --mksquashfs-opt -Xcompression-level --mksquashfs-opt 21 -u "$UFLAG" AppDir
mv ./*.AppImage ${{ matrix.target.name }}-${{ matrix.config.runtime }}.AppImage
mv ./*.AppImage ${{ matrix.target.project }}-${{ matrix.config.runtime }}.AppImage
- name: Upload AppImage
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.github_token }}
with:
upload_url: ${{ needs.release.outputs.release }}
asset_path: ${{ matrix.target.name }}-${{ matrix.config.runtime }}.AppImage
asset_name: ${{ matrix.target.name }}-${{ matrix.config.runtime_name }}.AppImage
asset_path: ${{ matrix.target.project }}-${{ matrix.config.runtime }}.AppImage
asset_name: ${{ matrix.target.project }}-${{ matrix.config.runtime_name }}.AppImage
asset_content_type: application/octet-stream
2 changes: 1 addition & 1 deletion distribution/appimage/AppRun
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/sh
CURRENTDIR="$(readlink -f "$(dirname "$0")")"
exec "$CURRENTDIR"/usr/bin/tkmm "$@"
exec "$CURRENTDIR"/usr/bin/Tkmm "$@"
4 changes: 2 additions & 2 deletions distribution/appimage/Tkmm.desktop
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[Desktop Entry]
Categories=Game
Comment=
Exec=tkmm
Exec=Tkmm
GenericName=
Icon=tkmm
MimeType=
Name=TKMM
Path=/usr/bin/tkmm
Path=/usr/bin/Tkmm
StartupNotify=true
Terminal=false
TerminalOptions=
Expand Down
2 changes: 1 addition & 1 deletion src/Tkmm.Core/Helpers/OctokitHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public static class OctokitHelper
private const string USER_AGENT = "tkmm-client-application";

private static readonly string _runtimeId = OperatingSystem.IsWindows() ? "win" : OperatingSystem.IsLinux() ? "linux" : "osx";
private static readonly string _assetName = $"tkmm-{_runtimeId}-{RuntimeInformation.ProcessArchitecture.ToString().ToLower()}.zip";
private static readonly string _assetName = $"Tkmm-{_runtimeId}-{RuntimeInformation.ProcessArchitecture.ToString().ToLower()}.zip";

private static readonly HttpClient _client = new() {
DefaultRequestHeaders = {
Expand Down

0 comments on commit f2ea709

Please sign in to comment.