Files
setup-codex/.gitea/workflows/ci.yaml
T
Jeffery b73feec9da
CI / 1. BUILD (pull_request) Successful in 2s
CI / 2. TEST (pull_request) Successful in 36s
CI / 3. RESULT (pull_request) Successful in 1s
chore(工作流程): 重構 CI 與 master 流程改用 gitea release 與 commit tag
2026-07-02 14:26:25 +08:00

52 lines
1.3 KiB
YAML

name: CI
on:
pull_request:
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
uses: actions/checkout@${{ vars.ACTION_CHECKOUT_VERSION }}
- name: Run Setup Codex
id: setup-codex
uses: ./
with:
oauth: ${{ secrets.CODEX_OAUTH }}
- name: Execute Codex
id: execute
shell: bash
run: |
MESSAGE=$(codex exec "請你進行自我介紹" 2>/dev/null)
{
echo "message<<CODEX_EOF"
echo "$MESSAGE"
echo "CODEX_EOF"
} >> "$GITHUB_OUTPUT"
result:
name: 3. RESULT
runs-on: ubuntu
needs: [build,test]
env:
MESSAGE: ${{ needs.test.outputs.message }}
steps:
- name: Show Message
run: echo "$MESSAGE"