From 74a931bf8ffc996c0ada6d982b68361824185f8a Mon Sep 17 00:00:00 2001 From: Markson Hon Date: Wed, 19 Jun 2024 20:11:52 +0800 Subject: [PATCH] Fix version number --- .github/workflows/beta_release_main.yml | 6 ++---- .github/workflows/pull_request.yml | 2 +- .github/workflows/release_main.yml | 11 +++++++---- .github/workflows/test_build_main.yml | 16 ++++++++++------ 4 files changed, 20 insertions(+), 15 deletions(-) diff --git a/.github/workflows/beta_release_main.yml b/.github/workflows/beta_release_main.yml index 5c72f24832..b02e923d51 100644 --- a/.github/workflows/beta_release_main.yml +++ b/.github/workflows/beta_release_main.yml @@ -415,11 +415,9 @@ jobs: - name: Check Version id: prep env: - REF: ${{ github.ref }} - shell: bash + REF: ${{ inputs.tag }} run: | - echo "P_DIR=$(pwd)" >> $GITHUB_OUTPUT - tag=$(git describe --tags $(git rev-list --tags --max-count=1)) + tag=${{ inputs.tag }} version=${tag:1} echo "VERSION=$version" >> $GITHUB_OUTPUT echo "VERSION=$version" >> $GITHUB_ENV diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 52c47f0e00..15f174f2fb 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -81,4 +81,4 @@ jobs: - name: Upload Zip File to Artifacts uses: nanoufo/action-upload-artifacts-and-release-assets@v2 with: - path: v2raya_bin/* \ No newline at end of file + path: v2raya_bin/* diff --git a/.github/workflows/release_main.yml b/.github/workflows/release_main.yml index ff02741ce2..43664a200c 100644 --- a/.github/workflows/release_main.yml +++ b/.github/workflows/release_main.yml @@ -60,7 +60,8 @@ jobs: env: REF: ${{ inputs.tag }} run: | - version=${REF} + tag=${{ inputs.tag }} + version=${tag:1} echo "VERSION=$version" >> $GITHUB_OUTPUT echo "VERSION=$version" >> $GITHUB_ENV - name: Set up Go @@ -149,7 +150,8 @@ jobs: env: REF: ${{ inputs.tag }} run: | - version=${REF} + tag=${{ inputs.tag }} + version=${tag:1} echo "VERSION=$version" >> $GITHUB_OUTPUT echo "VERSION=$version" >> $GITHUB_ENV - name: Set up Go @@ -204,7 +206,7 @@ jobs: env: REF: ${{ inputs.tag }} run: | - version=${REF} + version=${{ inputs.tag }} echo "VERSION=$version" >> $GITHUB_OUTPUT echo "VERSION=$version" >> $GITHUB_ENV - name: Download Artifact Windows x64 @@ -877,7 +879,8 @@ jobs: env: REF: ${{ inputs.tag }} run: | - version=${REF} + tag=${{ inputs.tag }} + version=${tag:1} echo "VERSION=$version" >> $GITHUB_OUTPUT echo "VERSION=$version" >> $GITHUB_ENV - name: Submit to Microsoft winget diff --git a/.github/workflows/test_build_main.yml b/.github/workflows/test_build_main.yml index f1fb1fd291..a7c388fbac 100644 --- a/.github/workflows/test_build_main.yml +++ b/.github/workflows/test_build_main.yml @@ -57,10 +57,12 @@ jobs: path: service/server/router/web - name: Check Version id: prep - env: - REF: ${{ inputs.tag }} run: | - version=${REF} + echo "P_DIR=$(pwd)" >> $GITHUB_OUTPUT + date=$(git log -1 --format="%cd" --date=short | sed s/-//g) + count=$(git rev-list --count HEAD) + commit=$(git rev-parse --short HEAD) + version="unstable-$date.r${count}.$commit" echo "VERSION=$version" >> $GITHUB_OUTPUT echo "VERSION=$version" >> $GITHUB_ENV - name: Set up Go @@ -146,10 +148,12 @@ jobs: path: service/server/router/web - name: Check Version id: prep - env: - REF: ${{ inputs.tag }} run: | - version=${REF} + echo "P_DIR=$(pwd)" >> $GITHUB_OUTPUT + date=$(git log -1 --format="%cd" --date=short | sed s/-//g) + count=$(git rev-list --count HEAD) + commit=$(git rev-parse --short HEAD) + version="unstable-$date.r${count}.$commit" echo "VERSION=$version" >> $GITHUB_OUTPUT echo "VERSION=$version" >> $GITHUB_ENV - name: Set up Go