|
7 | 7 | release:
|
8 | 8 | types:[published]
|
9 | 9 |
|
| 10 | +workflow_dispatch: |
| 11 | +inputs: |
| 12 | +dryrun: |
| 13 | +description:'Run in dry-run mode (upload as artifact instead of release asset)' |
| 14 | +required:true |
| 15 | +type:boolean |
| 16 | +default:false |
10 | 17 | permissions:{}
|
11 | 18 |
|
12 | 19 | # Cancel in-progress runs for when multiple PRs get merged
|
|
23 | 30 | permissions:
|
24 | 31 | # To upload assets to the release
|
25 | 32 | contents:write
|
| 33 | +# Necessary for GCP authentication (https://github.com/google-github-actions/setup-gcloud#usage) |
| 34 | +id-token:write |
26 | 35 | steps:
|
27 | 36 | -name:Checkout
|
28 | 37 | uses:actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683# v4.2.2
|
|
38 | 47 |
|
39 | 48 | -name:Setup Nix
|
40 | 49 | uses:./.github/actions/nix-devshell
|
| 50 | + -name:Authenticate to Google Cloud |
| 51 | +id:gcloud_auth |
| 52 | +uses:google-github-actions/auth@71f986410dfbc7added4569d411d040a91dc6935# v2.1.8 |
| 53 | +with: |
| 54 | +workload_identity_provider:${{ secrets.GCP_WORKLOAD_ID_PROVIDER }} |
| 55 | +service_account:${{ secrets.GCP_SERVICE_ACCOUNT }} |
| 56 | +token_format:"access_token" |
| 57 | + |
| 58 | + -name:Setup GCloud SDK |
| 59 | +uses:google-github-actions/setup-gcloud@77e7a554d41e2ee56fc945c52dfd3f33d12def9a# v2.1.4 |
| 60 | + |
| 61 | + -name:Insert Mutagen resources |
| 62 | +run:| |
| 63 | + gsutil cp gs://coder-desktop/mutagen/v0.18.1/mutagen-agents.tar.gz "Coder Desktop/Resources/mutagen-agents.tar.gz" |
| 64 | + gsutil cp gs://coder-desktop/mutagen/v0.18.1/mutagen-darwin-amd64 "Coder Desktop/Resources/mutagen-darwin-amd64" |
| 65 | + gsutil cp gs://coder-desktop/mutagen/v0.18.1/mutagen-linux-amd64 "Coder Desktop/Resources/mutagen-linux-amd64" |
41 | 66 |
|
42 | 67 | -name:Build
|
43 | 68 | env:
|
|
51 | 76 | EXT_PROF:${{ secrets.CODER_DESKTOP_EXTENSION_PROVISIONPROFILE_B64 }}
|
52 | 77 | run:make release
|
53 | 78 |
|
| 79 | +# Upload as artifact in dry-run mode |
| 80 | + -name:Upload Build Artifact |
| 81 | +if:${{ inputs.dryrun }} |
| 82 | +uses:actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce# v3.1.2 |
| 83 | +with: |
| 84 | +name:coder-desktop-build |
| 85 | +path:${{ github.workspace }}/out |
| 86 | +retention-days:7 |
| 87 | + |
| 88 | +# Upload to release in non-dry-run mode |
54 | 89 | -name:Upload Release Assets
|
| 90 | +if:${{ !inputs.dryrun }} |
55 | 91 | run:gh release upload "$RELEASE_TAG" "$out"/* --clobber
|
56 | 92 | env:
|
57 | 93 | GH_TOKEN:${{ secrets.GITHUB_TOKEN }}
|
|
60 | 96 | update-cask:
|
61 | 97 | name:Update homebrew-coder cask
|
62 | 98 | runs-on:${{ github.repository_owner == 'coder' && 'depot-macos-latest' || 'macos-latest'}}
|
63 |
| -if:${{ github.repository_owner == 'coder' }} |
| 99 | +if:${{ github.repository_owner == 'coder'&& !inputs.dryrun}} |
64 | 100 | needs:build
|
65 | 101 | steps:
|
66 | 102 | -name:Checkout
|
|