Skip to content

Commit

Permalink
Release v3.0.36
Browse files Browse the repository at this point in the history
  • Loading branch information
dosco committed Sep 6, 2024
1 parent d3f4a1d commit 2e5884c
Show file tree
Hide file tree
Showing 10 changed files with 116 additions and 26 deletions.
2 changes: 1 addition & 1 deletion auth/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.18
require (
github.com/adjust/gorails v0.0.0-20171013043634-2786ed0c03d3
github.com/bradfitz/gomemcache v0.0.0-20230905024940-24af94b03874
github.com/dosco/graphjin/core/v3 v
github.com/dosco/graphjin/core/v3 v3.0.36
github.com/golang-jwt/jwt v3.2.2+incompatible
github.com/gomodule/redigo v1.9.2
github.com/gorilla/websocket v1.5.3
Expand Down
8 changes: 4 additions & 4 deletions cmd/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ toolchain go1.23.1
require (
github.com/brianvoe/gofakeit/v6 v6.28.0
github.com/dop251/goja v0.0.0-20240828124009-016eb7256539
github.com/dosco/graphjin/core/v3 v
github.com/dosco/graphjin/serv/v3 v
github.com/dosco/graphjin/core/v3 v3.0.36
github.com/dosco/graphjin/serv/v3 v3.0.36
github.com/gosimple/slug v1.14.0
github.com/jackc/pgx/v5 v5.6.0
github.com/jvatic/goja-babel v0.0.0-20240829121804-52a2d5a94eb5
Expand Down Expand Up @@ -45,8 +45,8 @@ require (
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect
github.com/dimchansky/utfbom v1.1.1 // indirect
github.com/dlclark/regexp2 v1.11.4 // indirect
github.com/dosco/graphjin/auth/v3 v // indirect
github.com/dosco/graphjin/plugin/otel/v3 v // indirect
github.com/dosco/graphjin/auth/v3 v3.0.36 // indirect
github.com/dosco/graphjin/plugin/otel/v3 v3.0.36 // indirect
github.com/fatih/color v1.16.0 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
Expand Down
2 changes: 1 addition & 1 deletion conf/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/dosco/graphjin/conf/v3
go 1.18

require (
github.com/dosco/graphjin/core/v3 v
github.com/dosco/graphjin/core/v3 v3.0.36
gopkg.in/yaml.v3 v3.0.1
)

Expand Down
1 change: 1 addition & 0 deletions go.work.sum
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxG
github.com/deepmap/oapi-codegen v1.10.1/go.mod h1:TvVmDQlUkFli9gFij/gtW1o+tFBr4qCHyv2zG+R0YZY=
github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
github.com/dop251/goja_nodejs v0.0.0-20211022123610-8dd9abb0616d/go.mod h1:DngW8aVqWbuLRMHItjPUyqdj+HWPvnQe8V8y1nDpIbM=
github.com/dosco/graphjin/core/v3 v3.0.35/go.mod h1:jnqpOc5MuXa1jqaok8Drlh0BAPw12IwOECspmouoABc=
github.com/elastic/elastic-transport-go/v8 v8.2.0/go.mod h1:87Tcz8IVNe6rVSLdBux1o/PEItLtyabHU3naC7IoqKI=
github.com/elastic/go-elasticsearch/v7 v7.17.10/go.mod h1:OJ4wdbtDNk5g503kvlHLyErCgQwwzmDtaFC4XyOxXA4=
github.com/elastic/go-elasticsearch/v8 v8.9.0/go.mod h1:NGmpvohKiRHXI0Sw4fuUGn6hYOmAXlyCphKpzVBiqDE=
Expand Down
2 changes: 1 addition & 1 deletion plugin/otel/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.21
toolchain go1.23.1

require (
github.com/dosco/graphjin/core/v3 v
github.com/dosco/graphjin/core/v3 v3.0.36
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.42.0
go.opentelemetry.io/otel v1.29.0
go.opentelemetry.io/otel/trace v1.29.0
Expand Down
89 changes: 89 additions & 0 deletions release.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
package main

import (
"fmt"
"os"
"os/exec"
"path/filepath"
"regexp"
)

func main() {
if len(os.Args) != 2 {
fmt.Println("Usage: go run script.go <version>")
os.Exit(1)
}

newVersion := os.Args[1]
versionRegex := regexp.MustCompile(`(github.com\/dosco\/graphjin\/[^\s]+) v[0-9]+\.[0-9]+\.[0-9]+`)
replaceFormat := "$1 v" + newVersion

err := filepath.Walk(".", func(path string, info os.FileInfo, err error) error {
if err != nil {
return err
}
if !info.IsDir() && filepath.Base(path) == "go.mod" {
fmt.Println("Processing:", path)
updateFile(path, versionRegex, replaceFormat)
}
return nil
})
if err != nil {
fmt.Println("Error walking through files:", err)
return
}

if err = gitCommands(newVersion); err != nil {
fmt.Println("Error executing git commands:", err)
}
}

func updateFile(filePath string, versionRegex *regexp.Regexp, replaceFormat string) {
input, err := os.ReadFile(filePath)
if err != nil {
fmt.Println("Failed to read file:", err)
return
}

content := string(input)
updatedContent := versionRegex.ReplaceAllString(content, replaceFormat)

if updatedContent != content {
err = os.WriteFile(filePath, []byte(updatedContent), 0644)
if err != nil {
fmt.Println("Failed to write updated content to file:", err)
}
}
}

func gitCommands(version string) error {
steps := []struct {
command string
args []string
}{
{"git", []string{"add", "."}},
{"git", []string{"commit", "-m", fmt.Sprintf("Release v%s", version)}},
{"git", []string{"tag", fmt.Sprintf("auth/v%s", version)}},
{"git", []string{"tag", fmt.Sprintf("cmd/v%s", version)}},
{"git", []string{"tag", fmt.Sprintf("conf/v%s", version)}},
{"git", []string{"tag", fmt.Sprintf("core/v%s", version)}},
{"git", []string{"tag", fmt.Sprintf("plugin/otel/v%s", version)}},
{"git", []string{"tag", fmt.Sprintf("serv/v%s", version)}},
{"git", []string{"tag", fmt.Sprintf("tests/v%s", version)}},
{"git", []string{"tag", fmt.Sprintf("wasm/v%s", version)}},
{"git", []string{"tag", fmt.Sprintf("v%s", version)}},
{"git", []string{"push", "origin", "master"}},
{"git", []string{"push", "--tags"}},
}

for _, step := range steps {
cmd := exec.Command(step.command, step.args...)
cmd.Stderr = os.Stderr
cmd.Stdout = os.Stdout
if err := cmd.Run(); err != nil {
return fmt.Errorf("%s %v failed: %w", step.command, step.args, err)
}
}

return nil
}
24 changes: 12 additions & 12 deletions release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@ find . -name 'go.mod' -exec sh -c '
done
' sh {} +

git add .
git commit -m "Release v$new_version"
# git add .
# git commit -m "Release v$new_version"

git tag auth/v$1
git tag cmd/v$1
git tag conf/v$1
git tag core/v$1
git tag plugin/otel/v$1
git tag serv/v$1
git tag tests/v$1
git tag wasm/v$1
# git tag auth/v$1
# git tag cmd/v$1
# git tag conf/v$1
# git tag core/v$1
# git tag plugin/otel/v$1
# git tag serv/v$1
# git tag tests/v$1
# git tag wasm/v$1

git tag v$1
git push --tags
# git tag v$1
# git push --tags
6 changes: 3 additions & 3 deletions serv/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ go 1.21
toolchain go1.23.1

require (
github.com/dosco/graphjin/auth/v3 v
github.com/dosco/graphjin/core/v3 v
github.com/dosco/graphjin/plugin/otel/v3 v
github.com/dosco/graphjin/auth/v3 v3.0.36
github.com/dosco/graphjin/core/v3 v3.0.36
github.com/dosco/graphjin/plugin/otel/v3 v3.0.36
github.com/fsnotify/fsnotify v1.7.0
github.com/go-http-utils/headers v0.0.0-20181008091004-fed159eddc2a
github.com/go-pkgz/expirable-cache v1.0.0
Expand Down
4 changes: 2 additions & 2 deletions tests/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ go 1.21
toolchain go1.23.1

require (
github.com/dosco/graphjin/conf/v3 v
github.com/dosco/graphjin/core/v3 v
github.com/dosco/graphjin/conf/v3 v3.0.36
github.com/dosco/graphjin/core/v3 v3.0.36
github.com/orlangure/gnomock v0.30.0
github.com/stretchr/testify v1.9.0
golang.org/x/sync v0.8.0
Expand Down
4 changes: 2 additions & 2 deletions wasm/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ module github.com/dosco/graphjin/wasm/v3
go 1.18

require (
github.com/dosco/graphjin/conf/v3 v
github.com/dosco/graphjin/core/v3 v
github.com/dosco/graphjin/conf/v3 v3.0.36
github.com/dosco/graphjin/core/v3 v3.0.36
)

require (
Expand Down

0 comments on commit 2e5884c

Please sign in to comment.