- Notifications
You must be signed in to change notification settings - Fork3
chore: publish to winget in release workflow#108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -18,6 +18,8 @@ permissions: | ||||||
jobs: | ||||||
release: | ||||||
runs-on: ${{ github.repository_owner == 'coder' && 'windows-latest-16-cores' || 'windows-latest' }} | ||||||
outputs: | ||||||
version: ${{ steps.version.outputs.VERSION }} | ||||||
timeout-minutes: 15 | ||||||
steps: | ||||||
@@ -117,3 +119,78 @@ jobs: | ||||||
${{ steps.release.outputs.ARM64_OUTPUT_PATH }} | ||||||
env: | ||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||||||
winget: | ||||||
runs-on: depot-windows-latest | ||||||
needs: release | ||||||
steps: | ||||||
- name: Sync fork | ||||||
run: gh repo sync cdrci/winget-pkgs -b master | ||||||
env: | ||||||
GH_TOKEN: ${{ secrets.CDRCI_GITHUB_TOKEN }} | ||||||
- name: Checkout | ||||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. [nitpick] Pinning Suggested change
Copilot uses AI. Check for mistakes. | ||||||
with: | ||||||
fetch-depth: 0 | ||||||
# If the event that triggered the build was an annotated tag (which our | ||||||
# tags are supposed to be), actions/checkout has a bug where the tag in | ||||||
# question is only a lightweight tag and not a full annotated tag. This | ||||||
# command seems to fix it. | ||||||
# https://github.com/actions/checkout/issues/290 | ||||||
- name: Fetch git tags | ||||||
run: git fetch --tags --force | ||||||
- name: Install wingetcreate | ||||||
run: | | ||||||
Invoke-WebRequest https://aka.ms/wingetcreate/latest -OutFile wingetcreate.exe | ||||||
- name: Submit updated manifest to winget-pkgs | ||||||
run: | | ||||||
$version = "${{ needs.release.outputs.version }}" | ||||||
$release_assets = gh release view --repo coder/coder-desktop-windows "v${version}" --json assets | ` | ||||||
ConvertFrom-Json | ||||||
# Get the installer URLs from the release assets. | ||||||
$amd64_installer_url = $release_assets.assets | ` | ||||||
Where-Object name -Match ".*-x64.exe$" | ` | ||||||
Select -ExpandProperty url | ||||||
$arm64_installer_url = $release_assets.assets | ` | ||||||
Where-Object name -Match ".*-arm64.exe$" | ` | ||||||
Select -ExpandProperty url | ||||||
echo "amd64 Installer URL: ${amd64_installer_url}" | ||||||
echo "arm64 Installer URL: ${arm64_installer_url}" | ||||||
echo "Package version: ${version}" | ||||||
.\wingetcreate.exe update Coder.CoderDesktop ` | ||||||
--submit ` | ||||||
--version "${version}" ` | ||||||
--urls "${amd64_installer_url}" "${arm64_installer_url}" ` | ||||||
--token "$env:WINGET_GH_TOKEN" | ||||||
env: | ||||||
# For gh CLI: | ||||||
GH_TOKEN: ${{ github.token }} | ||||||
matifali marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||||||
# For wingetcreate. We need a real token since we're pushing a commit | ||||||
# to GitHub and then making a PR in a different repo. | ||||||
WINGET_GH_TOKEN: ${{ secrets.CDRCI_GITHUB_TOKEN }} | ||||||
- name: Comment on PR | ||||||
run: | | ||||||
# wait 30 seconds | ||||||
Start-Sleep -Seconds 30.0 | ||||||
# Find the PR that wingetcreate just made. | ||||||
$version = "${{ needs.release.outputs.version }}" | ||||||
$pr_list = gh pr list --repo microsoft/winget-pkgs --search "author:cdrci Coder.CoderDesktop version ${version}" --limit 1 --json number | ` | ||||||
ConvertFrom-Json | ||||||
$pr_number = $pr_list[0].number | ||||||
matifali marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||||||
gh pr comment --repo microsoft/winget-pkgs "${pr_number}" --body "🤖 cc: @deansheather @matifali" | ||||||
env: | ||||||
# For gh CLI. We need a real token since we're commenting on a PR in a | ||||||
# different repo. | ||||||
GH_TOKEN: ${{ secrets.CDRCI_GITHUB_TOKEN }} |
Uh oh!
There was an error while loading.Please reload this page.