Prepare Release Apps #41
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
| name: Prepare Release Apps | |
| permissions: {} | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| # Triggers every Monday at 5pm Shanghai time (9am UTC) | |
| - cron: "0 9 * * 1" | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.pull_request.number || github.sha }} | |
| cancel-in-progress: true | |
| jobs: | |
| prepare: | |
| name: Prepare Release | |
| runs-on: ubuntu-latest | |
| outputs: | |
| pull-request-number: ${{ steps.pr.outputs.pull-request-number }} | |
| oxlint_version: ${{ steps.run.outputs.OXLINT_VERSION }} | |
| oxfmt_version: ${{ steps.run.outputs.OXFMT_VERSION }} | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - uses: oxc-project/setup-rust@c8224157c0bf235aabc633e8cd50d344f087a7de # v1.0.12 | |
| with: | |
| cache-key: warm | |
| tools: cargo-release-oxc | |
| - name: Generate version and changelog | |
| id: run | |
| run: | | |
| cargo release-oxc update --release oxlint --release oxfmt | |
| echo "OXLINT_VERSION=$(cat ./target/OXLINT_VERSION)" >> $GITHUB_OUTPUT | |
| echo "OXFMT_VERSION=$(cat ./target/OXFMT_VERSION)" >> $GITHUB_OUTPUT | |
| { | |
| echo "# Oxlint" | |
| cat ./target/OXLINT_CHANGELOG | |
| echo "" | |
| echo "# Oxfmt" | |
| cat ./target/OXFMT_CHANGELOG | |
| } > ./target/PR_BODY.md | |
| - uses: oxc-project/setup-node@8958a8e040102244b619c4a94fccb657a44b1c21 # v1.0.6 | |
| - name: Rebuild NAPI bindings | |
| run: | | |
| pnpm --filter oxlint-app run build-dev | |
| pnpm --filter oxfmt-app run build-dev | |
| - name: Update Cargo.lock | |
| run: cargo check | |
| - uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v8.1.0 | |
| id: pr | |
| with: | |
| # bot account with PAT required for triggering workflow runs | |
| # See https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#triggering-further-workflow-runs | |
| token: ${{ secrets.OXC_BOT_PAT }} | |
| commit-message: "release(apps): oxlint v${{ steps.run.outputs.OXLINT_VERSION }} && oxfmt v${{ steps.run.outputs.OXFMT_VERSION }}" | |
| title: "release(apps): oxlint v${{ steps.run.outputs.OXLINT_VERSION }} && oxfmt v${{ steps.run.outputs.OXFMT_VERSION }}" | |
| branch: release/apps | |
| branch-suffix: timestamp | |
| base: main | |
| body-path: ./target/PR_BODY.md | |
| assignees: Boshen | |
| ecosystem-ci: | |
| needs: prepare | |
| name: Trigger Ecosystem CI | |
| runs-on: ubuntu-slim | |
| permissions: | |
| pull-requests: write | |
| contents: write | |
| steps: | |
| - uses: taiki-e/checkout-action@3ab630d442e198ebb0ca30872832406ca01c46eb # v1.4.0 | |
| - uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9 # v5.0.0 | |
| id: comment-oxlint | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| issue-number: ${{ needs.prepare.outputs.pull-request-number }} | |
| body: | | |
| Triggering Oxlint Ecosystem CI | |
| https://github.com/oxc-project/oxc-ecosystem-ci/actions/workflows/oxlint-ci.yml | |
| - uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9 # v5.0.0 | |
| id: comment-oxfmt | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| issue-number: ${{ needs.prepare.outputs.pull-request-number }} | |
| body: | | |
| Triggering Oxfmt Ecosystem CI | |
| https://github.com/oxc-project/oxc-ecosystem-ci/actions/workflows/oxfmt-ci.yml | |
| - uses: benc-uk/workflow-dispatch@e2e5e9a103e331dad343f381a29e654aea3cf8fc # v1.2.4 | |
| with: | |
| repo: oxc-project/oxc-ecosystem-ci | |
| workflow: oxlint-ci.yml | |
| token: ${{ secrets.OXC_BOT_PAT }} | |
| ref: main | |
| inputs: '{ "issue-number": "${{ needs.prepare.outputs.pull-request-number }}", "comment-id": "${{ steps.comment-oxlint.outputs.comment-id }}" }' | |
| - uses: benc-uk/workflow-dispatch@e2e5e9a103e331dad343f381a29e654aea3cf8fc # v1.2.4 | |
| with: | |
| repo: oxc-project/oxc-ecosystem-ci | |
| workflow: oxfmt-ci.yml | |
| token: ${{ secrets.OXC_BOT_PAT }} | |
| ref: main | |
| inputs: '{ "issue-number": "${{ needs.prepare.outputs.pull-request-number }}", "comment-id": "${{ steps.comment-oxfmt.outputs.comment-id }}" }' | |
| website: | |
| needs: prepare | |
| name: Update oxc.rs | |
| runs-on: ubuntu-slim | |
| permissions: | |
| actions: write | |
| steps: | |
| - uses: taiki-e/checkout-action@3ab630d442e198ebb0ca30872832406ca01c46eb # v1.4.0 | |
| - uses: benc-uk/workflow-dispatch@e2e5e9a103e331dad343f381a29e654aea3cf8fc # v1.2.4 | |
| with: | |
| repo: oxc-project/website | |
| workflow: release.yml | |
| token: ${{ secrets.OXC_BOT_PAT }} | |
| ref: main | |
| inputs: '{ "issue-number": "${{ needs.prepare.outputs.pull-request-number }}", "version": "${{ needs.prepare.outputs.oxlint_version }}" }' |