@@ -306,7 +306,7 @@ jobs:
306
306
307
307
- name : Upload artifacts to actions (if dry-run)
308
308
if : ${{ inputs.dry_run }}
309
- uses : actions/upload-artifact@v3
309
+ uses : actions/upload-artifact@v4
310
310
with :
311
311
name : release-artifacts
312
312
path : |
@@ -480,65 +480,28 @@ jobs:
480
480
# different repo.
481
481
GH_TOKEN : ${{ secrets.CDRCI_GITHUB_TOKEN }}
482
482
483
- publish-chocolatey :
484
- name : Publish to Chocolatey
485
- runs-on : windows-latest
483
+ # publish-sqlc pushes the latest schema to sqlc cloud.
484
+ # At present these pushes cannot be tagged, so the last push is always the latest.
485
+ publish-sqlc :
486
+ name : " Publish to schema sqlc cloud"
487
+ runs-on : " ubuntu-latest"
486
488
needs : release
487
489
if : ${{ !inputs.dry_run }}
488
-
489
490
steps :
490
491
- name : Checkout
491
492
uses : actions/checkout@v4
492
493
with :
493
- fetch-depth : 0
494
-
495
- # Same reason as for release.
496
- - name : Fetch git tags
497
- run : git fetch --tags --force
494
+ fetch-depth : 1
498
495
499
- # From https://chocolatey.org
500
- - name : Install Chocolatey
501
- run : |
502
- Set-ExecutionPolicy Bypass -Scope Process -Force
503
- [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072
496
+ # We need golang to run the migration main.go
497
+ - name : Setup Go
498
+ uses : ./.github/actions/setup-go
504
499
505
- iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
500
+ - name : Setup sqlc
501
+ uses : ./.github/actions/setup-sqlc
506
502
507
- - name : Build chocolatey package
503
+ - name : Push schema to sqlc cloud
504
+ # Don't block a release on this
505
+ continue-on-error : true
508
506
run : |
509
- cd scripts/chocolatey
510
-
511
- # The package version is the same as the tag minus the leading "v".
512
- # The version in this output already has the leading "v" removed but
513
- # we do it again to be safe.
514
- $version = "${{ needs.release.outputs.version }}".Trim('v')
515
-
516
- $release_assets = gh release view --repo coder/coder "v${version}" --json assets | `
517
- ConvertFrom-Json
518
-
519
- # Get the URL for the Windows ZIP from the release assets.
520
- $zip_url = $release_assets.assets | `
521
- Where-Object name -Match ".*_windows_amd64.zip$" | `
522
- Select -ExpandProperty url
523
-
524
- echo "ZIP URL: ${zip_url}"
525
- echo "Package version: ${version}"
526
-
527
- echo "Downloading ZIP..."
528
- Invoke-WebRequest $zip_url -OutFile assets.zip
529
-
530
- echo "Extracting ZIP..."
531
- Expand-Archive assets.zip -DestinationPath assets/
532
-
533
- # No need to specify nuspec if there's only one in the directory.
534
- choco pack --version=$version binary_path=assets/coder.exe
535
-
536
- choco apikey --api-key $env:CHOCO_API_KEY --source https://push.chocolatey.org/
537
-
538
- # No need to specify nupkg if there's only one in the directory.
539
- choco push --source https://push.chocolatey.org/
540
-
541
- env :
542
- CHOCO_API_KEY : ${{ secrets.CHOCO_API_KEY }}
543
- # We need a GitHub token for the gh CLI to function under GitHub Actions
544
- GH_TOKEN : ${{ secrets.CDRCI_GITHUB_TOKEN }}
507
+ make sqlc-push
0 commit comments