mirror of
https://gitee.com/johng/gf
synced 2026-07-04 13:02:36 +08:00
add command make version to in Makefile (#2579)
This commit is contained in:
12
.github/workflows/tag.yml
vendored
12
.github/workflows/tag.yml
vendored
@ -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"
|
||||
|
||||
16
Makefile
16
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; \
|
||||
|
||||
Reference in New Issue
Block a user