ci: fixed aur checksums and workflows
This commit is contained in:
1 parent
ec378b0b59
commit
3d8b3deb74
6 files changed
+141
-59
No files matched your search
@@ -18,6 +18,8 @@ jobs:
|
|||||||
|
|
||||||
- name: install Rust
|
- name: install Rust
|
||||||
uses: dtolnay/rust-toolchain@stable
|
uses: dtolnay/rust-toolchain@stable
|
||||||
|
with:
|
||||||
|
components: clippy
|
||||||
|
|
||||||
- name: install JDK
|
- name: install JDK
|
||||||
uses: actions/setup-java@v5
|
uses: actions/setup-java@v5
|
||||||
|
|||||||
@@ -16,12 +16,21 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
PLAN: ${{ inputs.plan }}
|
PLAN: ${{ inputs.plan }}
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
CHOCOLATEY_API_KEY: ${{ secrets.CHOCOLATEY_API_KEY }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
ref: ${{ fromJson(inputs.plan).announcement_tag }}
|
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
|
- name: prepare Chocolatey package
|
||||||
id: package
|
id: package
|
||||||
shell: bash
|
shell: bash
|
||||||
@@ -50,4 +59,4 @@ jobs:
|
|||||||
- name: push Chocolatey package
|
- name: push Chocolatey package
|
||||||
uses: crazy-max/ghaction-chocolatey@v4
|
uses: crazy-max/ghaction-chocolatey@v4
|
||||||
with:
|
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
|
||||||
@@ -1,11 +1,24 @@
|
|||||||
name: publish crates
|
name: publish crates
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
plan:
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
dry_run:
|
||||||
|
required: false
|
||||||
|
type: boolean
|
||||||
|
default: true
|
||||||
workflow_call:
|
workflow_call:
|
||||||
inputs:
|
inputs:
|
||||||
plan:
|
plan:
|
||||||
required: true
|
required: true
|
||||||
type: string
|
type: string
|
||||||
|
dry_run:
|
||||||
|
required: false
|
||||||
|
type: boolean
|
||||||
|
default: false
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
@@ -23,6 +36,11 @@ jobs:
|
|||||||
uses: dtolnay/rust-toolchain@stable
|
uses: dtolnay/rust-toolchain@stable
|
||||||
|
|
||||||
- name: publish to crates.io
|
- 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:
|
env:
|
||||||
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
|
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
|
||||||
@@ -35,59 +35,62 @@ jobs:
|
|||||||
Invoke-WebRequest -Uri $checksumUrl -OutFile "$packagePath/$checksumFile"
|
Invoke-WebRequest -Uri $checksumUrl -OutFile "$packagePath/$checksumFile"
|
||||||
$checksum = (((Get-Content "$packagePath/$checksumFile" -Raw) -split '\s+')[0]).ToUpperInvariant()
|
$checksum = (((Get-Content "$packagePath/$checksumFile" -Raw) -split '\s+')[0]).ToUpperInvariant()
|
||||||
|
|
||||||
$versionManifest = @"
|
$versionManifest = @(
|
||||||
PackageIdentifier: $identifier
|
'# yaml-language-server: $schema=https://aka.ms/winget-manifest.version.1.9.0.schema.json'
|
||||||
PackageVersion: $version
|
"PackageIdentifier: $identifier"
|
||||||
DefaultLocale: en-US
|
"PackageVersion: $version"
|
||||||
ManifestType: version
|
'DefaultLocale: en-US'
|
||||||
ManifestVersion: 1.9.0
|
'ManifestType: version'
|
||||||
"@
|
'ManifestVersion: 1.9.0'
|
||||||
|
) -join "`n"
|
||||||
$versionManifest | Set-Content -Path "$packagePath/$identifier.yaml" -Encoding utf8
|
$versionManifest | Set-Content -Path "$packagePath/$identifier.yaml" -Encoding utf8
|
||||||
|
|
||||||
$installerManifest = @"
|
$installerManifest = @(
|
||||||
PackageIdentifier: $identifier
|
'# yaml-language-server: $schema=https://aka.ms/winget-manifest.installer.1.9.0.schema.json'
|
||||||
PackageVersion: $version
|
"PackageIdentifier: $identifier"
|
||||||
InstallerType: wix
|
"PackageVersion: $version"
|
||||||
Scope: machine
|
'InstallerType: wix'
|
||||||
InstallerSwitches:
|
'Scope: machine'
|
||||||
Silent: /quiet /norestart
|
'InstallerSwitches:'
|
||||||
SilentWithProgress: /passive /norestart
|
' Silent: /quiet /norestart'
|
||||||
UpgradeBehavior: install
|
' SilentWithProgress: /passive /norestart'
|
||||||
Commands:
|
'UpgradeBehavior: install'
|
||||||
- mcl
|
'Commands:'
|
||||||
Installers:
|
'- mcl'
|
||||||
- Architecture: x64
|
'Installers:'
|
||||||
InstallerUrl: $installerUrl
|
'- Architecture: x64'
|
||||||
InstallerSha256: $checksum
|
" InstallerUrl: $installerUrl"
|
||||||
ManifestType: installer
|
" InstallerSha256: $checksum"
|
||||||
ManifestVersion: 1.9.0
|
'ManifestType: installer'
|
||||||
"@
|
'ManifestVersion: 1.9.0'
|
||||||
|
) -join "`n"
|
||||||
$installerManifest | Set-Content -Path "$packagePath/$identifier.installer.yaml" -Encoding utf8
|
$installerManifest | Set-Content -Path "$packagePath/$identifier.installer.yaml" -Encoding utf8
|
||||||
|
|
||||||
$localeManifest = @"
|
$localeManifest = @(
|
||||||
PackageIdentifier: $identifier
|
'# yaml-language-server: $schema=https://aka.ms/winget-manifest.defaultLocale.1.9.0.schema.json'
|
||||||
PackageVersion: $version
|
"PackageIdentifier: $identifier"
|
||||||
PackageLocale: en-US
|
"PackageVersion: $version"
|
||||||
Publisher: objz
|
'PackageLocale: en-US'
|
||||||
PublisherUrl: https://github.com/objz
|
'Publisher: objz'
|
||||||
PublisherSupportUrl: https://github.com/objz/mcl/issues
|
'PublisherUrl: https://github.com/objz'
|
||||||
Author: objz
|
'PublisherSupportUrl: https://github.com/objz/mcl/issues'
|
||||||
PackageName: mcl-launcher
|
'Author: objz'
|
||||||
PackageUrl: https://github.com/objz/mcl
|
'PackageName: mcl-launcher'
|
||||||
License: GPL-3.0-only
|
'PackageUrl: https://github.com/objz/mcl'
|
||||||
LicenseUrl: https://github.com/objz/mcl/blob/master/LICENSE
|
'License: GPL-3.0-only'
|
||||||
Copyright: Copyright (c) objz
|
'LicenseUrl: https://github.com/objz/mcl/blob/master/LICENSE'
|
||||||
ShortDescription: Minecraft launcher TUI
|
'Copyright: Copyright (c) objz'
|
||||||
Description: A fully featured Minecraft launcher TUI with Microsoft account authentication, instance management, mod loaders, imports, content management, and launch support.
|
'ShortDescription: Minecraft launcher TUI'
|
||||||
Moniker: mcl
|
'Description: A fully featured Minecraft launcher TUI with Microsoft account authentication, instance management, mod loaders, imports, content management, and launch support.'
|
||||||
Tags:
|
'Moniker: mcl'
|
||||||
- minecraft
|
'Tags:'
|
||||||
- launcher
|
'- minecraft'
|
||||||
- cli
|
'- launcher'
|
||||||
- tui
|
'- cli'
|
||||||
ManifestType: defaultLocale
|
'- tui'
|
||||||
ManifestVersion: 1.9.0
|
'ManifestType: defaultLocale'
|
||||||
"@
|
'ManifestVersion: 1.9.0'
|
||||||
|
) -join "`n"
|
||||||
$localeManifest | Set-Content -Path "$packagePath/$identifier.locale.en-US.yaml" -Encoding utf8
|
$localeManifest | Set-Content -Path "$packagePath/$identifier.locale.en-US.yaml" -Encoding utf8
|
||||||
|
|
||||||
Remove-Item "$packagePath/$checksumFile"
|
Remove-Item "$packagePath/$checksumFile"
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ jobs:
|
|||||||
# Typically there will be:
|
# Typically there will be:
|
||||||
# - 1 "global" task that builds universal installers
|
# - 1 "global" task that builds universal installers
|
||||||
# - N "local" tasks that build each platform's binaries and platform-specific 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 }}
|
runs-on: ${{ matrix.runner }}
|
||||||
container: ${{ matrix.container && matrix.container.image || null }}
|
container: ${{ matrix.container && matrix.container.image || null }}
|
||||||
env:
|
env:
|
||||||
@@ -272,8 +272,8 @@ jobs:
|
|||||||
merge-multiple: true
|
merge-multiple: true
|
||||||
- name: Cleanup
|
- name: Cleanup
|
||||||
run: |
|
run: |
|
||||||
# Remove the granular manifests
|
# Remove internal cargo-dist manifests from the public GitHub Release.
|
||||||
rm -f artifacts/*-dist-manifest.json
|
rm -f artifacts/*-dist-manifest.json artifacts/dist-manifest.json
|
||||||
- name: Generate changelog
|
- name: Generate changelog
|
||||||
id: changelog
|
id: changelog
|
||||||
uses: orhun/git-cliff-action@v4
|
uses: orhun/git-cliff-action@v4
|
||||||
@@ -287,8 +287,32 @@ jobs:
|
|||||||
ANNOUNCEMENT_TITLE: "${{ fromJson(steps.host.outputs.manifest).announcement_title }}"
|
ANNOUNCEMENT_TITLE: "${{ fromJson(steps.host.outputs.manifest).announcement_title }}"
|
||||||
RELEASE_COMMIT: "${{ github.sha }}"
|
RELEASE_COMMIT: "${{ github.sha }}"
|
||||||
CHANGELOG: "${{ steps.changelog.outputs.content }}"
|
CHANGELOG: "${{ steps.changelog.outputs.content }}"
|
||||||
|
RELEASE_TAG: "${{ needs.plan.outputs.tag }}"
|
||||||
run: |
|
run: |
|
||||||
echo "$CHANGELOG" > $RUNNER_TEMP/notes.txt
|
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/*
|
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:
|
env:
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
PLAN: ${{ needs.plan.outputs.val }}
|
PLAN: ${{ needs.plan.outputs.val }}
|
||||||
|
HOMEBREW_TAP_REPOSITORY: "objz/homebrew-tap"
|
||||||
GITHUB_USER: "axo bot"
|
GITHUB_USER: "axo bot"
|
||||||
GITHUB_EMAIL: "admin+bot@axo.dev"
|
GITHUB_EMAIL: "admin+bot@axo.dev"
|
||||||
if: ${{ !fromJson(needs.plan.outputs.val).announcement_is_prerelease || fromJson(needs.plan.outputs.val).publish_prereleases }}
|
if: ${{ !fromJson(needs.plan.outputs.val).announcement_is_prerelease || fromJson(needs.plan.outputs.val).publish_prereleases }}
|
||||||
steps:
|
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
|
- uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
persist-credentials: true
|
persist-credentials: true
|
||||||
repository: "objz/homebrew-tap"
|
repository: ${{ env.HOMEBREW_TAP_REPOSITORY }}
|
||||||
token: ${{ secrets.RELEASE_TOKEN }}
|
token: ${{ secrets.RELEASE_TOKEN }}
|
||||||
# So we have access to the formula
|
# So we have access to the formula
|
||||||
- name: Fetch homebrew formulae
|
- name: Fetch homebrew formulae
|
||||||
@@ -322,6 +361,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
git config --global user.name "${GITHUB_USER}"
|
git config --global user.name "${GITHUB_USER}"
|
||||||
git config --global user.email "${GITHUB_EMAIL}"
|
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
|
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)
|
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
|
brew style --except-cops FormulaAudit/Homepage,FormulaAudit/Desc,FormulaAuditStrict --fix "Formula/${filename}" || true
|
||||||
|
|
||||||
git add "Formula/${filename}"
|
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
|
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:
|
custom-publish-crates:
|
||||||
needs:
|
needs:
|
||||||
@@ -346,6 +395,7 @@ jobs:
|
|||||||
uses: ./.github/workflows/publish-crates.yml
|
uses: ./.github/workflows/publish-crates.yml
|
||||||
with:
|
with:
|
||||||
plan: ${{ needs.plan.outputs.val }}
|
plan: ${{ needs.plan.outputs.val }}
|
||||||
|
dry_run: false
|
||||||
secrets: inherit
|
secrets: inherit
|
||||||
# publish jobs get escalated permissions
|
# publish jobs get escalated permissions
|
||||||
permissions:
|
permissions:
|
||||||
|
|||||||
@@ -10,8 +10,8 @@ depends=()
|
|||||||
provides=('mcl-launcher')
|
provides=('mcl-launcher')
|
||||||
conflicts=('mcl-launcher' 'mcl-launcher-git')
|
conflicts=('mcl-launcher' 'mcl-launcher-git')
|
||||||
source=("LICENSE-${pkgver}::${url}/raw/v${pkgver}/LICENSE" "README-${pkgver}::${url}/raw/v${pkgver}/README.md")
|
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_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=("${url}/releases/download/v${pkgver}/mcl-launcher-aarch64-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=('SKIP' 'SKIP')
|
||||||
sha256sums_x86_64=('SKIP')
|
sha256sums_x86_64=('SKIP')
|
||||||
sha256sums_aarch64=('SKIP')
|
sha256sums_aarch64=('SKIP')
|
||||||
|
|||||||
Reference in new issue
Block a user