diff --git a/.github/workflows/go-release.yml b/.github/workflows/go-release.yml index f8f9471..941ba80 100644 --- a/.github/workflows/go-release.yml +++ b/.github/workflows/go-release.yml @@ -12,8 +12,7 @@ jobs: outputs: releases_created: ${{ steps.release-please.outputs.releases_created }} - tag_name: ${{ steps.release-please.outputs[format('{0}--tag_name', steps.get-path.outputs.path)] }} - path: ${{ steps.get-path.outputs.path }} + #tag_name: ${{ steps.release-please.outputs[format('{0}--tag_name', steps.get-path.outputs.path)] }} steps: - name: Release Please @@ -22,12 +21,7 @@ jobs: with: config-file: .release-please/release-please-config.json manifest-file: .release-please/.release-please-manifest.json - - - name: Get Path - id: get-path - if: ${{ steps.release-please.outputs.releases_created == 'true' }} - run: | - echo "path=${{ fromJson(steps.release-please.outputs.paths_released)[0] }}" >> $GITHUB_OUTPUT + skip-github-release: false goreleaser: runs-on: ubuntu-latest @@ -50,6 +44,7 @@ jobs: - name: Run GoReleaser uses: goreleaser/goreleaser-action@v4 with: + workdir: src/ version: latest args: release --clean env: diff --git a/.release-please/.release-please-manifest.json b/.release-please/.release-please-manifest.json index f7febeb..c49bf91 100644 --- a/.release-please/.release-please-manifest.json +++ b/.release-please/.release-please-manifest.json @@ -1,3 +1,3 @@ { - "src": "0.1.10" + "src": "0.2.0" } \ No newline at end of file diff --git a/.release-please/release-please-config.json b/.release-please/release-please-config.json index 7e981fc..a5b878c 100644 --- a/.release-please/release-please-config.json +++ b/.release-please/release-please-config.json @@ -1,10 +1,10 @@ { - "release-type": "simple", "pull-request-title-pattern": "chore${scope}: 🔖 release${component} ${version}", "separate-pull-requests": true, "packages": { "src": { - "package-name": "kook-go" + "release-type": "go", + "include-v-in-tag": true } } } \ No newline at end of file diff --git a/src/.goreleaser.yml b/src/.goreleaser.yml index 25c2f19..d26380d 100644 --- a/src/.goreleaser.yml +++ b/src/.goreleaser.yml @@ -6,6 +6,7 @@ before: release: draft: true discussion_category_name: General + replace_existing_artifacts: true builds: - main: example/example.go id: kook-go diff --git a/src/common/config.go b/src/common/config.go index 2804646..714e3dc 100644 --- a/src/common/config.go +++ b/src/common/config.go @@ -18,8 +18,7 @@ var defaultConf = &Config{ Compress: true, } -func ReadConfig() *Config { - +func ReadConfig(configPath string) *Config { configData, err := os.ReadFile(configPath) if err != nil { if os.IsNotExist(err) { @@ -37,3 +36,7 @@ func ReadConfig() *Config { } return conf } + +func ReadDefaultConfig() *Config { + return ReadConfig(configPath) +} diff --git a/src/core/action/action_test.go b/src/core/action/action_test.go index ce24e19..e4f51dd 100644 --- a/src/core/action/action_test.go +++ b/src/core/action/action_test.go @@ -8,7 +8,7 @@ import ( ) func Init() { - config := common.ReadConfig() + config := common.ReadConfig("./../../conf.json") helper.InitHelper(config.BotToken) common.InitLogger() } diff --git a/src/example/example.go b/src/example/example.go index 5e9151e..372bdbe 100644 --- a/src/example/example.go +++ b/src/example/example.go @@ -12,7 +12,7 @@ import ( func main() { common.InitLogger() - config := common.ReadConfig() + config := common.ReadDefaultConfig() globalSession, err := session.CreateSession(config.BotToken, config.Compress) if err != nil {