Skip to content

Conversation

deansheather
Copy link
Member

The current winget publish workflow is separate to the release which results in a lot of Tomfoolery when trying to get the version of the last release. This moves the winget publish step to a second job in the release workflow that depends on the release job, using an output from the release job to get the version.

cc: @matifali

@deansheather deansheather requested a review from mafredri January 16, 2023 15:06
Copy link
Member

@mafredri mafredri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 👍🏻

# we do it again to be safe.
$version = "${{ needs.release.outputs.version }}".Trim('v')

$release_assets = gh release view --repo coder/coder "v${version}" --json assets | `
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pro tip: gh builtin jq is pretty neat in these situations:

gh release view --repo coder/coder v0.14.2 --json assets --jq '.assets[] | select(.name | test("_windows_amd64_installer.exe$")) | .url'

TBH the pwsh script is pretty neat too.

@deansheather deansheather enabled auto-merge (squash) January 16, 2023 15:30
@matifali
Copy link
Member

This is cleaner and looks good to me.

@deansheather deansheather merged commit 1d777c4 into main Jan 16, 2023
@deansheather deansheather deleted the dean/winget-fix-pt2 branch January 16, 2023 15:40
@github-actions github-actions bot locked and limited conversation to collaborators Jan 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants