Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions .github/scripts/publish_winget_manifest.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
#!/usr/bin/env bash

mkdir $PACKAGE_IDENTIFIER

cat > $PACKAGE_IDENTIFIER/$PACKAGE_IDENTIFIER.yaml << EOF
PackageIdentifier: $PACKAGE_IDENTIFIER
PackageVersion: $PACKAGE_VERSION
DefaultLocale: en-US
ManifestType: version
ManifestVersion: 1.10.0
EOF

echo "$PACKAGE_IDENTIFIER.yaml"
cat $PACKAGE_IDENTIFIER/$PACKAGE_IDENTIFIER.yaml

cat > $PACKAGE_IDENTIFIER/$PACKAGE_IDENTIFIER.locale.en-US.yaml << EOF
PackageIdentifier: $PACKAGE_IDENTIFIER
PackageVersion: $PACKAGE_VERSION
PackageLocale: en-US
Publisher: huanghongxun
PublisherUrl: https://github.com/HMCL-dev
PublisherSupportUrl: https://github.com/HMCL-dev/HMCL/issues
PackageName: $PACKAGE_NAME
PackageUrl: https://github.com/HMCL-dev/HMCL
License: GPL-3.0
Copyright: Copyright (C) 2026 huangyuhui
ShortDescription: A Minecraft Launcher which is multi-functional, cross-platform and popular
Tags:
- javafx
- minecraft
- minecraft-launcher
ReleaseNotesUrl: https://docs.hmcl.net/changelog/$PACKAGE_CHANNEL.html#HMCL-$PACKAGE_VERSION
Documentations:
- DocumentLabel: Documentation
DocumentUrl: https://docs.hmcl.net
ManifestType: defaultLocale
ManifestVersion: 1.10.0
EOF

echo "$PACKAGE_IDENTIFIER.locale.en-US.yaml"
cat $PACKAGE_IDENTIFIER/$PACKAGE_IDENTIFIER.locale.en-US.yaml

cat > $PACKAGE_IDENTIFIER/$PACKAGE_IDENTIFIER.installer.yaml << EOF
PackageIdentifier: $PACKAGE_IDENTIFIER
PackageVersion: $PACKAGE_VERSION
InstallerType: portable
Commands:
- hmcl-$PACKAGE_CHANNEL
Installers:
- Architecture: neutral
InstallerUrl: $PACKAGE_INSTALLER_URL
InstallerSha256: $PACKAGE_INSTALLER_SHA256
ManifestType: installer
ManifestVersion: 1.10.0
EOF

echo "$PACKAGE_IDENTIFIER.installer.yaml"
cat $PACKAGE_IDENTIFIER/$PACKAGE_IDENTIFIER.installer.yaml

komac submit $PACKAGE_IDENTIFIER --submit --token $KOMAC_TOKEN

rm -rf $PACKAGE_IDENTIFIER
42 changes: 41 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ on:
permissions:
contents: write

env:
KOMAC_DEB_DOWNLOAD_URL: https://github.com/russellbanks/Komac/releases/download/v2.14.0/komac_2.14.0-1_amd64.deb

jobs:
check-update:
if: ${{ github.repository_owner == 'HMCL-dev' }}
Expand All @@ -18,6 +21,9 @@ jobs:
include:
- channel: dev
task: checkUpdateDev
winget-identifier-gh: HMCL.HMCL.Dev
winget-identifier-cnb: HMCL.HMCL.Dev.CNB
winget-name: Hello Minecraft! Launcher Dev
- channel: stable
task: checkUpdateStable
runs-on: ubuntu-latest
Expand Down Expand Up @@ -52,10 +58,12 @@ jobs:
export JAR_SHA256=$(cat HMCL-$HMCL_VERSION.jar.sha256 | tr -d '\n')
export EXE_SHA256=$(cat HMCL-$HMCL_VERSION.exe.sha256 | tr -d '\n')
export SH_SHA256=$(cat HMCL-$HMCL_VERSION.sh.sha256 | tr -d '\n')

echo "$JAR_SHA256 HMCL-$HMCL_VERSION.jar" | sha256sum -c
echo "$EXE_SHA256 HMCL-$HMCL_VERSION.exe" | sha256sum -c
echo "$SH_SHA256 HMCL-$HMCL_VERSION.sh" | sha256sum -c

echo "EXE_SHA256=$EXE_SHA256" >> $GITHUB_ENV
- name: Generate release note
if: ${{ env.continue == 'true' }}
run: |
Expand Down Expand Up @@ -92,6 +100,26 @@ jobs:
--prerelease
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Prepare komac
if: ${{ env.continue == 'true' && matrix.channel == 'dev' }}
continue-on-error: true
run: |
wget -O komac.deb ${{ env.KOMAC_DEB_DOWNLOAD_URL }}
sudo apt install ./komac.deb -y
rm ./komac.deb
chmod +x .github/scripts/publish_winget_manifest.sh
- name: Publish a winget manifest from GitHub Releases
if: ${{ env.continue == 'true' && matrix.channel == 'dev' }}
continue-on-error: true
run: .github/scripts/publish_winget_manifest.sh
env:
PACKAGE_IDENTIFIER: ${{ matrix.winget-identifier-gh }}
PACKAGE_NAME: ${{ matrix.winget-name }}
PACKAGE_VERSION: ${{ env.HMCL_VERSION }}
PACKAGE_CHANNEL: ${{ matrix.channel }}
PACKAGE_INSTALLER_URL: https://github.com/${{ github.repository }}/releases/download/v${{ env.HMCL_VERSION }}/HMCL-${{ env.HMCL_VERSION }}.exe
PACKAGE_INSTALLER_SHA256: ${{ env.EXE_SHA256 }}
KOMAC_TOKEN: ${{ secrets.KOMAC_TOKEN }}
- name: Install git-cnb
if: ${{ env.continue == 'true' }}
run: go install "cnb.cool/looc/git-cnb@$GIT_CNB_VERSION"
Expand Down Expand Up @@ -123,3 +151,15 @@ jobs:
env:
CNB_TOKEN: ${{ secrets.CNB_SYNC_TOKEN }}
CNB_REPO: HMCL-dev/HMCL
- name: Publish a winget manifest from CNB Releases
if: ${{ env.continue == 'true' && matrix.channel == 'dev' }}
continue-on-error: true
run: .github/scripts/publish_winget_manifest.sh
env:
PACKAGE_IDENTIFIER: ${{ matrix.winget-identifier-cnb }}
PACKAGE_NAME: ${{ matrix.winget-name }}
PACKAGE_VERSION: ${{ env.HMCL_VERSION }}
PACKAGE_CHANNEL: ${{ matrix.channel }}
PACKAGE_INSTALLER_URL: https://cnb.cool/HMCL-dev/HMCL/-/releases/download/v${{ env.HMCL_VERSION }}/HMCL-${{ env.HMCL_VERSION }}.exe
PACKAGE_INSTALLER_SHA256: ${{ env.EXE_SHA256 }}
KOMAC_TOKEN: ${{ secrets.KOMAC_TOKEN }}