diff --git a/.github/workflows/buildx.yaml b/.github/workflows/buildx.yml similarity index 100% rename from .github/workflows/buildx.yaml rename to .github/workflows/buildx.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 135e536..e607201 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -15,17 +15,17 @@ jobs: goreleaser: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 - run: git fetch --force --tags - - uses: actions/setup-go@v3 + - uses: actions/setup-go@v4 with: go-version: '1.21' cache: true # More assembly might be required: Docker logins, GPG, etc. It all depends # on your needs. - - uses: goreleaser/goreleaser-action@v4 + - uses: goreleaser/goreleaser-action@v5 with: # either 'goreleaser' (default) or 'goreleaser-pro': distribution: goreleaser diff --git a/.github/workflows/trigger-nightly.yml b/.github/workflows/trigger-nightly.yml new file mode 100644 index 0000000..25446a3 --- /dev/null +++ b/.github/workflows/trigger-nightly.yml @@ -0,0 +1,43 @@ +name: Trigger nightly build + +on: + schedule: + # * is a special character in YAML, so you have to quote this string + - cron: '00 20 * * *' + workflow_dispatch: + +jobs: + trigger-nightly: + name: Push tag for nightly build + runs-on: ubuntu-latest + steps: + - + name: 'Checkout' + uses: actions/checkout@v4 + with: + token: ${{ secrets.GITHUB_TOKEN }} + fetch-depth: 0 + - + name: 'Push new tag' + run: | + git config user.name "${GITHUB_ACTOR}" + git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" + + # A previous release was created using a lightweight tag + # git describe by default includes only annotated tags + # git describe --tags includes lightweight tags as well + DESCRIBE=`git tag -l --sort=-v:refname | grep -v nightly | head -n 1` + MAJOR_VERSION=`echo $DESCRIBE | awk '{split($0,a,"."); print a[1]}'` + MINOR_VERSION=`echo $DESCRIBE | awk '{split($0,a,"."); print a[2]}'` + # MINOR_VERSION="$((${MINOR_VERSION} + 1))" + TAG="${MAJOR_VERSION}.${MINOR_VERSION}.0-nightly.$(date +'%Y%m%d')" + git tag -a $TAG -m "$TAG: nightly build" + git push origin $TAG + - name: 'Clean up nightly releases' + uses: dev-drprasad/delete-older-releases@v0.3.2 + with: + keep_latest: 3 + delete_tags: true + delete_tag_pattern: nightly + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.goreleaser.yaml b/.goreleaser.yaml index fb79690..52ed7d4 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -34,6 +34,8 @@ builds: - windows_amd64 - windows_amd64_v3 - windows_arm64 + ldflags: + - "-s -w -X 'main.version={{ .Tag }}'" archives: - format: tar.gz diff --git a/cmd/gost/cmd.go b/cmd/gost/cmd.go index f95db5e..6b64449 100644 --- a/cmd/gost/cmd.go +++ b/cmd/gost/cmd.go @@ -501,7 +501,7 @@ func buildNodeConfig(url *url.URL) (*config.NodeConfig, error) { delete(m, "secure") delete(m, "serverName") - if !tlsConfig.Secure && tlsConfig.CertFile == "" && tlsConfig.CAFile == "" { + if !tlsConfig.Secure && tlsConfig.CertFile == "" && tlsConfig.CAFile == "" && tlsConfig.ServerName == "" { tlsConfig = nil } diff --git a/cmd/gost/version.go b/cmd/gost/version.go index bf5191d..e986697 100644 --- a/cmd/gost/version.go +++ b/cmd/gost/version.go @@ -1,5 +1,5 @@ package main -const ( - version = "3.0.0-rc10" +var ( + version = "3.0.0" )