From 609cfa74b5b0c329321fe562eb103085381dc7ea Mon Sep 17 00:00:00 2001 From: Xiao YiFang Date: Fri, 13 May 2022 20:31:51 +0800 Subject: [PATCH] github: release version extracted into a variable . in the future release , prerelease and release version can share this same variable. reduce the code changes when publish a new release version. --- .github/workflows/AutoTag.yml | 6 ++++-- .github/workflows/macos-6.2.yml | 10 ++++++---- .github/workflows/macos.yml | 10 ++++++---- .github/workflows/ubuntu-6.2.yml | 10 ++++++---- .github/workflows/ubuntu-PR-check.yml | 4 +++- .github/workflows/ubuntu.yml | 10 ++++++---- .github/workflows/windows-6.2.yml | 22 ++++++++++++---------- .github/workflows/windows-PR-check.yml | 4 +++- .github/workflows/windows.yml | 22 ++++++++++++---------- 9 files changed, 58 insertions(+), 40 deletions(-) diff --git a/.github/workflows/AutoTag.yml b/.github/workflows/AutoTag.yml index f82d3c16..eb7d9863 100644 --- a/.github/workflows/AutoTag.yml +++ b/.github/workflows/AutoTag.yml @@ -22,7 +22,9 @@ jobs: runs-on: ubuntu-latest env: - version: 22.4.24-alpha + version: 22.4.24 + version-suffix: alpha + prerelease: true steps: - uses: actions/checkout@v3 @@ -37,7 +39,7 @@ jobs: uses: mathieudutour/github-tag-action@v6.0 with: github_token: ${{ secrets.GITHUB_TOKEN }} - custom_tag: ${{env.version}}.${{ steps.vars.outputs.release_hm }}.${{ steps.vars.outputs.sha_short }} + custom_tag: ${{env.version}}-${{env.version-suffix}}.${{ steps.vars.outputs.release_hm }}.${{ steps.vars.outputs.sha_short }} diff --git a/.github/workflows/macos-6.2.yml b/.github/workflows/macos-6.2.yml index 6950f644..752fd6b6 100644 --- a/.github/workflows/macos-6.2.yml +++ b/.github/workflows/macos-6.2.yml @@ -29,7 +29,9 @@ jobs: qt_arch: [clang_64] env: targetName: GoldenDict - version: 22.4.24-alpha + version: 22.4.24 + version-suffix: alpha + prerelease: true steps: # macos 11.0 默认环境变了,要指定 @@ -97,10 +99,10 @@ jobs: repo_token: ${{ secrets.GITHUB_TOKEN }} file: ${{ env.targetName }}.dmg asset_name: ${{ matrix.qt_ver }}-${{ env.targetName }}_${{ matrix.os }}_${{ steps.vars.outputs.sha_short }}.dmg - tag: v${{env.version}}.${{ steps.vars.outputs.release_hm }}.${{ steps.vars.outputs.sha_short }} + tag: v${{env.version}}-${{env.version-suffix}}.${{ steps.vars.outputs.release_hm }}.${{ steps.vars.outputs.sha_short }} overwrite: true - release_name: GoldenDict-v${{env.version}}.${{ steps.vars.outputs.release_hm }}.${{ steps.vars.outputs.sha_short }} - prerelease: true + release_name: GoldenDict-v${{env.version}}-${{env.version-suffix}}.${{ steps.vars.outputs.release_hm }}.${{ steps.vars.outputs.sha_short }} + prerelease: ${{env.prerelease}} body: | release on date: ${{steps.vars.outputs.release_date}} time: ${{steps.vars.outputs.release_time_clock}} branch: ${{ github.ref_name }} diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 3e995733..069efdfc 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -30,7 +30,9 @@ jobs: qt_arch: [clang_64] env: targetName: GoldenDict - version: 22.4.24-alpha + version: 22.4.24 + version-suffix: alpha + prerelease: true steps: # macos 11.0 默认环境变了,要指定 @@ -100,10 +102,10 @@ jobs: repo_token: ${{ secrets.GITHUB_TOKEN }} file: ${{ env.targetName }}.dmg asset_name: ${{ matrix.qt_ver }}-${{ env.targetName }}_${{ matrix.os }}_${{ steps.vars.outputs.sha_short }}.dmg - tag: v${{env.version}}.${{ steps.vars.outputs.release_hm }}.${{ steps.vars.outputs.sha_short }} + tag: v${{env.version}}-${{env.version-suffix}}.${{ steps.vars.outputs.release_hm }}.${{ steps.vars.outputs.sha_short }} overwrite: true - release_name: GoldenDict-v${{env.version}}.${{ steps.vars.outputs.release_hm }}.${{ steps.vars.outputs.sha_short }} - prerelease: true + release_name: GoldenDict-v${{env.version}}-${{env.version-suffix}}.${{ steps.vars.outputs.release_hm }}.${{ steps.vars.outputs.sha_short }} + prerelease: ${{env.prerelease}} body: | release on date: ${{steps.vars.outputs.release_date}} time: ${{steps.vars.outputs.release_time_clock}} branch: ${{ github.ref_name }} diff --git a/.github/workflows/ubuntu-6.2.yml b/.github/workflows/ubuntu-6.2.yml index 943f4df9..0bd27809 100644 --- a/.github/workflows/ubuntu-6.2.yml +++ b/.github/workflows/ubuntu-6.2.yml @@ -30,7 +30,9 @@ jobs: qt_ver: [6.2.4,6.3.0] qt_arch: [gcc_64] env: - version: 22.4.24-alpha + version: 22.4.24 + version-suffix: alpha + prerelease: true steps: - name: Install Qt uses: jurplel/install-qt-action@v3 @@ -104,10 +106,10 @@ jobs: repo_token: ${{ secrets.GITHUB_TOKEN }} file: ${{ steps.vars.outputs.appname }} asset_name: ${{ matrix.qt_ver }}-${{ steps.vars.outputs.appname }} - tag: v${{env.version}}.${{ steps.vars.outputs.release_hm }}.${{ steps.vars.outputs.sha_short }} + tag: v${{env.version}}-${{env.version-suffix}}.${{ steps.vars.outputs.release_hm }}.${{ steps.vars.outputs.sha_short }} overwrite: true - release_name: GoldenDict-v${{env.version}}.${{ steps.vars.outputs.release_hm }}.${{ steps.vars.outputs.sha_short }} - prerelease: true + release_name: GoldenDict-v${{env.version}}-${{env.version-suffix}}.${{ steps.vars.outputs.release_hm }}.${{ steps.vars.outputs.sha_short }} + prerelease: ${{env.prerelease}} body: | release on date: ${{steps.vars.outputs.release_date}} time: ${{steps.vars.outputs.release_time_clock}} branch: ${{ github.ref_name }} diff --git a/.github/workflows/ubuntu-PR-check.yml b/.github/workflows/ubuntu-PR-check.yml index d0ed72da..3ab651bb 100644 --- a/.github/workflows/ubuntu-PR-check.yml +++ b/.github/workflows/ubuntu-PR-check.yml @@ -24,7 +24,9 @@ jobs: qt_ver: [5.15.2,6.2.4] qt_arch: [gcc_64] env: - version: 22.4.24-alpha + version: 22.4.24 + version-suffix: alpha + prerelease: true steps: - uses: actions/setup-python@v3 with: diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 9dc1c612..2b9f8144 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -30,7 +30,9 @@ jobs: qt_ver: [5.15.2] qt_arch: [gcc_64] env: - version: 22.4.24-alpha + version: 22.4.24 + version-suffix: alpha + prerelease: true steps: - name: Install Qt uses: jurplel/install-qt-action@v3 @@ -101,10 +103,10 @@ jobs: repo_token: ${{ secrets.GITHUB_TOKEN }} file: ${{ steps.vars.outputs.appname }} asset_name: ${{ matrix.qt_ver }}-${{ steps.vars.outputs.appname }} - tag: v${{env.version}}.${{ steps.vars.outputs.release_hm }}.${{ steps.vars.outputs.sha_short }} + tag: v${{env.version}}-${{env.version-suffix}}.${{ steps.vars.outputs.release_hm }}.${{ steps.vars.outputs.sha_short }} overwrite: true - release_name: GoldenDict-v${{env.version}}.${{ steps.vars.outputs.release_hm }}.${{ steps.vars.outputs.sha_short }} - prerelease: true + release_name: GoldenDict-v${{env.version}}-${{env.version-suffix}}.${{ steps.vars.outputs.release_hm }}.${{ steps.vars.outputs.sha_short }} + prerelease: ${{env.prerelease}} body: | release on date: ${{steps.vars.outputs.release_date}} time: ${{steps.vars.outputs.release_time_clock}} branch: ${{ github.ref_name }} diff --git a/.github/workflows/windows-6.2.yml b/.github/workflows/windows-6.2.yml index 9956c33b..78cb9ee2 100644 --- a/.github/workflows/windows-6.2.yml +++ b/.github/workflows/windows-6.2.yml @@ -31,7 +31,9 @@ jobs: qt_arch: [win64_msvc2019_64] env: targetName: GoldenDict.exe - version: 22.4.24-alpha + version: 22.4.24 + version-suffix: alpha + prerelease: true steps: - uses: actions/setup-python@v3 with: @@ -111,10 +113,10 @@ jobs: repo_token: ${{ secrets.GITHUB_TOKEN }} file: ${{ steps.package.outputs.packageName }}.zip asset_name: ${{ matrix.qt_ver }}-${{ steps.package.outputs.packageName }}.zip - tag: v${{env.version}}.${{ steps.vars.outputs.release_hm }}.${{ steps.vars.outputs.sha_short }} + tag: v${{env.version}}-${{env.version-suffix}}.${{ steps.vars.outputs.release_hm }}.${{ steps.vars.outputs.sha_short }} overwrite: true - release_name: GoldenDict-v${{env.version}}.${{ steps.vars.outputs.release_hm }}.${{ steps.vars.outputs.sha_short }} - prerelease: true + release_name: GoldenDict-v${{env.version}}-${{env.version-suffix}}.${{ steps.vars.outputs.release_hm }}.${{ steps.vars.outputs.sha_short }} + prerelease: ${{env.prerelease}} body: | release on date: ${{steps.vars.outputs.release_date}} time: ${{steps.vars.outputs.release_time_clock}} branch: ${{ github.ref_name }} @@ -131,10 +133,10 @@ jobs: repo_token: ${{ secrets.GITHUB_TOKEN }} file: release/${{ env.targetName }} asset_name: ${{ matrix.qt_ver }}-${{ env.targetName }} - tag: v${{env.version}}.${{ steps.vars.outputs.release_hm }}.${{ steps.vars.outputs.sha_short }} + tag: v${{env.version}}-${{env.version-suffix}}.${{ steps.vars.outputs.release_hm }}.${{ steps.vars.outputs.sha_short }} overwrite: true - release_name: GoldenDict-v${{env.version}}.${{ steps.vars.outputs.release_hm }}.${{ steps.vars.outputs.sha_short }} - prerelease: true + release_name: GoldenDict-v${{env.version}}-${{env.version-suffix}}.${{ steps.vars.outputs.release_hm }}.${{ steps.vars.outputs.sha_short }} + prerelease: ${{env.prerelease}} - name: copy nsis shell: bash @@ -156,7 +158,7 @@ jobs: repo_token: ${{ secrets.GITHUB_TOKEN }} file: ${{ steps.package.outputs.packageName }}/GoldenDict-v22-Install.exe asset_name: ${{ matrix.qt_ver }}-GoldenDict-v22-Install.exe - tag: v${{env.version}}.${{ steps.vars.outputs.release_hm }}.${{ steps.vars.outputs.sha_short }} + tag: v${{env.version}}-${{env.version-suffix}}.${{ steps.vars.outputs.release_hm }}.${{ steps.vars.outputs.sha_short }} overwrite: true - release_name: GoldenDict-v${{env.version}}.${{ steps.vars.outputs.release_hm }}.${{ steps.vars.outputs.sha_short }} - prerelease: true \ No newline at end of file + release_name: GoldenDict-v${{env.version}}-${{env.version-suffix}}.${{ steps.vars.outputs.release_hm }}.${{ steps.vars.outputs.sha_short }} + prerelease: ${{env.prerelease}} \ No newline at end of file diff --git a/.github/workflows/windows-PR-check.yml b/.github/workflows/windows-PR-check.yml index 264ee662..ff2258cd 100644 --- a/.github/workflows/windows-PR-check.yml +++ b/.github/workflows/windows-PR-check.yml @@ -27,7 +27,9 @@ jobs: env: targetName: GoldenDict.exe - version: 22.4.24-alpha + version: 22.4.24 + version-suffix: alpha + prerelease: true steps: - uses: actions/setup-python@v3 with: diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 7b723851..6a09f258 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -32,7 +32,9 @@ jobs: qt_arch: [win64_msvc2019_64] env: targetName: GoldenDict.exe - version: 22.4.24-alpha + version: 22.4.24 + version-suffix: alpha + prerelease: true # 步骤 steps: # 安装Qt @@ -106,10 +108,10 @@ jobs: repo_token: ${{ secrets.GITHUB_TOKEN }} file: ${{ steps.package.outputs.packageName }}.zip asset_name: ${{ matrix.qt_ver }}-${{ steps.package.outputs.packageName }}.zip - tag: v${{env.version}}.${{ steps.vars.outputs.release_hm }}.${{ steps.vars.outputs.sha_short }} + tag: v${{env.version}}-${{env.version-suffix}}.${{ steps.vars.outputs.release_hm }}.${{ steps.vars.outputs.sha_short }} overwrite: true - release_name: GoldenDict-v${{env.version}}.${{ steps.vars.outputs.release_hm }}.${{ steps.vars.outputs.sha_short }} - prerelease: true + release_name: GoldenDict-v${{env.version}}-${{env.version-suffix}}.${{ steps.vars.outputs.release_hm }}.${{ steps.vars.outputs.sha_short }} + prerelease: ${{env.prerelease}} body: | release on date: ${{steps.vars.outputs.release_date}} time: ${{steps.vars.outputs.release_time_clock}} branch: ${{ github.ref_name }} @@ -131,10 +133,10 @@ jobs: repo_token: ${{ secrets.GITHUB_TOKEN }} file: release/${{ env.targetName }} asset_name: ${{ matrix.qt_ver }}-${{ env.targetName }} - tag: v${{env.version}}.${{ steps.vars.outputs.release_hm }}.${{ steps.vars.outputs.sha_short }} + tag: v${{env.version}}-${{env.version-suffix}}.${{ steps.vars.outputs.release_hm }}.${{ steps.vars.outputs.sha_short }} overwrite: true - release_name: GoldenDict-v${{env.version}}.${{ steps.vars.outputs.release_hm }}.${{ steps.vars.outputs.sha_short }} - prerelease: true + release_name: GoldenDict-v${{env.version}}-${{env.version-suffix}}.${{ steps.vars.outputs.release_hm }}.${{ steps.vars.outputs.sha_short }} + prerelease: ${{env.prerelease}} - name: copy nsis @@ -159,8 +161,8 @@ jobs: repo_token: ${{ secrets.GITHUB_TOKEN }} file: ${{ steps.package.outputs.packageName }}/GoldenDict-v22-Install.exe asset_name: ${{ matrix.qt_ver }}-GoldenDict-v22-Install.exe - tag: v${{env.version}}.${{ steps.vars.outputs.release_hm }}.${{ steps.vars.outputs.sha_short }} + tag: v${{env.version}}-${{env.version-suffix}}.${{ steps.vars.outputs.release_hm }}.${{ steps.vars.outputs.sha_short }} overwrite: true - release_name: GoldenDict-v${{env.version}}.${{ steps.vars.outputs.release_hm }}.${{ steps.vars.outputs.sha_short }} - prerelease: true + release_name: GoldenDict-v${{env.version}}-${{env.version-suffix}}.${{ steps.vars.outputs.release_hm }}.${{ steps.vars.outputs.sha_short }} + prerelease: ${{env.prerelease}} \ No newline at end of file