Skip to content
This repository was archived by the owner on Aug 30, 2024. It is now read-only.

Add notarization of MacOS binary to CI #173

Merged
merged 2 commits into from
Nov 3, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
Add notarization of MacOS binary to CI
  • Loading branch information
kylecarbs committed Nov 3, 2020
commit a900f7c3cc29ae00789def7528cdc8e90e6bb00c
9 changes: 9 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v1
- 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 }}
- name: Build
run: ./ci/steps/build.sh
- name: Upload
Expand Down
10 changes: 10 additions & 0 deletions ci/gon.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"source": ["./coder"],
"bundle_id": "com.coder.cli",
"sign": {
"application_identity": "3C4F31D15F9D57461A8D7D0BD970D23CE1F7C2BE"
},
"zip": {
"output_path": "coder.zip"
}
}
26 changes: 18 additions & 8 deletions ci/steps/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,26 @@ build() {

tmpdir=$(mktemp -d)
go build -ldflags "-X cdr.dev/coder-cli/internal/version.Version=${tag}" -o "$tmpdir/coder" ../../cmd/coder
# For MacOS builds to be notarized.
cp ../gon.json $tmpdir/gon.json

pushd "$tmpdir"
if [[ "$GOOS" == "windows" ]]; then
artifact="coder-cli-$GOOS-$GOARCH.zip"
mv coder coder.exe
zip "$artifact" coder.exe
else
artifact="coder-cli-$GOOS-$GOARCH.tar.gz"
tar -czf "$artifact" coder
fi
case "$GOOS" in
"windows")
artifact="coder-cli-$GOOS-$GOARCH.zip"
mv coder coder.exe
zip "$artifact" coder.exe
;;
"linux")
artifact="coder-cli-$GOOS-$GOARCH.tar.gz"
tar -czf "$artifact" coder
;;
"darwin")
artifact="coder-cli-$GOOS-$GOARCH.zip"
gon -log-level debug ./gon.json
mv coder.zip $artifact
;;
esac
popd

mkdir -p ../bin
Expand Down