From 2131d702651b1e0f5f0c9dee59aaaae440364ae1 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Tue, 27 May 2025 11:46:56 +0100 Subject: [PATCH] workflows/pkg-installer: fix release upload. - Get the release tag from the installer path. - Remove unnecessary `gh` installation. - Remove failing test that I can't fix. --- .github/workflows/pkg-installer.yml | 10 ++++------ Library/Homebrew/test/utils/github_spec.rb | 8 -------- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/.github/workflows/pkg-installer.yml b/.github/workflows/pkg-installer.yml index 2b23ea501a..adb7f99c4c 100644 --- a/.github/workflows/pkg-installer.yml +++ b/.github/workflows/pkg-installer.yml @@ -230,17 +230,15 @@ jobs: --password "${PKG_APPLE_ID_APP_SPECIFIC_PASSWORD}" --wait - - name: Install gh - run: brew install gh - - name: Upload installer to GitHub release if: github.event_name == 'release' env: GH_TOKEN: ${{ github.token }} INSTALLER_PATH: ${{ needs.build.outputs.installer_path }} - run: gh release upload --repo Homebrew/brew - "${GITHUB_REF//refs\/tags\//}" - "${INSTALLER_PATH}" + run: | + VERSION="${INSTALLER_PATH#Homebrew-}" + VERSION="${VERSION%.pkg}" + gh release upload --repo Homebrew/brew "${VERSION}" "${INSTALLER_PATH}" issue: needs: [build, test, upload] diff --git a/Library/Homebrew/test/utils/github_spec.rb b/Library/Homebrew/test/utils/github_spec.rb index e07f093e7c..d4b6ca2ac6 100644 --- a/Library/Homebrew/test/utils/github_spec.rb +++ b/Library/Homebrew/test/utils/github_spec.rb @@ -71,14 +71,6 @@ RSpec.describe GitHub do ) expect(urls).to eq(["https://api.github.com/repos/Homebrew/homebrew-core/actions/artifacts/1969725476/zip"]) end - - it "supports pattern matching" do - urls = described_class.get_artifact_urls( - described_class.get_workflow_run("Homebrew", "brew", "17068", - workflow_id: "pkg-installer.yml", artifact_pattern: "Homebrew-*.pkg"), - ) - expect(urls).to eq(["https://api.github.com/repos/Homebrew/brew/actions/artifacts/1405050842/zip"]) - end end describe "::pull_request_commits", :needs_network do