vueless-release-beta #81
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: Release Workflow | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| release_type: | |
| description: 'Type of release' | |
| required: true | |
| type: choice | |
| options: | |
| - patch | |
| - minor | |
| - major | |
| push: | |
| branches: [ beta ] | |
| pull_request: | |
| types: [ opened, synchronize, reopened ] | |
| repository_dispatch: | |
| types: [ vueless-release, vueless-release-beta ] | |
| permissions: write-all | |
| jobs: | |
| lint: | |
| name: 'Lint' | |
| if: "!contains(github.event.head_commit.message, 'GITBOOK')" | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: 'npm' | |
| - run: npm ci | |
| - run: cd playground && npm ci | |
| - run: cd .. | |
| - run: npm run lint:ci | |
| ts-check: | |
| name: 'TS Check' | |
| if: "!contains(github.event.head_commit.message, 'GITBOOK')" | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: 'npm' | |
| - run: npm ci | |
| - run: cd playground && npm ci | |
| - run: cd .. | |
| - run: npm run dev:prepare | |
| - run: npm run ts:check | |
| release-beta: | |
| name: 'Release: beta' | |
| if: "github.event_name == 'push' && github.ref_name == 'beta'" | |
| needs: [ lint, ts-check ] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: 'npm' | |
| registry-url: https://registry.npmjs.org/ | |
| - run: | | |
| git config user.name "${GITHUB_ACTOR}" | |
| git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" | |
| - run: npm install -g npm@latest | |
| - run: npm ci | |
| - run: npm run prepack | |
| - run: npm run release:beta | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| release-beta-auto: | |
| name: 'Release: beta' | |
| if: github.event_name == 'repository_dispatch' && github.event.action == 'vueless-release-beta' | |
| needs: [ lint, ts-check ] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: beta | |
| fetch-depth: 0 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: 'npm' | |
| registry-url: https://registry.npmjs.org/ | |
| - run: npm install -g npm@latest | |
| - run: npm ci | |
| - run: npm install vueless@beta | |
| - run: | | |
| git config user.name "${GITHUB_ACTOR}" | |
| git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" | |
| git add package.json package-lock.json | |
| if git diff --cached --quiet; then | |
| echo "No changes to commit" | |
| else | |
| git commit -m "chore: update Vueless UI to the latest beta version" | |
| git push origin beta | |
| fi | |
| - run: | | |
| git config user.name "${GITHUB_ACTOR}" | |
| git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" | |
| - run: npm run prepack | |
| - run: npm run release:beta | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| release: | |
| name: "Release: ${{ github.event.inputs.release_type }}" | |
| if: github.event_name == 'workflow_dispatch' && github.ref_name == 'main' | |
| needs: [ lint, ts-check ] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: 'npm' | |
| registry-url: https://registry.npmjs.org/ | |
| - run: | | |
| git config user.name "${GITHUB_ACTOR}" | |
| git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" | |
| - run: npm install -g npm@latest | |
| - run: npm ci | |
| - run: npm run prepack | |
| - run: npm run release:${{ github.event.inputs.release_type }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| release-auto: | |
| name: "Auto-Release: ${{ github.event.client_payload.release_type }}" | |
| if: github.event_name == 'repository_dispatch' && github.event.action == 'vueless-release' | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: 'npm' | |
| registry-url: https://registry.npmjs.org/ | |
| - run: npm install -g npm@latest | |
| - run: npm ci | |
| - run: npm install vueless@latest | |
| - run: | | |
| git config user.name "${GITHUB_ACTOR}" | |
| git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" | |
| git add package.json package-lock.json | |
| if git diff --cached --quiet; then | |
| echo "No changes to commit" | |
| else | |
| git commit -m "feat: update Vueless UI to the latest version" | |
| git push origin ${{ github.ref_name }} | |
| fi | |
| - run: npm run prepack | |
| - run: npm run release:${{ github.event.client_payload.release_type }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| update-beta: | |
| name: 'Update Beta' | |
| if: github.event_name == 'workflow_dispatch' && github.ref_name == 'main' | |
| needs: [ release ] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - run: | | |
| git config user.name "${GITHUB_ACTOR}" | |
| git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" | |
| git fetch origin beta | |
| git checkout beta | |
| git merge origin/main --no-edit -m "Merge main into beta [skip ci]" || echo "Merge conflict, needs manual resolution" | |
| git push origin beta | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| update-beta-auto: | |
| name: 'Update Beta Auto' | |
| if: github.event_name == 'repository_dispatch' && github.event.action == 'vueless-release' | |
| needs: [ release-auto ] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - run: | | |
| git config user.name "${GITHUB_ACTOR}" | |
| git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" | |
| git fetch origin main | |
| git fetch origin beta | |
| git checkout beta | |
| git merge origin/main --no-edit -m "Merge main into beta [no ci]" || echo "Merge conflict, needs manual resolution" | |
| git push origin beta | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |