From de6af2de181eede1a79549c0dffd98127bafda88 Mon Sep 17 00:00:00 2001 From: objz Date: Mon, 27 Apr 2026 13:17:41 +0200 Subject: [PATCH] ci: fixed aur checksums and chocolatey workflow --- .github/workflows/publish-aur.yml | 1 + .github/workflows/publish-chocolatey.yml | 24 +++++++++++++++++++++++- .github/workflows/release.yml | 14 -------------- pkg/mcl-launcher-bin/PKGBUILD | 2 +- 4 files changed, 25 insertions(+), 16 deletions(-) diff --git a/.github/workflows/publish-aur.yml b/.github/workflows/publish-aur.yml index a8fe1fa..bdd7ce2 100644 --- a/.github/workflows/publish-aur.yml +++ b/.github/workflows/publish-aur.yml @@ -55,6 +55,7 @@ jobs: - name: prepare mcl-launcher-bin run: | sed -i "s|^pkgver=.*|pkgver=${{ steps.version.outputs.version }}|" pkg/mcl-launcher-bin/PKGBUILD + sed -i "s|^pkgrel=.*|pkgrel=1|" pkg/mcl-launcher-bin/PKGBUILD cp pkg/mcl-launcher-bin/PKGBUILD PKGBUILD rm -f .SRCINFO diff --git a/.github/workflows/publish-chocolatey.yml b/.github/workflows/publish-chocolatey.yml index 5474d91..350880c 100644 --- a/.github/workflows/publish-chocolatey.yml +++ b/.github/workflows/publish-chocolatey.yml @@ -60,12 +60,34 @@ jobs: shell: bash run: | package="target/chocolatey/out/mcl-launcher.${{ steps.package.outputs.version }}.nupkg" + saw_server_error=false for attempt in 1 2 3; do - if docker run --rm --workdir /wksp --volume "$PWD:/wksp" ghcr.io/crazy-max/chocolatey push "$package" --source "https://push.chocolatey.org/" --api-key "$CHOCOLATEY_API_KEY" --timeout 2700; then + log_file="$RUNNER_TEMP/chocolatey-push-${attempt}.log" + + if docker run --rm --workdir /wksp --volume "$PWD:/wksp" ghcr.io/crazy-max/chocolatey push "$package" --source "https://push.chocolatey.org/" --api-key "$CHOCOLATEY_API_KEY" --timeout 2700 2>&1 | tee "$log_file"; then exit 0 fi + if grep -q "409 (Conflict)" "$log_file"; then + echo "::warning::Chocolatey package version already exists; treating this publish as complete." + exit 0 + fi + + if grep -qE "50[0-9] \\(" "$log_file"; then + saw_server_error=true + fi + + if grep -q "403 (Forbidden)" "$log_file"; then + if [ "$saw_server_error" = "true" ]; then + echo "::warning::Chocolatey returned 403 after an earlier server error. The previous push may have been accepted and put into moderation; treating this publish as complete." + exit 0 + fi + + echo "::error::Chocolatey rejected the push with 403 before any server-side failure. Check CHOCOLATEY_API_KEY ownership/permissions for mcl-launcher." + exit 1 + fi + if [ "$attempt" -eq 3 ]; then break fi diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2251277..6c34abe 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -349,20 +349,6 @@ jobs: 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.HOMEBREW_TAP_TOKEN }} - run: | - if [ -z "${GH_TOKEN}" ]; then - echo "::error::HOMEBREW_TAP_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::HOMEBREW_TAP_TOKEN cannot access ${HOMEBREW_TAP_REPOSITORY}. Create the tap repository or update HOMEBREW_TAP_TOKEN with access to it." - exit 1 - fi - - uses: actions/checkout@v6 with: persist-credentials: true diff --git a/pkg/mcl-launcher-bin/PKGBUILD b/pkg/mcl-launcher-bin/PKGBUILD index a3d8b60..a4682d3 100644 --- a/pkg/mcl-launcher-bin/PKGBUILD +++ b/pkg/mcl-launcher-bin/PKGBUILD @@ -1,7 +1,7 @@ # Maintainer: objz pkgname=mcl-launcher-bin pkgver=0.2.0 -pkgrel=1 +pkgrel=2 pkgdesc="Minecraft launcher TUI" arch=('x86_64' 'aarch64') url="https://github.com/objz/mcl"