chore(工作流程): 重構 CI 與 master 流程改用 gitea release 與 commit tag
This commit is contained in:
+20
-17
@@ -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"
|
||||
|
||||
@@ -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 }}
|
||||
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 }}"
|
||||
|
||||
Reference in New Issue
Block a user