From 04e0fa2e78c4309da1c198cc6badbb78c467aa59 Mon Sep 17 00:00:00 2001 From: Andrew Gouin Date: Mon, 3 Jan 2022 17:08:51 -0700 Subject: [PATCH] Merge PR #44: Add CD * Add CD * Update LDFLAGS to correct package --- .github/workflows/release.yml | 29 +++++++++++++++++++++++++++++ .goreleaser.yaml | 25 +++++++++++++++++++++++++ CHANGELOG.md | 1 + 3 files changed, 55 insertions(+) create mode 100644 .github/workflows/release.yml create mode 100644 .goreleaser.yaml create mode 100644 CHANGELOG.md diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..b910b6e8 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,29 @@ +name: "(WARNING: ALPHA SOFTWARE)" + +on: + push: + tags: + - "v[0-9]+.[0-9]+.[0-9]+" # Push events to matching v*, i.e. v1.0, v20.15.10 + +jobs: + goreleaser: + runs-on: ubuntu-20.04 + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: 1.15 + + - run: echo https://github.com/strangelove-ventures/lens/blob/${GITHUB_REF#refs/tags/}/CHANGELOG.md#${GITHUB_REF#refs/tags/} > ../release_notes.md + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v2 + with: + version: latest + args: release --rm-dist --release-notes=../release_notes.md + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 00000000..8ec12072 --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,25 @@ +project_name: Lens + +env: + # Require use of Go modules. + - GO111MODULE=on + +builds: + - id: "lens" + main: ./main.go + ldflags: + - -X github.com/strangelove-ventures/lens/cmd/cmd.Version={{ .Tag }} + - -X github.com/strangelove-ventures/lens/cmd/cmd.Commit={{ .FullCommit }} + goos: + - darwin + - linux + goarch: + - amd64 + - arm64 + +checksum: + name_template: SHA256SUMS-{{.Version}}.txt + algorithm: sha256 + +release: + name_template: "{{ .Version }} - (WARNING: ALPHA SOFTWARE)" diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..30404ce4 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1 @@ +TODO \ No newline at end of file