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

chore: update build settings for coder-cli #420

Merged
merged 3 commits into from
Aug 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
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
45 changes: 40 additions & 5 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,44 +1,79 @@
name: build
on: [push]

on:
push:
branches:
- main

pull_request:
branches:
- main

workflow_dispatch:

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:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v1
uses: actions/checkout@v2
with:
fetch-depth: 0

- uses: actions/setup-go@v2
with:
go-version: '^1.16.3'
go-version: '^1.16.7'

- name: Build
run: make -j build/linux build/windows

- name: Upload
uses: actions/upload-artifact@v2
with:
name: coder-cli
path: ./ci/bin/coder-cli-*

build_darwin:
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v1
uses: actions/checkout@v2
with:
fetch-depth: 0

- uses: actions/setup-go@v2
with:
go-version: '^1.16.3'
go-version: '^1.16.7'

- 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: make build/macos
env:
AC_USERNAME: ${{ secrets.AC_USERNAME }}
AC_PASSWORD: ${{ secrets.AC_PASSWORD }}

- name: Upload
uses: actions/upload-artifact@v2
with:
Expand Down
33 changes: 30 additions & 3 deletions .github/workflows/integration.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,30 @@
name: integration

on:
push:
branches:
- main

pull_request:
branches:
- main

schedule:
- cron: '*/180 * * * *'
- cron: '*/180 * * * *'

workflow_dispatch:

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:
integration:
Expand All @@ -12,15 +34,20 @@ jobs:
CODER_EMAIL: ${{ secrets.CODER_EMAIL }}
CODER_PASSWORD: ${{ secrets.CODER_PASSWORD }}
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
with:
fetch-depth: 0

- uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-

- uses: actions/setup-go@v2
with:
go-version: '^1.14'
go-version: '^1.16.7'

- name: integration tests
run: ./ci/scripts/integration.sh
40 changes: 37 additions & 3 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,57 +1,86 @@
name: create_github_release

on:
create:
tags: "v*"
name: create_github_release

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.3'
go-version: '^1.16.7'

- name: Build
run: make -j build/linux build/windows

- name: Upload linux
uses: actions/upload-artifact@v2
with:
name: coder-cli-linux-amd64
path: ./ci/bin/coder-cli-linux-amd64.tar.gz

- name: Upload windows
uses: actions/upload-artifact@v2
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.3'
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@v2
with:
name: coder-cli-darwin-amd64
path: ./ci/bin/coder-cli-darwin-amd64.zip

draft_release:
name: Create Release
runs-on: ubuntu-20.04
Expand All @@ -60,8 +89,10 @@ jobs:
- 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
Expand All @@ -73,6 +104,7 @@ jobs:
body: ""
draft: true
prerelease: false

- name: Upload Linux Release
id: upload-linux-release-asset
uses: actions/upload-release-asset@v1
Expand All @@ -83,6 +115,7 @@ jobs:
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
Expand All @@ -93,6 +126,7 @@ jobs:
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
Expand Down
24 changes: 23 additions & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
name: test
on: [push]

on:
push:
branches:
- main

pull_request:
branches:
- main

workflow_dispatch:

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:
fmt:
Expand Down