|
| 1 | +name: Nuxt [Pre-Release] |
| 2 | + |
| 3 | +env: |
| 4 | + node_version: 20 |
| 5 | + changelog_user: Github CI |
| 6 | + changelog_email: artem@manchenkoff.me |
| 7 | + NODE_AUTH_TOKEN: ${{ secrets.npm_token }} |
| 8 | + NODE_REGISTRY: https://registry.npmjs.org/ # setup credentials for npm |
| 9 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # pass token to generate changelog |
| 10 | + |
| 11 | +concurrency: |
| 12 | + group: nuxt-laravel-echo-release |
| 13 | + cancel-in-progress: false |
| 14 | + |
| 15 | +permissions: |
| 16 | + contents: write |
| 17 | + id-token: write |
| 18 | + |
| 19 | +on: |
| 20 | + workflow_dispatch: # manual trigger |
| 21 | + |
| 22 | +jobs: |
| 23 | + lint: |
| 24 | + runs-on: ubuntu-latest |
| 25 | + |
| 26 | + steps: |
| 27 | + - name: Checkout |
| 28 | + uses: actions/checkout@v4 |
| 29 | + |
| 30 | + - name: Enable corepack |
| 31 | + run: corepack enable |
| 32 | + |
| 33 | + - name: Setup Node.js |
| 34 | + uses: actions/setup-node@v4 |
| 35 | + with: |
| 36 | + node-version: ${{ env.node_version }} |
| 37 | + |
| 38 | + - name: Install dependencies |
| 39 | + run: npx nypm@latest i |
| 40 | + |
| 41 | + - name: Prepare stubs |
| 42 | + run: pnpm dev:prepare |
| 43 | + |
| 44 | + - name: Validate package |
| 45 | + run: pnpm validate |
| 46 | + |
| 47 | + publish: |
| 48 | + runs-on: ubuntu-latest |
| 49 | + needs: lint |
| 50 | + |
| 51 | + steps: |
| 52 | + - name: Checkout |
| 53 | + uses: actions/checkout@v4 |
| 54 | + with: |
| 55 | + fetch-depth: 0 # fetch all history for tags |
| 56 | + |
| 57 | + - name: Enable corepack |
| 58 | + run: corepack enable |
| 59 | + |
| 60 | + - name: Setup Node.js |
| 61 | + uses: actions/setup-node@v4 |
| 62 | + with: |
| 63 | + node-version: ${{ env.node_version }} |
| 64 | + registry-url: ${{ env.NODE_REGISTRY }} |
| 65 | + |
| 66 | + - name: Install dependencies |
| 67 | + run: npx nypm@latest i |
| 68 | + |
| 69 | + - name: Prepare stubs |
| 70 | + run: pnpm dev:prepare |
| 71 | + |
| 72 | + - name: Build |
| 73 | + run: pnpm prepack |
| 74 | + |
| 75 | + - name: Generate changelog and publish release |
| 76 | + run: | |
| 77 | + git config --global user.name "${{ env.changelog_user }}" |
| 78 | + git config --global user.email "${{ env.changelog_email }}" |
| 79 | + pnpm changelogen --release --push --publish --prerelease --publishTag beta |
0 commit comments