-
Notifications
You must be signed in to change notification settings - Fork 2
86 lines (74 loc) · 2.97 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: release
on:
push:
branches:
- main
release:
types: [published]
permissions: {}
# Cancel in-progress runs for when multiple PRs get merged
# in quick succession. Ignore this for tag releases though.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ !contains(github.ref, 'tags/')}}
jobs:
build:
name: Build Coder Desktop
runs-on: ${{ github.repository_owner == 'coder' && 'depot-macos-latest' || 'macos-latest'}}
if: ${{ github.repository_owner == 'coder' }}
permissions:
# To upload assets to the release
contents: write
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
fetch-tags: true
persist-credentials: false
- name: Switch XCode Version
uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd # v1.6.0
with:
xcode-version: "16.0.0"
- name: Setup Nix
uses: ./.github/actions/nix-devshell
- name: Build
env:
APPLE_DEVELOPER_ID_PKCS12_B64: ${{ secrets.APPLE_DEVELOPER_ID_PKCS12_B64 }}
APPLE_DEVELOPER_ID_PKCS12_PASSWORD: ${{ secrets.APPLE_DEVELOPER_ID_PKCS12_PASSWORD }}
APPLE_INSTALLER_PKCS12_B64: ${{ secrets.APPLE_INSTALLER_PKCS12_B64 }}
APPLE_INSTALLER_PKCS12_PASSWORD: ${{ secrets.APPLE_INSTALLER_PKCS12_PASSWORD }}
APPLE_ID: ${{ secrets.APPLE_NOTARYTOOL_USERNAME }}
APPLE_ID_PASSWORD: ${{ secrets.APPLE_NOTARYTOOL_PASSWORD }}
APP_PROF: ${{ secrets.CODER_DESKTOP_APP_PROVISIONPROFILE_B64 }}
EXT_PROF: ${{ secrets.CODER_DESKTOP_EXTENSION_PROVISIONPROFILE_B64 }}
run: make release
- name: Upload Release Assets
run: gh release upload "$RELEASE_TAG" "$out"/* --clobber
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RELEASE_TAG: ${{ github.event_name == 'release' && github.event.release.tag_name || 'preview' }}
update-cask:
name: Update homebrew-coder cask
runs-on: ${{ github.repository_owner == 'coder' && 'depot-macos-latest' || 'macos-latest'}}
if: ${{ github.repository_owner == 'coder' }}
needs: build
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
fetch-tags: true
persist-credentials: false
- name: Setup Nix
uses: ./.github/actions/nix-devshell
- name: Update homebrew-coder
env:
GH_TOKEN: ${{ secrets.CODERCI_GITHUB_TOKEN }}
RELEASE_TAG: ${{ github.event_name == 'release' && github.event.release.tag_name || 'preview' }}
ASSIGNEE: ${{ github.actor }}
run: |
git config --global user.email "[email protected]"
git config --global user.name "Coder CI"
gh auth setup-git
./scripts/update-cask.sh --version "$RELEASE_TAG" --assignee "$ASSIGNEE"