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.
This commit is contained in:
Mike McQuaid 2025-05-27 11:46:56 +01:00
parent 171fba9c84
commit 2131d70265
No known key found for this signature in database
2 changed files with 4 additions and 14 deletions

View File

@ -230,17 +230,15 @@ jobs:
--password "${PKG_APPLE_ID_APP_SPECIFIC_PASSWORD}" --password "${PKG_APPLE_ID_APP_SPECIFIC_PASSWORD}"
--wait --wait
- name: Install gh
run: brew install gh
- name: Upload installer to GitHub release - name: Upload installer to GitHub release
if: github.event_name == 'release' if: github.event_name == 'release'
env: env:
GH_TOKEN: ${{ github.token }} GH_TOKEN: ${{ github.token }}
INSTALLER_PATH: ${{ needs.build.outputs.installer_path }} INSTALLER_PATH: ${{ needs.build.outputs.installer_path }}
run: gh release upload --repo Homebrew/brew run: |
"${GITHUB_REF//refs\/tags\//}" VERSION="${INSTALLER_PATH#Homebrew-}"
"${INSTALLER_PATH}" VERSION="${VERSION%.pkg}"
gh release upload --repo Homebrew/brew "${VERSION}" "${INSTALLER_PATH}"
issue: issue:
needs: [build, test, upload] needs: [build, test, upload]

View File

@ -71,14 +71,6 @@ RSpec.describe GitHub do
) )
expect(urls).to eq(["https://api.github.com/repos/Homebrew/homebrew-core/actions/artifacts/1969725476/zip"]) expect(urls).to eq(["https://api.github.com/repos/Homebrew/homebrew-core/actions/artifacts/1969725476/zip"])
end 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 end
describe "::pull_request_commits", :needs_network do describe "::pull_request_commits", :needs_network do