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

chore(ci): fix release workflow #132

Merged
merged 4 commits into from
Jul 23, 2024
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.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Release

on:
push:
paths:
- "VERSION"

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: "1.21"

- name: Build
run: go build -v ./...

- name: Create Release
env:
GH_TOKEN: ${{ github.token }}
run: |
version="v$(cat VERSION)"
if gh release view ${version} > /dev/null 2>&1; then
echo "Release ${version} already exists. Skipping release creation."
else
echo "Creating release ${version}."
gh release create ${version} --generate-notes
fi
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.6.8
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ require (
github.com/avast/retry-go v3.0.0+incompatible
github.com/google/uuid v1.3.0
github.com/pkg/errors v0.9.1
github.com/shopspring/decimal v1.3.1
github.com/sirupsen/logrus v1.9.0
github.com/stretchr/testify v1.8.4
github.com/test-go/testify v1.1.4
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5gKV8=
github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o=
github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0=
github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
Expand Down
11 changes: 7 additions & 4 deletions restful.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,14 @@ const (
Kill
)

type ContextKey string

const (
ContextKeyQueryID string = "X-DATABEND-QUERY-ID"
ContextUserAgentID string = "USER-AGENT"
EMPTY_FIELD_AS string = "empty_field_as"
PURGE string = "purge"
ContextKeyQueryID ContextKey = "X-DATABEND-QUERY-ID"
ContextUserAgentID ContextKey = "USER-AGENT"

EMPTY_FIELD_AS string = "empty_field_as"
PURGE string = "purge"
)

type PresignedResponse struct {
Expand Down
3 changes: 1 addition & 2 deletions tests/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: '3'
services:
minio:
image: docker.io/minio/minio
Expand All @@ -7,7 +6,7 @@ services:
volumes:
- ./data:/data
databend:
image: datafuselabs/databend:v1.2.367-nightly
image: datafuselabs/databend
environment:
- QUERY_DEFAULT_USER=databend
- QUERY_DEFAULT_PASSWORD=databend
Expand Down
7 changes: 6 additions & 1 deletion version.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
package godatabend

var version = "0.6.6"
import (
_ "embed"
)

//go:embed VERSION
var version string
16 changes: 16 additions & 0 deletions version_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package godatabend

import (
"os"
"testing"

"github.com/stretchr/testify/require"
)

func TestVersion(t *testing.T) {
r := require.New(t)
content, err := os.ReadFile("VERSION")
r.NoError(err)

r.Equal(string(content), version)
}