This repository was archived by the owner on Aug 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 18
139 lines (120 loc) · 3.7 KB
/
release.yaml
File metadata and controls
139 lines (120 loc) · 3.7 KB
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
name: create_github_release
on:
create:
tags: "v*"
permissions:
actions: none
checks: none
contents: read
deployments: none
issues: none
packages: none
pull-requests: none
repository-projects: none
security-events: none
statuses: none
jobs:
build:
name: Build binaries
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-go@v2
with:
go-version: '^1.16.7'
- name: Build
run: make -j build/linux build/windows
- name: Upload linux
uses: actions/upload-artifact@v3
with:
name: coder-cli-linux-amd64
path: ./ci/bin/coder-cli-linux-amd64.tar.gz
- name: Upload windows
uses: actions/upload-artifact@v3
with:
name: coder-cli-windows
path: ./ci/bin/coder-cli-windows.zip
build_darwin:
name: Build darwin binary
runs-on: macos-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install Gon
run: |
brew tap mitchellh/gon
brew install mitchellh/gon/gon
- name: Import Signing Certificates
uses: Apple-Actions/import-codesign-certs@v1
with:
p12-file-base64: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_P12_BASE64 }}
p12-password: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_PASSWORD }}
- uses: actions/setup-go@v2
with:
go-version: '^1.16.7'
- name: Build Release Assets
run: make build/macos
env:
AC_USERNAME: ${{ secrets.AC_USERNAME }}
AC_PASSWORD: ${{ secrets.AC_PASSWORD }}
- name: Upload darwin
uses: actions/upload-artifact@v3
with:
name: coder-cli-darwin-amd64
path: ./ci/bin/coder-cli-darwin-amd64.zip
draft_release:
name: Create Release
runs-on: ubuntu-20.04
needs:
- build_darwin
- build
steps:
- uses: actions/download-artifact@v2
- name: content
run: sh -c "ls -al"
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
body: ""
draft: true
prerelease: false
- name: Upload Linux Release
id: upload-linux-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: coder-cli-linux-amd64/coder-cli-linux-amd64.tar.gz
asset_name: coder-cli-linux-amd64.tar.gz
asset_content_type: application/tar+gzip
- name: Upload MacOS Release
id: upload-macos-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: coder-cli-darwin-amd64/coder-cli-darwin-amd64.zip
asset_name: coder-cli-darwin-amd64.zip
asset_content_type: application/zip
- name: Upload Windows Release
id: upload-windows-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: coder-cli-windows/coder-cli-windows.zip
asset_name: coder-cli-windows.zip
asset_content_type: application/zip