diff --git a/.github/workflows/tag.yml b/.github/workflows/tag.yml index 44fa2be17..34c82e574 100644 --- a/.github/workflows/tag.yml +++ b/.github/workflows/tag.yml @@ -19,18 +19,6 @@ jobs: - name: Checkout Github Code uses: actions/checkout@v3 -# - name: Update Dependencies -# run: make gftidy -# -# - name: Commit & Push Changes -# uses: actions-js/push@master -# with: -# github_token: ${{ secrets.GITHUB_TOKEN }} -# branch: master -# author_name: TagRobot -# author_email: tagrobot@goframe.org -# message: "auto update version to ${{ github.ref_name }}" - - name: Auto Creating Tags For Contrib Packages run: | git config --global user.email "tagrobot@goframe.org" diff --git a/Makefile b/Makefile index 0a2a9441c..4db418ccc 100644 --- a/Makefile +++ b/Makefile @@ -15,12 +15,20 @@ tidy: lint: golangci-lint run -gftidy: +# make version to=v2.4.0 +version: $(eval files=$(shell find . -name go.mod)) @set -e; \ - # GITHUB_REF_NAME=v2.4.0; \ - if [[ $$GITHUB_REF_NAME =~ "v" ]]; then \ - latestVersion=$$GITHUB_REF_NAME; \ + newVersion=$(to); \ + echo "The version will be set to $$newVersion"; \ + if [[ $$newVersion =~ "v" ]]; then \ + latestVersion=$$newVersion; \ + echo "package gf" > version.go; \ + echo "" >> version.go; \ + echo "const (" >> version.go; \ + echo -e "\t// VERSION is the current GoFrame version." >> version.go; \ + echo -e "\tVERSION = \"$$latestVersion\"" >> version.go; \ + echo ")" >> version.go; \ else \ latestVersion=latest; \ fi; \