diff --git a/.gitea/workflows/master.yaml b/.gitea/workflows/master.yaml index 475eba2..acc170b 100644 --- a/.gitea/workflows/master.yaml +++ b/.gitea/workflows/master.yaml @@ -4,12 +4,12 @@ on: - master jobs: version: - name: "CD > 計算版本號" + name: "CD > 計算版本" runs-on: ubuntu outputs: version: ${{ steps.version.outputs.version }} steps: - - name: 計算版本號 + - name: 計算版本 id: version uses: https://gitea.jsc.idv.tw/actions/calculate-version@${{ vars.ACTION_CALCULATE_VERSION }} release: @@ -20,4 +20,11 @@ jobs: - name: 發布專案 uses: akkuman/gitea-release-action@${{ vars.ACTION_RELEASE_VERSION }} with: - tag_name: "v${{ needs.version.outputs.version }}" \ No newline at end of file + tag_name: "v${{ needs.version.outputs.version }}" + cleanup: + name: "CD > 清理成品" + runs-on: ubuntu + needs: release + steps: + - name: 清理成品 + uses: https://gitea.jsc.idv.tw/actions/cleanup-release@${{ vars.ACTION_CLEANUP_RELEASE_VERSION }} \ No newline at end of file diff --git a/entrypoint.sh b/entrypoint.sh index eb7eab4..b799aff 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -24,6 +24,7 @@ echo "--------------------------------------------------" # 組合 RELEASE_URL 參數,並顯示出來 RELEASE_URL="$GITEA_SERVER_URL/api/v1/repos/$GITEA_REPOSITORY/releases" && echo "RELEASE_URL=$RELEASE_URL" +# 檢查是否為空或 "null" if [ -n "$RUNNER_TOKEN" ] && [ "$RUNNER_TOKEN" != "null" ]; then # 組合 RELEASE_HEADER 參數,並顯示出來 RELEASE_HEADER="Authorization: token $RUNNER_TOKEN" && echo "RELEASE_HEADER=$RELEASE_HEADER" @@ -71,4 +72,6 @@ PATCH=$((PATCH + 1)) NEW_VERSION="$MAJOR.$MINOR.$PATCH" && echo "NEW_VERSION=$NEW_VERSION" # 將版本輸出到環境變數 -echo "version=$NEW_VERSION" >> $GITHUB_OUTPUT \ No newline at end of file +echo "version=$NEW_VERSION" >> $GITHUB_OUTPUT + +echo "==================================================" \ No newline at end of file