13 Commits

Author SHA1 Message Date
Jeffery
22d14c0e9f feat: 發布新版 2026-03-20 17:07:22 +08:00
Jeffery
f03aa4ba23 feat: 在外部書出版本號 2026-03-20 17:06:00 +08:00
Jeffery
cf3194631f feat: 更新版本 2026-03-20 17:03:57 +08:00
Jeffery
7426c5d835 test: 嘗試使用兩種模式 2026-03-20 17:03:33 +08:00
Jeffery
58ae22ed1e feat: 使用新版 2026-03-20 16:51:56 +08:00
Jeffery
4e236c8d0f feat: 發布新版 2026-03-20 16:51:35 +08:00
Jeffery
d7cd868c04 feat: 使用新版本 2026-03-20 16:49:42 +08:00
Jeffery
3ca0c5a9ab feat: 使用新版本 2026-03-20 16:45:44 +08:00
Jeffery
8a9c4d1ca9 feat: 發布新版本 2026-03-20 16:45:14 +08:00
Jeffery
de7804c7d1 feat: 使用新版本 2026-03-20 16:42:44 +08:00
Jeffery
ccd4ef297e feat: 更新版本號 2026-03-20 16:42:16 +08:00
Jeffery
6ff37643b6 test: 嘗試排除沒有資料夾的問題 2026-03-20 16:41:49 +08:00
Jeffery
9a15897128 feat: 使用新版本 2026-03-20 16:39:09 +08:00
3 changed files with 24 additions and 19 deletions

View File

@@ -6,21 +6,33 @@ jobs:
cd: cd:
name: "CD > 發布專案" name: "CD > 發布專案"
runs-on: docker runs-on: docker
env:
RUNNER_TOOL_CACHE: /toolcache
steps: steps:
- name: 發布專案 - name: 發布專案
uses: akkuman/gitea-release-action@${{ vars.ACTION_RELEASE_VERSION }} uses: akkuman/gitea-release-action@${{ vars.ACTION_RELEASE_VERSION }}
with: with:
tag_name: "v0.1.1" tag_name: "v0.1.8"
- name: 計算版本號
id: version
uses: https://gitea.jsc.idv.tw/actions/calculate-version@v0.0.9
- name: 顯示資訊
run: echo ${{ needs.version.outputs.version }}
- name: 清理舊版本 (保留最新2個) - name: 清理舊版本 (保留最新2個)
uses: https://gitea.jsc.idv.tw/actions/cleanup-release@${{ vars.ACTION_CLEANUP_RELEASE_VERSION }} uses: https://gitea.jsc.idv.tw/actions/cleanup-release@${{ vars.ACTION_CLEANUP_RELEASE_VERSION }}
with: with:
gitea-server: ${{ gitea.server_url }} gitea-server: ${{ gitea.server_url }}
repository: ${{ gitea.repository }} repository: ${{ gitea.repository }}
token: ${{ secrets.GITEA_TOKEN }} token: ${{ secrets.GITEA_TOKEN }}
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.8
- name: 輸出版本號
id: version
run: echo VERSION.txt >> $GITHUB_OUTPUT
test:
name: "TEST > 測試專案"
runs-on: docker
needs: test-calculate
steps:
- name: 顯示版本號
run: echo ${{ needs.test-calculate.outputs.version }}

View File

@@ -1,13 +1,6 @@
name: 'CALCULATE VERSION' name: 'CALCULATE VERSION'
description: '計算版本號' description: '計算版本號'
author: 'Jeffery' author: 'Jeffery'
# inputs:
# RUNNER_TOKEN:
# description: 'Gitea Runner 用來存取的 Tokenex: ${{ secrets.RUNNER_TOKEN }}'
# required: true
outputs:
VERSION:
description: '計算出的新版本號'
runs: runs:
using: 'docker' using: 'docker'
image: 'Dockerfile' image: 'Dockerfile'

View File

@@ -67,8 +67,8 @@ PATCH=$((PATCH + 1))
# 如果 MINOR >= 10重置為 0 並增加 MAJOR 版本 # 如果 MINOR >= 10重置為 0 並增加 MAJOR 版本
[ $MINOR -ge 10 ] && { MINOR=0; MAJOR=$((MAJOR + 1)); } [ $MINOR -ge 10 ] && { MINOR=0; MAJOR=$((MAJOR + 1)); }
# 組合新的版本號 # 組合新的版本號,並顯示
NEW_VERSION="$MAJOR.$MINOR.$PATCH" NEW_VERSION="$MAJOR.$MINOR.$PATCH" && echo "NEW_VERSION=$NEW_VERSION"
# 將版本輸出到環境變數 # 將版本輸出到環境變數
echo "version=$NEW_VERSION" >> $GITHUB_OUTPUT echo "version=$NEW_VERSION" > VERSION.txt