ci: fixed aur checksums and workflows

This commit is contained in:
objz committed 2026-04-27 12:32:31 +02:00
1 parent ec378b0b59
commit 3d8b3deb74
6 files changed
+141 -59

No files matched your search

+2
View File
@@ -18,6 +18,8 @@ jobs:
- name: install Rust
uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- name: install JDK
uses: actions/setup-java@v5
+10 -1
View File
@@ -16,12 +16,21 @@ jobs:
env:
PLAN: ${{ inputs.plan }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CHOCOLATEY_API_KEY: ${{ secrets.CHOCOLATEY_API_KEY }}
steps:
- uses: actions/checkout@v6
with:
ref: ${{ fromJson(inputs.plan).announcement_tag }}
- name: verify Chocolatey publishing secret
shell: bash
run: |
if [ -z "${CHOCOLATEY_API_KEY}" ]; then
echo "::error::CHOCOLATEY_API_KEY is required to publish mcl-launcher to Chocolatey."
exit 1
fi
- name: prepare Chocolatey package
id: package
shell: bash
@@ -50,4 +59,4 @@ jobs:
- name: push Chocolatey package
uses: crazy-max/ghaction-chocolatey@v4
with:
args: push target/chocolatey/out/mcl-launcher.${{ steps.package.outputs.version }}.nupkg --source "https://push.chocolatey.org/" --api-key "${{ secrets.CHOCOLATEY_API_KEY }}"
args: push target/chocolatey/out/mcl-launcher.${{ steps.package.outputs.version }}.nupkg --source "https://push.chocolatey.org/" --api-key "${{ secrets.CHOCOLATEY_API_KEY }}" --timeout 2700
+19 -1
View File
@@ -1,11 +1,24 @@
name: publish crates
on:
workflow_dispatch:
inputs:
plan:
required: true
type: string
dry_run:
required: false
type: boolean
default: true
workflow_call:
inputs:
plan:
required: true
type: string
dry_run:
required: false
type: boolean
default: false
permissions:
contents: read
@@ -23,6 +36,11 @@ jobs:
uses: dtolnay/rust-toolchain@stable
- name: publish to crates.io
run: cargo publish --allow-dirty
run: |
if [ "${{ inputs.dry_run }}" = "true" ]; then
cargo publish --allow-dirty --dry-run
else
cargo publish --allow-dirty
fi
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
+52 -49
View File
@@ -35,59 +35,62 @@ jobs:
Invoke-WebRequest -Uri $checksumUrl -OutFile "$packagePath/$checksumFile"
$checksum = (((Get-Content "$packagePath/$checksumFile" -Raw) -split '\s+')[0]).ToUpperInvariant()
$versionManifest = @"
PackageIdentifier: $identifier
PackageVersion: $version
DefaultLocale: en-US
ManifestType: version
ManifestVersion: 1.9.0
"@
$versionManifest = @(
'# yaml-language-server: $schema=https://aka.ms/winget-manifest.version.1.9.0.schema.json'
"PackageIdentifier: $identifier"
"PackageVersion: $version"
'DefaultLocale: en-US'
'ManifestType: version'
'ManifestVersion: 1.9.0'
) -join "`n"
$versionManifest | Set-Content -Path "$packagePath/$identifier.yaml" -Encoding utf8
$installerManifest = @"
PackageIdentifier: $identifier
PackageVersion: $version
InstallerType: wix
Scope: machine
InstallerSwitches:
Silent: /quiet /norestart
SilentWithProgress: /passive /norestart
UpgradeBehavior: install
Commands:
- mcl
Installers:
- Architecture: x64
InstallerUrl: $installerUrl
InstallerSha256: $checksum
ManifestType: installer
ManifestVersion: 1.9.0
"@
$installerManifest = @(
'# yaml-language-server: $schema=https://aka.ms/winget-manifest.installer.1.9.0.schema.json'
"PackageIdentifier: $identifier"
"PackageVersion: $version"
'InstallerType: wix'
'Scope: machine'
'InstallerSwitches:'
' Silent: /quiet /norestart'
' SilentWithProgress: /passive /norestart'
'UpgradeBehavior: install'
'Commands:'
'- mcl'
'Installers:'
'- Architecture: x64'
" InstallerUrl: $installerUrl"
" InstallerSha256: $checksum"
'ManifestType: installer'
'ManifestVersion: 1.9.0'
) -join "`n"
$installerManifest | Set-Content -Path "$packagePath/$identifier.installer.yaml" -Encoding utf8
$localeManifest = @"
PackageIdentifier: $identifier
PackageVersion: $version
PackageLocale: en-US
Publisher: objz
PublisherUrl: https://github.com/objz
PublisherSupportUrl: https://github.com/objz/mcl/issues
Author: objz
PackageName: mcl-launcher
PackageUrl: https://github.com/objz/mcl
License: GPL-3.0-only
LicenseUrl: https://github.com/objz/mcl/blob/master/LICENSE
Copyright: Copyright (c) objz
ShortDescription: Minecraft launcher TUI
Description: A fully featured Minecraft launcher TUI with Microsoft account authentication, instance management, mod loaders, imports, content management, and launch support.
Moniker: mcl
Tags:
- minecraft
- launcher
- cli
- tui
ManifestType: defaultLocale
ManifestVersion: 1.9.0
"@
$localeManifest = @(
'# yaml-language-server: $schema=https://aka.ms/winget-manifest.defaultLocale.1.9.0.schema.json'
"PackageIdentifier: $identifier"
"PackageVersion: $version"
'PackageLocale: en-US'
'Publisher: objz'
'PublisherUrl: https://github.com/objz'
'PublisherSupportUrl: https://github.com/objz/mcl/issues'
'Author: objz'
'PackageName: mcl-launcher'
'PackageUrl: https://github.com/objz/mcl'
'License: GPL-3.0-only'
'LicenseUrl: https://github.com/objz/mcl/blob/master/LICENSE'
'Copyright: Copyright (c) objz'
'ShortDescription: Minecraft launcher TUI'
'Description: A fully featured Minecraft launcher TUI with Microsoft account authentication, instance management, mod loaders, imports, content management, and launch support.'
'Moniker: mcl'
'Tags:'
'- minecraft'
'- launcher'
'- cli'
'- tui'
'ManifestType: defaultLocale'
'ManifestVersion: 1.9.0'
) -join "`n"
$localeManifest | Set-Content -Path "$packagePath/$identifier.locale.en-US.yaml" -Encoding utf8
Remove-Item "$packagePath/$checksumFile"
+56 -6
View File
@@ -107,7 +107,7 @@ jobs:
# Typically there will be:
# - 1 "global" task that builds universal installers
# - N "local" tasks that build each platform's binaries and platform-specific installers
matrix: ${{ fromJson(needs.plan.outputs.val).ci.github.artifacts_matrix }}
matrix: ${{ fromJson(needs.plan.outputs.val || '{"ci":{"github":{"artifacts_matrix":{"include":[]}}}}').ci.github.artifacts_matrix }}
runs-on: ${{ matrix.runner }}
container: ${{ matrix.container && matrix.container.image || null }}
env:
@@ -272,8 +272,8 @@ jobs:
merge-multiple: true
- name: Cleanup
run: |
# Remove the granular manifests
rm -f artifacts/*-dist-manifest.json
# Remove internal cargo-dist manifests from the public GitHub Release.
rm -f artifacts/*-dist-manifest.json artifacts/dist-manifest.json
- name: Generate changelog
id: changelog
uses: orhun/git-cliff-action@v4
@@ -287,8 +287,32 @@ jobs:
ANNOUNCEMENT_TITLE: "${{ fromJson(steps.host.outputs.manifest).announcement_title }}"
RELEASE_COMMIT: "${{ github.sha }}"
CHANGELOG: "${{ steps.changelog.outputs.content }}"
RELEASE_TAG: "${{ needs.plan.outputs.tag }}"
run: |
echo "$CHANGELOG" > $RUNNER_TEMP/notes.txt
cat >> $RUNNER_TEMP/notes.txt <<EOF
## Downloads
| File | Platform | Checksum |
| --- | --- | --- |
| [mcl-launcher-aarch64-apple-darwin.tar.xz](https://github.com/objz/mcl/releases/download/${RELEASE_TAG}/mcl-launcher-aarch64-apple-darwin.tar.xz) | Apple Silicon macOS | [checksum](https://github.com/objz/mcl/releases/download/${RELEASE_TAG}/mcl-launcher-aarch64-apple-darwin.tar.xz.sha256) |
| [mcl-launcher-x86_64-apple-darwin.tar.xz](https://github.com/objz/mcl/releases/download/${RELEASE_TAG}/mcl-launcher-x86_64-apple-darwin.tar.xz) | Intel macOS | [checksum](https://github.com/objz/mcl/releases/download/${RELEASE_TAG}/mcl-launcher-x86_64-apple-darwin.tar.xz.sha256) |
| [mcl-launcher-x86_64-pc-windows-msvc.zip](https://github.com/objz/mcl/releases/download/${RELEASE_TAG}/mcl-launcher-x86_64-pc-windows-msvc.zip) | x64 Windows | [checksum](https://github.com/objz/mcl/releases/download/${RELEASE_TAG}/mcl-launcher-x86_64-pc-windows-msvc.zip.sha256) |
| [mcl-launcher-x86_64-pc-windows-msvc.msi](https://github.com/objz/mcl/releases/download/${RELEASE_TAG}/mcl-launcher-x86_64-pc-windows-msvc.msi) | x64 Windows | [checksum](https://github.com/objz/mcl/releases/download/${RELEASE_TAG}/mcl-launcher-x86_64-pc-windows-msvc.msi.sha256) |
| [mcl-launcher-aarch64-unknown-linux-gnu.tar.xz](https://github.com/objz/mcl/releases/download/${RELEASE_TAG}/mcl-launcher-aarch64-unknown-linux-gnu.tar.xz) | ARM64 Linux | [checksum](https://github.com/objz/mcl/releases/download/${RELEASE_TAG}/mcl-launcher-aarch64-unknown-linux-gnu.tar.xz.sha256) |
| [mcl-launcher-x86_64-unknown-linux-gnu.tar.xz](https://github.com/objz/mcl/releases/download/${RELEASE_TAG}/mcl-launcher-x86_64-unknown-linux-gnu.tar.xz) | x64 Linux | [checksum](https://github.com/objz/mcl/releases/download/${RELEASE_TAG}/mcl-launcher-x86_64-unknown-linux-gnu.tar.xz.sha256) |
## Package Managers
\`\`\`sh
cargo install mcl-launcher
brew install objz/tap/mcl-launcher
winget install Objz.MclLauncher
choco install mcl-launcher
paru -S mcl-launcher-bin
\`\`\`
EOF
gh release create "${{ needs.plan.outputs.tag }}" --target "$RELEASE_COMMIT" $PRERELEASE_FLAG --title "$ANNOUNCEMENT_TITLE" --notes-file "$RUNNER_TEMP/notes.txt" artifacts/*
@@ -300,14 +324,29 @@ jobs:
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PLAN: ${{ needs.plan.outputs.val }}
HOMEBREW_TAP_REPOSITORY: "objz/homebrew-tap"
GITHUB_USER: "axo bot"
GITHUB_EMAIL: "admin+bot@axo.dev"
if: ${{ !fromJson(needs.plan.outputs.val).announcement_is_prerelease || fromJson(needs.plan.outputs.val).publish_prereleases }}
steps:
- name: Verify Homebrew tap access
env:
GH_TOKEN: ${{ secrets.RELEASE_TOKEN }}
run: |
if [ -z "${GH_TOKEN}" ]; then
echo "::error::RELEASE_TOKEN is required to publish Homebrew formulae to ${HOMEBREW_TAP_REPOSITORY}."
exit 1
fi
if ! gh repo view "${HOMEBREW_TAP_REPOSITORY}" >/dev/null; then
echo "::error::RELEASE_TOKEN cannot access ${HOMEBREW_TAP_REPOSITORY}. Create the tap repository or update RELEASE_TOKEN with access to it."
exit 1
fi
- uses: actions/checkout@v6
with:
persist-credentials: true
repository: "objz/homebrew-tap"
repository: ${{ env.HOMEBREW_TAP_REPOSITORY }}
token: ${{ secrets.RELEASE_TOKEN }}
# So we have access to the formula
- name: Fetch homebrew formulae
@@ -322,6 +361,7 @@ jobs:
run: |
git config --global user.name "${GITHUB_USER}"
git config --global user.email "${GITHUB_EMAIL}"
starting_commit="$(git rev-parse HEAD)"
for release in $(echo "$PLAN" | jq --compact-output '.releases[] | select([.artifacts[] | endswith(".rb")] | any)'); do
filename=$(echo "$release" | jq '.artifacts[] | select(endswith(".rb"))' --raw-output)
@@ -334,9 +374,18 @@ jobs:
brew style --except-cops FormulaAudit/Homepage,FormulaAudit/Desc,FormulaAuditStrict --fix "Formula/${filename}" || true
git add "Formula/${filename}"
git commit -m "${name} ${version}"
if git diff --cached --quiet; then
echo "Formula/${filename} is unchanged"
else
git commit -m "${name} ${version}"
fi
done
git push
if [ "$(git rev-parse HEAD)" = "$starting_commit" ]; then
echo "No Homebrew formula changes to push"
else
git push
fi
custom-publish-crates:
needs:
@@ -346,6 +395,7 @@ jobs:
uses: ./.github/workflows/publish-crates.yml
with:
plan: ${{ needs.plan.outputs.val }}
dry_run: false
secrets: inherit
# publish jobs get escalated permissions
permissions:
+2 -2
View File
@@ -10,8 +10,8 @@ depends=()
provides=('mcl-launcher')
conflicts=('mcl-launcher' 'mcl-launcher-git')
source=("LICENSE-${pkgver}::${url}/raw/v${pkgver}/LICENSE" "README-${pkgver}::${url}/raw/v${pkgver}/README.md")
source_x86_64=("${url}/releases/download/v${pkgver}/mcl-launcher-x86_64-unknown-linux-gnu.tar.xz")
source_aarch64=("${url}/releases/download/v${pkgver}/mcl-launcher-aarch64-unknown-linux-gnu.tar.xz")
source_x86_64=("mcl-launcher-${pkgver}-x86_64-unknown-linux-gnu.tar.xz::${url}/releases/download/v${pkgver}/mcl-launcher-x86_64-unknown-linux-gnu.tar.xz")
source_aarch64=("mcl-launcher-${pkgver}-aarch64-unknown-linux-gnu.tar.xz::${url}/releases/download/v${pkgver}/mcl-launcher-aarch64-unknown-linux-gnu.tar.xz")
sha256sums=('SKIP' 'SKIP')
sha256sums_x86_64=('SKIP')
sha256sums_aarch64=('SKIP')