-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add goreleaser build * Add post build hook, add goreleaser to install-tools * create separate post-build script so globbing works On another note, the sed stuff was entirely unneccessary, Probably an artifact of some older build process. * add release workflow for github actions * enable github release * remove github release publish from circleci * modify postscript to include plugins * github workflow name should be release * pin goreleaser version, check for latest go * revert build target changes * bump goreleaser version to v1.5.0
- Loading branch information
1 parent
3b23e5c
commit ed8843f
Showing
8 changed files
with
739 additions
and
31 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
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,30 @@ | ||
name: release | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
|
||
jobs: | ||
release: | ||
runs-on: "ubuntu-20.04" | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
# Required for goreleaser changelog to work properly | ||
fetch-depth: 0 | ||
- name: Set up Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.17 | ||
check-latest: true | ||
- name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v2 | ||
with: | ||
distribution: goreleaser | ||
version: "v1.5.0" | ||
args: release --rm-dist | ||
env: | ||
# Default github token should have enough permissions to make a release | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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,46 @@ | ||
builds: | ||
- id: stanza | ||
binary: stanza_{{ .Os }}_{{ .Arch }} | ||
main: ./cmd/stanza | ||
env: | ||
- CGO_ENABLED=0 | ||
flags: | ||
-tags=timetzdata | ||
mod_timestamp: '{{ .CommitTimestamp }}' | ||
goos: | ||
- windows | ||
- linux | ||
- darwin | ||
goarch: | ||
- amd64 | ||
- arm64 | ||
ignore: | ||
- goos: windows | ||
goarch: arm64 | ||
ldflags: | ||
- -X github.com/observiq/stanza/version.GitTag={{ .Tag }} | ||
- -X github.com/observiq/stanza/version.GitCommit={{ .FullCommit }} | ||
no_unique_dist_dir: true | ||
hooks: | ||
post: ./build/post.sh | ||
|
||
archives: | ||
- builds: | ||
- stanza | ||
# skip archiving as tar.gz / zip | ||
format: binary | ||
|
||
checksum: | ||
name_template: '{{ .ProjectName }}-v{{ .Version }}-SHA256SUMS' | ||
algorithm: sha256 | ||
|
||
release: | ||
github: | ||
owner: observIQ | ||
name: stanza | ||
|
||
changelog: | ||
skip: false | ||
use: github | ||
|
||
dist: artifacts |
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 |
---|---|---|
|
@@ -19,6 +19,7 @@ install-tools: | |
cd $(TOOLS_MOD_DIR) && go install github.com/uw-labs/lichen | ||
cd $(TOOLS_MOD_DIR) && go install golang.org/x/tools/go/analysis/passes/fieldalignment/cmd/fieldalignment | ||
cd $(TOOLS_MOD_DIR) && go install github.com/observiq/amazon-log-agent-benchmark-tool/cmd/logbench | ||
cd $(TOOLS_MOD_DIR) && go install github.com/goreleaser/goreleaser | ||
cd $(TOOLS_MOD_DIR) && go install github.com/securego/gosec/v2/cmd/[email protected] | ||
|
||
.PHONY: scan-license | ||
|
@@ -134,6 +135,10 @@ build-linux-arm64: | |
build-windows-amd64: | ||
@GOOS=windows GOARCH=amd64 $(MAKE) build | ||
|
||
.PHONY: release-test | ||
release-test: install-tools | ||
goreleaser release --rm-dist --skip-publish --skip-announce --skip-validate | ||
|
||
.PHONY: for-all | ||
for-all: | ||
@set -e; for dir in $(ALL_MODULES); do \ | ||
|
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,20 @@ | ||
#!/bin/sh | ||
# This script is the post-build script for goreleaser. | ||
# Because it is run for each bbinary built, and global post-release hooks are | ||
# not available in the OSS version, we check for file existence to avoid multiple downloads/copies. | ||
|
||
if [ ! -f ./artifacts/stanza-plugins.tar.gz ]; then | ||
curl -fL https://github.com/observiq/stanza-plugins/releases/latest/download/stanza-plugins.tar.gz -o ./artifacts/stanza-plugins.tar.gz | ||
fi | ||
if [ ! -f ./artifacts/stanza-plugins.zip ]; then | ||
curl -fL https://github.com/observiq/stanza-plugins/releases/latest/download/stanza-plugins.tar.gz -o ./artifacts/stanza-plugins.tar.gz | ||
fi | ||
if [ ! -f ./artifacts/version.json ]; then | ||
curl -fL https://github.com/observiq/stanza-plugins/releases/latest/download/version.json -o ./artifacts/version.json | ||
fi | ||
if [ ! -f ./artifacts/unix-install.sh ]; then | ||
cp ./scripts/unix-install.sh ./artifacts/unix-install.sh | ||
fi | ||
if [ ! -f ./artifacts/windows-install.ps1 ]; then | ||
cp ./scripts/windows-install.ps1 ./artifacts/windows-install.ps1 | ||
fi |
Oops, something went wrong.