Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: split out lint + release workflows #657

Merged
merged 2 commits into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 51 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,35 @@ on:
- main

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
fetch-depth: 0
- run: corepack enable
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
node-version: 22
cache: pnpm

- name: πŸ“¦ Install dependencies
run: pnpm install

- name: πŸ”  Lint project
run: pnpm lint

- name: βœ‚οΈ Knip project
run: pnpm test:knip

# - name: βš™οΈ Check package engines
# run: pnpm test:engines

ci:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
# permissions:
# id-token: write
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
Expand All @@ -26,26 +48,43 @@ jobs:
node-version: 18
cache: pnpm
- run: pnpm install
- run: pnpm lint
- run: pnpm test:types
- run: pnpm build
- run: pnpm knip
- run: pnpm test:dist
- run: pnpm test:unit
- if: matrix.os != 'windows-latest'
uses: codecov/codecov-action@v5

release:
runs-on: ubuntu-latest
permissions:
id-token: write
if: github.repository_owner == 'nuxt'
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
fetch-depth: 0
- run: corepack enable
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
node-version: 22
cache: pnpm

- name: πŸ“¦ Install dependencies
run: pnpm install

- name: πŸ›  Build project
run: pnpm build

- name: πŸ“¦ release pkg.pr.new
if: github.event_name != 'push' && matrix.os != 'windows-latest'
run: pnpx pkg-pr-new publish --compact --template './playground'
if: github.event_name != 'push'
run: pnpm pkg-pr-new publish --compact --template './playground'

- name: πŸ“¦ release nuxi-nightly
if: |
github.event_name == 'push' &&
matrix.os != 'windows-latest' &&
!contains(github.event.head_commit.message, '[skip-release]') &&
!contains(github.event.head_commit.message, 'docs')
if: github.event_name == 'push'
run: |
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> ~/.npmrc &&
pnpm changelogen --canary nightly --publish
env:
NPM_TOKEN: ${{secrets.NPM_TOKEN}}
NPM_CONFIG_PROVENANCE: false
NPM_CONFIG_PROVENANCE: true
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"test": "pnpm lint && pnpm test:types && pnpm build && pnpm test:dist",
"test:dist": "node ./bin/nuxi.mjs info ./playground",
"test:types": "tsc --noEmit",
"test:knip": "knip",
"test:unit": "vitest --coverage"
},
"devDependencies": {
Expand Down
Loading