Skip to content
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
12 changes: 11 additions & 1 deletion .github/workflows/int.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,23 @@ jobs:
go mod vendor

- run: sudo go test -v
- run: go build -ldflags="-s -w" -o ./agent

- uses: goreleaser/goreleaser-action@5df302e5e9e4c66310a6b6493a8865b12c555af2
with:
distribution: goreleaser
version: latest
args: release --snapshot --clean --config releasers/int.yml

- name: Configure aws credentials
uses: aws-actions/configure-aws-credentials@ea7b857d8a33dc2fb4ef5a724500044281b49a5e
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-west-2

- run: |
ls -lahR

- run: aws s3 cp ./agent s3://step-security-agent/refs/heads/int/agent --acl public-read
- name: Integration test
uses: docker://ghcr.io/step-security/integration-test/int:latest
Expand Down
2 changes: 1 addition & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ builds:
flags:
- -trimpath
ldflags:
- -s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date=123 -X main.ReleaseTag={{.Tag}}
- -s -w -X main.version={{.Version}} -X main.ReleaseCommit={{.FullCommit}} -X main.date=123 -X main.ReleaseTag={{.Tag}} -X ain.ReleaseBranch={{.Branch}}


# Optionally override the matrix generation and specify only the final list of targets.
Expand Down
7 changes: 4 additions & 3 deletions buildinfo.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ import "fmt"

// filled through ldflags
var (
ReleaseTag = ""
commit = ""
ReleaseTag = ""
ReleaseBranch = ""
ReleaseCommit = ""
)

func LogBuildInfo() {
WriteLog(fmt.Sprintf("[buildInfo] tag=%s commit=%s \n", ReleaseTag, commit))
WriteLog(fmt.Sprintf("[buildInfo] tag=%s commit=%s branch=%s \n", ReleaseTag, ReleaseCommit, ReleaseBranch))
}
28 changes: 28 additions & 0 deletions releasers/int.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# .goreleaser.yml
builds:
# You can have multiple builds defined as a yaml list
-
# GOOS list to build for.
# For more info refer to: https://golang.org/doc/install/source#environment
# Defaults are darwin and linux.
goos:
- linux

# GOARCH to build for.
# For more info refer to: https://golang.org/doc/install/source#environment
# Defaults are 386, amd64 and arm64.
goarch:
- amd64

mod_timestamp: '123'
flags:
- -trimpath
ldflags:
- -s -w -X main.version={{.Version}} -X main.commit={{.FullCommit}} -X main.date=123 -X main.ReleaseTag=int -X main.ReleaseBranch=int -X main.ReleaseCommit={{.FullCommit}}


# Optionally override the matrix generation and specify only the final list of targets.
# Format is `{goos}_{goarch}` with optionally a suffix with `_{goarm}` or `_{gomips}`.
# This overrides `goos`, `goarch`, `goarm`, `gomips` and `ignores`.
targets:
- linux_amd64