feat(command): 自动食用功能支持通过命令开关 #305
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: Build and Release | |
| on: | |
| push: | |
| paths: | |
| - '**.ts' | |
| - 'CHANGELOG.md' | |
| - '.github/workflows/**' | |
| env: | |
| artifact-name: 测试版 | |
| jobs: | |
| build: | |
| name: Build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build | |
| run: | | |
| tsc | |
| webpack | |
| echo "filepath=$(node packer.js --print-filepath-only)" >> $GITHUB_ENV | |
| timeout-minutes: 1 | |
| - name: Upload to artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ env.artifact-name }} | |
| path: ${{ env.filepath }} | |
| compression-level: 0 | |
| release: | |
| name: Release | |
| runs-on: ubuntu-latest | |
| needs: build | |
| if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Download artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: ${{ github.workspace }}/dist | |
| name: ${{ env.artifact-name }} | |
| - name: Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| name: Release ${{ github.ref_name }} | |
| files: ${{ github.workspace }}/dist/* | |
| body_path: ${{ github.workspace }}/CHANGELOG.md |