[codex] remove dead shifu.run demo mirror #86
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Release RC Workflow | |
| # Creates release branch and RC pull request when changelog PR is merged | |
| name: Release RC | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| types: | |
| - closed | |
| workflow_dispatch: | |
| inputs: | |
| version_override: | |
| description: 'Override version (e.g., v1.3.0). Leave empty for auto-detection.' | |
| required: false | |
| type: string | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| release_rc: | |
| if: | | |
| github.event_name == 'workflow_dispatch' || | |
| (github.event.pull_request.merged == true && | |
| startsWith(github.head_ref, 'changelog-')) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Generate GitHub App token | |
| id: app-token | |
| uses: actions/create-github-app-token@v1 | |
| with: | |
| app-id: ${{ secrets.RELEASE_APP_ID }} | |
| private-key: ${{ secrets.RELEASE_APP_PRIVATE_KEY }} | |
| repositories: ${{ github.event.repository.name }} | |
| - name: Validate GitHub App token | |
| if: ${{ steps.app-token.outputs.token == '' }} | |
| run: | | |
| echo "::error::Failed to generate GitHub App token. Check RELEASE_APP_ID and RELEASE_APP_PRIVATE_KEY secrets." | |
| exit 1 | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| ref: main | |
| token: ${{ steps.app-token.outputs.token }} | |
| - uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: go.mod | |
| - name: Determine release version | |
| id: version | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| source tools/release/automation.sh | |
| override="${{ github.event.inputs.version_override }}" | |
| if [[ -n "${override}" ]]; then | |
| if ! release_validate_stable_version "${override}"; then | |
| exit 1 | |
| fi | |
| echo "Using version override: ${override}" | |
| version="${override}" | |
| else | |
| latest_tag="$(release_latest_stable_tag)" | |
| if [[ -z "${latest_tag}" ]]; then | |
| release_error "No stable semver tags found (expected vX.Y.Z)" | |
| exit 1 | |
| fi | |
| version="$(release_next_minor_version "${latest_tag}")" | |
| echo "Detected latest tag: ${latest_tag}" | |
| echo "Next version: ${version}" | |
| fi | |
| release_branch="$(release_release_branch_name "${version}")" | |
| rc_version="$(release_rc_version "${version}")" | |
| rc_branch="$(release_rc_branch_name "${version}")" | |
| echo "version=${version}" >> "$GITHUB_OUTPUT" | |
| echo "release_branch=${release_branch}" >> "$GITHUB_OUTPUT" | |
| echo "rc_version=${rc_version}" >> "$GITHUB_OUTPUT" | |
| echo "rc_branch=${rc_branch}" >> "$GITHUB_OUTPUT" | |
| - name: Check branches do not exist | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| release_branch="${{ steps.version.outputs.release_branch }}" | |
| rc_branch="${{ steps.version.outputs.rc_branch }}" | |
| for branch in "${release_branch}" "${rc_branch}"; do | |
| if git ls-remote --exit-code --heads origin "${branch}" > /dev/null 2>&1; then | |
| echo "::error::Branch ${branch} already exists" | |
| exit 1 | |
| fi | |
| done | |
| echo "Branches ${release_branch} and ${rc_branch} do not exist. Proceeding..." | |
| - name: Configure git | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| - name: Create and push release branch | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| release_branch="${{ steps.version.outputs.release_branch }}" | |
| echo "Creating release branch: ${release_branch}" | |
| git checkout -b "${release_branch}" | |
| git push -u origin "${release_branch}" | |
| - name: Create RC branch | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| rc_branch="${{ steps.version.outputs.rc_branch }}" | |
| echo "Creating RC branch: ${rc_branch}" | |
| git checkout -b "${rc_branch}" | |
| - name: Update version files (RC) | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| rc_version="${{ steps.version.outputs.rc_version }}" | |
| echo "Running make tag VERSION=${rc_version}" | |
| if ! make tag VERSION="${rc_version}"; then | |
| echo "::error::Failed to run make tag" | |
| exit 1 | |
| fi | |
| - name: Commit and push RC branch | |
| id: push | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| rc_branch="${{ steps.version.outputs.rc_branch }}" | |
| rc_version="${{ steps.version.outputs.rc_version }}" | |
| # Check for changes | |
| if [[ -n "$(git status --porcelain)" ]]; then | |
| git commit -am "chore: prepare release ${rc_version}" | |
| fi | |
| # Push the RC branch | |
| git push -u origin "${rc_branch}" | |
| echo "rc_branch=${rc_branch}" >> "$GITHUB_OUTPUT" | |
| echo "RC branch ${rc_branch} pushed successfully" | |
| - name: Create RC Pull Request | |
| id: pr | |
| shell: bash | |
| env: | |
| GH_TOKEN: ${{ steps.app-token.outputs.token }} | |
| run: | | |
| set -euo pipefail | |
| release_branch="${{ steps.version.outputs.release_branch }}" | |
| rc_branch="${{ steps.push.outputs.rc_branch }}" | |
| rc_version="${{ steps.version.outputs.rc_version }}" | |
| # Read PR template | |
| pr_body="" | |
| if [[ -f ".github/pull-request-template.md" ]]; then | |
| pr_body="$(cat .github/pull-request-template.md)" | |
| fi | |
| # Create PR from RC branch to release branch | |
| pr_url=$(gh pr create \ | |
| --base "${release_branch}" \ | |
| --head "${rc_branch}" \ | |
| --title "chore: release ${rc_version}" \ | |
| --body "${pr_body}") | |
| if [[ -z "${pr_url}" ]]; then | |
| echo "::error::Failed to create PR" | |
| exit 1 | |
| fi | |
| # Extract PR number from URL | |
| pr_number="${pr_url##*/}" | |
| echo "pr_url=${pr_url}" >> "$GITHUB_OUTPUT" | |
| echo "pr_number=${pr_number}" >> "$GITHUB_OUTPUT" | |
| echo "::notice::RC PR created: ${pr_url}" |