From b73feec9da06a29cfed39cc0a1b03ef3b8e30876 Mon Sep 17 00:00:00 2001 From: Jeffery Date: Thu, 2 Jul 2026 14:26:25 +0800 Subject: [PATCH] =?UTF-8?q?chore(=E5=B7=A5=E4=BD=9C=E6=B5=81=E7=A8=8B):=20?= =?UTF-8?q?=E9=87=8D=E6=A7=8B=20CI=20=E8=88=87=20master=20=E6=B5=81?= =?UTF-8?q?=E7=A8=8B=E6=94=B9=E7=94=A8=20gitea=20release=20=E8=88=87=20com?= =?UTF-8?q?mit=20tag?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/ci.yaml | 37 +++++++++++++++++++----------------- .gitea/workflows/master.yaml | 29 ++++++++++------------------ 2 files changed, 30 insertions(+), 36 deletions(-) diff --git a/.gitea/workflows/ci.yaml b/.gitea/workflows/ci.yaml index 49c6f93..992fff0 100644 --- a/.gitea/workflows/ci.yaml +++ b/.gitea/workflows/ci.yaml @@ -1,23 +1,36 @@ name: CI on: pull_request: - branches-ignore: - - master types: [opened, synchronize] jobs: build: name: 1. BUILD runs-on: ubuntu + env: + VERSION: "0.0.0-beta.${{ gitea.run_number }}" + steps: + - name: Publishing Release + uses: akkuman/gitea-release-action@${{ vars.ACTION_GITEA_RELEASE_VERSION }} + with: + name: "${{ gitea.event.repository.name }} v${{ env.VERSION }}" + tag_name: "v${{ env.VERSION }}" + target_commitish: ${{ gitea.sha }} + prerelease: ${{ gitea.base_ref == 'develop' }} + test: + name: 2. TEST + runs-on: ubuntu + needs: [build] outputs: message: ${{ steps.execute.outputs.message }} steps: - - name: Source Code checkout + - name: Source Code Checkout uses: actions/checkout@${{ vars.ACTION_CHECKOUT_VERSION }} - - name: Build + - name: Run Setup Codex + id: setup-codex uses: ./ with: oauth: ${{ secrets.CODEX_OAUTH }} - - name: Execute + - name: Execute Codex id: execute shell: bash run: | @@ -27,22 +40,12 @@ jobs: echo "$MESSAGE" echo "CODEX_EOF" } >> "$GITHUB_OUTPUT" - test: - name: 2. TEST - runs-on: ubuntu - needs: [build] - env: - MESSAGE: ${{ needs.build.outputs.message }} - steps: - - name: Test - if: ${{ env.MESSAGE == '' }} - run: exit 1 result: name: 3. RESULT runs-on: ubuntu needs: [build,test] env: - MESSAGE: ${{ needs.build.outputs.message }} + MESSAGE: ${{ needs.test.outputs.message }} steps: - - name: Result + - name: Show Message run: echo "$MESSAGE" diff --git a/.gitea/workflows/master.yaml b/.gitea/workflows/master.yaml index 5cf175d..cfce70f 100644 --- a/.gitea/workflows/master.yaml +++ b/.gitea/workflows/master.yaml @@ -4,27 +4,18 @@ on: branches: - master jobs: - build: - name: 1. BUILD - runs-on: ubuntu - outputs: - version: ${{ steps.calculate-version.outputs.version }} - steps: - - name: Calculate Version - id: calculate-version - env: - VERSION: 0.0.1 - run: echo "version=$VERSION" >> "$GITHUB_OUTPUT" deploy: - name: 2. DEPLOY + name: DEPLOY runs-on: ubuntu - needs: [build] env: - VERSION: ${{ needs.build.outputs.version }} + COMMIT_SHA: ${{ gitea.event.commits[1].id }} steps: - - name: Publishing Release - uses: akkuman/gitea-release-action@${{ vars.ACTION_GITEA_RELEASE_VERSION }} + - name: Source Code Checkout + uses: actions/checkout@${{ vars.ACTION_CHECKOUT_VERSION }} with: - name: "${{ gitea.event.repository.name }} v${{ env.VERSION }}" - tag_name: "v${{ env.VERSION }}" - target_commitish: ${{ gitea.sha }} \ No newline at end of file + fetch-depth: 0 + - name: Get Commit Tag + id: commit + run: echo "tag=$(git describe --contains ${{ env.COMMIT_SHA }})" >> $GITEA_OUTPUT + - name: Show Tag + run: echo "${{ steps.commit.outputs.tag }}" -- 2.53.0