-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
59d20f4
commit 55131b7
Showing
13 changed files
with
148 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: Lint | ||
|
||
on: [push] | ||
|
||
jobs: | ||
lint: | ||
name: Lint the code | ||
runs-on: ubuntu-latest | ||
container: golang:1.16 | ||
|
||
steps: | ||
- name: Check out repository code | ||
uses: actions/checkout@master | ||
|
||
- name: Check formatting using gofmt | ||
run: gofmt -s -l -d . | ||
|
||
- name: Check for suspicious constructs using "go vet" | ||
run: go vet ./... | ||
|
||
- name: Lint the code using "golint" | ||
run: go get -u golang.org/x/lint/golint && golint -set_exit_status ./... | ||
|
||
- name: Run staticcheck | ||
run: go get -u honnef.co/go/tools/cmd/staticcheck && staticcheck ./... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: Release | ||
|
||
on: | ||
push: { tags: ["v*"] } | ||
|
||
jobs: | ||
release: | ||
name: Release new version | ||
runs-on: ubuntu-latest | ||
container: golang:1.16 | ||
|
||
steps: | ||
- name: Check out repository code | ||
uses: actions/checkout@master | ||
|
||
- name: Build release | ||
run: make release | ||
|
||
- name: Release | ||
uses: docker://antonyurchenko/git-release:latest | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
DRAFT_RELEASE: "true" | ||
PRE_RELEASE: "false" | ||
CHANGELOG_FILE: "none" | ||
ALLOW_EMPTY_CHANGELOG: "true" | ||
ALLOW_TAG_PREFIX: "true" | ||
RELEASE_NAME_PREFIX: "Release " | ||
with: | ||
args: | | ||
./build/spacelift-cli-darwin-amd64.tar.gz | ||
./build/spacelift-cli-darwin-arm64.tar.gz | ||
./build/spacelift-cli-linux-amd64.tar.gz | ||
./build/spacelift-cli-linux-arm64.tar.gz | ||
./build/spacelift-cli-windows-amd64.tar.gz | ||
./LICENSE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: Security | ||
|
||
on: | ||
push: { branches: [main] } | ||
pull_request: { branches: [main] } | ||
schedule: | ||
- cron: "19 7 * * 0" | ||
|
||
jobs: | ||
codeql: | ||
name: Analyze | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@v1 | ||
with: | ||
languages: "go" | ||
|
||
- name: Autobuild | ||
uses: github/codeql-action/autobuild@v1 | ||
|
||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@v1 | ||
|
||
|
||
gosec: | ||
name: GoSec | ||
runs-on: ubuntu-latest | ||
env: | ||
GO111MODULE: on | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Run GoSec Security Scanner | ||
uses: securego/gosec@master | ||
with: | ||
args: "-severity=medium -no-fail -fmt sarif -out gosec-results.sarif ./..." | ||
|
||
- name: Upload GoSec scan results to GitHub Security tab | ||
uses: github/codeql-action/upload-sarif@v1 | ||
with: | ||
sarif_file: "gosec-results.sarif" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,3 +11,4 @@ spacelift-cli | |
|
||
# Output of the go coverage tool, specifically when used with LiteIDE | ||
*.out | ||
build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
BINARY := spacelift-cli | ||
PKG := github.com/spacelift-io/spacelift-cli/cmd | ||
BUILD_FLAGS := -a -tags netgo -ldflags '-w -extldflags "-static"' | ||
|
||
darwin: | ||
env GOOS=darwin GOARCH=amd64 CGO_ENABLED=0 go build $(BUILD_FLAGS) -o build/$(BINARY)-darwin-amd64 $(PKG) | ||
env GOOS=darwin GOARCH=arm64 CGO_ENABLED=0 go build $(BUILD_FLAGS) -o build/$(BINARY)-darwin-arm64 $(PKG) | ||
|
||
linux: | ||
env GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build $(BUILD_FLAGS) -o build/$(BINARY)-linux-amd64 $(PKG) | ||
env GOOS=linux GOARCH=arm64 CGO_ENABLED=0 go build $(BUILD_FLAGS) -o build/$(BINARY)-linux-arm64 $(PKG) | ||
|
||
windows: | ||
env GOOS=windows GOARCH=amd64 CGO_ENABLED=0 go build $(BUILD_FLAGS) -o build/$(BINARY)-windows-amd64 $(PKG) | ||
|
||
build: darwin linux windows | ||
|
||
release: build | ||
cd build; tar -czf $(BINARY)-darwin-amd64.tar.gz $(BINARY)-darwin-amd64 | ||
cd build; tar -czf $(BINARY)-darwin-arm64.tar.gz $(BINARY)-darwin-arm64 | ||
cd build; tar -czf $(BINARY)-linux-amd64.tar.gz $(BINARY)-linux-amd64 | ||
cd build; tar -czf $(BINARY)-linux-arm64.tar.gz $(BINARY)-linux-amd64 | ||
cd build; tar -czf $(BINARY)-windows-amd64.tar.gz $(BINARY)-windows-amd64 | ||
|
||
clean: | ||
go clean | ||
rm -rf build/$(BINARY)* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters