Refactor: command builder #82
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
| name: Push Code | |
| on: | |
| pull_request_review: | |
| types: [submitted] | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| contents: write | |
| packages: write | |
| id-token: write | |
| jobs: | |
| check: | |
| runs-on: ubuntu-latest | |
| if: | | |
| github.event_name == 'push' || | |
| (github.event_name == 'pull_request_review' && | |
| github.event.review.state == 'approved') | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4.1.1 | |
| - name: Setup Node.js (with npm cache) | |
| uses: actions/setup-node@v4.0.2 | |
| with: | |
| node-version: "25" | |
| cache: "npm" | |
| registry-url: "https://npm.pkg.github.com" | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Install dependencies | |
| run: npm install | |
| - name: Check Compatibility | |
| run: npm run check | |
| release_git: | |
| needs: check | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4.1.1 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4.0.2 | |
| with: | |
| node-version: "25" | |
| cache: "npm" | |
| registry-url: "https://npm.pkg.github.com" | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Install dependencies | |
| run: npm install | |
| - name: Install git-cliff | |
| uses: taiki-e/install-action@git-cliff | |
| - name: Run github release script | |
| run: node scripts/actions/github.js | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| GITHUB_REPOSITORY: ${{ github.repository }} | |
| GITHUB_SHA: ${{ github.sha }} | |
| release_npm: | |
| needs: check | |
| environment: npm | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4.1.1 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4.0.2 | |
| with: | |
| node-version: "25" | |
| cache: "npm" | |
| registry-url: "https://registry.npmjs.org" | |
| - name: Install dependencies | |
| run: npm install | |
| - name: Run npm release script | |
| run: node scripts/actions/npm.js | |
| env: | |
| GITHUB_REPOSITORY: ${{ github.repository }} | |
| GITHUB_SHA: ${{ github.sha }} | |
| NPM_ORG: ${{ vars.NPM_ORG }} |