Skip to content

ci: drop chocolatey from ci #11245

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 0 additions & 63 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -479,66 +479,3 @@ jobs:
# 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 }}

publish-chocolatey:
name: Publish to Chocolatey
runs-on: windows-latest
needs: release
if: ${{ !inputs.dry_run }}

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

# Same reason as for release.
- name: Fetch git tags
run: git fetch --tags --force

# From https://chocolatey.org
- name: Install Chocolatey
run: |
Set-ExecutionPolicy Bypass -Scope Process -Force
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072

iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))

- name: Build chocolatey package
run: |
cd scripts/chocolatey

# The package version is the same as the tag minus the leading "v".
# The version in this output already has the leading "v" removed but
# 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 | `
ConvertFrom-Json

# Get the URL for the Windows ZIP from the release assets.
$zip_url = $release_assets.assets | `
Where-Object name -Match ".*_windows_amd64.zip$" | `
Select -ExpandProperty url

echo "ZIP URL: ${zip_url}"
echo "Package version: ${version}"

echo "Downloading ZIP..."
Invoke-WebRequest $zip_url -OutFile assets.zip

echo "Extracting ZIP..."
Expand-Archive assets.zip -DestinationPath assets/

# No need to specify nuspec if there's only one in the directory.
choco pack --version=$version binary_path=assets/coder.exe

choco apikey --api-key $env:CHOCO_API_KEY --source https://push.chocolatey.org/

# No need to specify nupkg if there's only one in the directory.
choco push --source https://push.chocolatey.org/

env:
CHOCO_API_KEY: ${{ secrets.CHOCO_API_KEY }}
# We need a GitHub token for the gh CLI to function under GitHub Actions
GH_TOKEN: ${{ secrets.CDRCI_GITHUB_TOKEN }}
39 changes: 0 additions & 39 deletions scripts/chocolatey/coder.nuspec

This file was deleted.