Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Goreleaser #24

Merged
merged 4 commits into from
Sep 21, 2022
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
33 changes: 33 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: release

on:
push:
tags:
- v*

permissions:
contents: write

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.18

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v3
with:
distribution: goreleaser
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29 changes: 29 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
builds:
- main: ./cmd/connector/main.go
goos:
- darwin
- linux
- windows
env:
- CGO_ENABLED=0
ldflags:
- "-s -w -X 'github.com/conduitio/conduit-connector-generator.version={{ .Tag }}'"
checksum:
name_template: checksums.txt
archives:
- replacements:
darwin: Darwin
linux: Linux
windows: Windows
386: i386
amd64: x86_64
changelog:
sort: asc
use: github
filters:
exclude:
- '^docs:'
- '^test:'
- '^go.mod:'
- '^.github:'
- Merge branch
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
.PHONY: build test

VERSION=$(shell git describe --tags --dirty --always)

build:
go build -o conduit-connector-generator cmd/generator/main.go
go build -ldflags "-X 'github.com/conduitio/conduit-connector-generator.version=${VERSION}'" -o conduit-connector-generator cmd/connector/main.go

test:
go test $(GOTEST_FLAGS) -race ./...
Expand Down
File renamed without changes.
7 changes: 6 additions & 1 deletion spec.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,18 @@ import (
sdk "github.com/conduitio/conduit-connector-sdk"
)

// version is set during the build process (i.e. the Makefile).
// It follows Go's convention for module version, where the version
// starts with the letter v, followed by a semantic version.
var version = "v0.0.0-dev"

// Specification returns the Plugin's Specification.
func Specification() sdk.Specification {
return sdk.Specification{
Name: "generator",
Summary: "Generator plugin",
Description: "A plugin capable of generating dummy records (in JSON format).",
Version: "v0.1.0",
Version: version,
Author: "Meroxa, Inc.",
}
}