Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f03aa4ba23 | ||
|
|
cf3194631f | ||
|
|
7426c5d835 | ||
|
|
58ae22ed1e | ||
|
|
4e236c8d0f | ||
|
|
d7cd868c04 | ||
|
|
3ca0c5a9ab | ||
|
|
8a9c4d1ca9 | ||
|
|
de7804c7d1 |
@@ -10,20 +10,29 @@ jobs:
|
||||
- name: 發布專案
|
||||
uses: akkuman/gitea-release-action@${{ vars.ACTION_RELEASE_VERSION }}
|
||||
with:
|
||||
tag_name: "v0.1.2"
|
||||
- name: 計算版本號
|
||||
id: version
|
||||
uses: https://gitea.jsc.idv.tw/actions/calculate-version@v0.1.1
|
||||
tag_name: "v0.1.7"
|
||||
- name: 清理舊版本 (保留最新2個)
|
||||
uses: https://gitea.jsc.idv.tw/actions/cleanup-release@${{ vars.ACTION_CLEANUP_RELEASE_VERSION }}
|
||||
with:
|
||||
gitea-server: ${{ gitea.server_url }}
|
||||
repository: ${{ gitea.repository }}
|
||||
token: ${{ secrets.GITEA_TOKEN }}
|
||||
test:
|
||||
test-calculate:
|
||||
name: "TEST > 計算版本號"
|
||||
runs-on: docker
|
||||
needs: cd
|
||||
outputs:
|
||||
version: ${{ steps.version.outputs.version }}
|
||||
steps:
|
||||
- name: 計算版本號
|
||||
uses: https://gitea.jsc.idv.tw/actions/calculate-version@v0.1.7
|
||||
- name: 輸出版本號
|
||||
id: version
|
||||
run: echo "VERSION.txt" >> $GITHUB_OUTPUT
|
||||
test:
|
||||
name: "TEST > 測試專案"
|
||||
runs-on: docker
|
||||
needs: test-calculate
|
||||
steps:
|
||||
- name: 顯示版本號
|
||||
run: echo ${{ needs.cd.outputs.version }}
|
||||
run: echo ${{ needs.test-calculate.outputs.version }}
|
||||
@@ -1,13 +1,6 @@
|
||||
name: 'CALCULATE VERSION'
|
||||
description: '計算版本號'
|
||||
author: 'Jeffery'
|
||||
# inputs:
|
||||
# RUNNER_TOKEN:
|
||||
# description: 'Gitea Runner 用來存取的 Token,ex: ${{ secrets.RUNNER_TOKEN }}'
|
||||
# required: true
|
||||
outputs:
|
||||
VERSION:
|
||||
description: '計算出的新版本號'
|
||||
runs:
|
||||
using: 'docker'
|
||||
image: 'Dockerfile'
|
||||
|
||||
@@ -67,11 +67,8 @@ PATCH=$((PATCH + 1))
|
||||
# 如果 MINOR >= 10,重置為 0 並增加 MAJOR 版本
|
||||
[ $MINOR -ge 10 ] && { MINOR=0; MAJOR=$((MAJOR + 1)); }
|
||||
|
||||
# 組合新的版本號
|
||||
NEW_VERSION="$MAJOR.$MINOR.$PATCH"
|
||||
|
||||
# 確保 GITHUB_OUTPUT 檔案的目錄存在
|
||||
mkdir -p "$(dirname "$GITHUB_OUTPUT")"
|
||||
# 組合新的版本號,並顯示
|
||||
NEW_VERSION="$MAJOR.$MINOR.$PATCH" && echo "NEW_VERSION=$NEW_VERSION"
|
||||
|
||||
# 將版本輸出到環境變數
|
||||
echo "version=$NEW_VERSION" >> $GITHUB_OUTPUT
|
||||
echo "version=$NEW_VERSION" >> "VERSION.txt"
|
||||
Reference in New Issue
Block a user