Skip to content

Commit

Permalink
fix: release test with changeset on ci
Browse files Browse the repository at this point in the history
  • Loading branch information
JOU-amjs committed Apr 26, 2024
1 parent 3ebf323 commit feea4a0
Show file tree
Hide file tree
Showing 10 changed files with 189 additions and 5 deletions.
6 changes: 6 additions & 0 deletions .changeset/mighty-guests-invite.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@alova/lrucache': patch
'@alova/shared': patch
---

Fix some issues.
44 changes: 44 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# See https://github.com/actions/labeler

'pkg: example':
- examples/**/*

'🚨 action':
- .github/workflows/**

'pkg: astro':
- packages/astro/**

'pkg: create-astro':
- packages/create-astro/**

'pkg: db':
- packages/integrations/db/**

'feat: markdown':
- packages/markdown/**

'pkg: integration':
- packages/integrations/**

'pkg: lit':
- packages/integrations/lit/**

'pkg: preact':
- packages/integrations/preact/**

'pkg: react':
- packages/integrations/react/**

'pkg: solid':
- packages/integrations/solid/**

'pkg: svelte':
- packages/integrations/svelte/**

'pkg: vue':
- packages/integrations/vue/**

'docs pr':
- packages/astro/src/@types/astro.ts
- packages/astro/src/core/errors/errors-data.ts
80 changes: 80 additions & 0 deletions .github/workflows/alpha-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: pull_request check

# trigger condition: pull_request to any branch
on:
push:
branches:
- alpha

jobs:
quality:
# server: ubuntu-latest
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Setup PNPM
uses: pnpm/action-setup@v3

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18
registry-url: 'https://registry.npmjs.org'
cache: 'pnpm'

- name: Install deps
run: pnpm install

- name: Lint check
run: pnpm run lint

- name: Format
run: pnpm run format

release:
runs-on: ubuntu-latest
needs: [quality]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Setup PNPM
uses: pnpm/action-setup@v3

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18
registry-url: 'https://registry.npmjs.org'
cache: 'pnpm'

- name: Install deps
run: pnpm install

# - name: Test SSR
# run: npm run test:node

# This has contained test and upload coverage
# - name: Coverage
# run: npm run test:coveralls

- name: Create Release Pull Request or Publish
id: changesets
uses: changesets/action@v1
with:
# Note: pnpm install after versioning is necessary to refresh lockfile
version: pnpm run changeset:version
publish: pnpm run release
commit: '[ci] release'
title: '[ci] release'
env:
# Needs access to push to main
GITHUB_TOKEN: ${{ secrets.NPM_ALOVA_PUBLISH_TOKEN }}
# Needs access to publish to npm
NPM_TOKEN: ${{ secrets.ALOVA_GITHUB_TOKEN }}
Empty file.
15 changes: 15 additions & 0 deletions .github/workflows/label.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Automatically labels PRs based on the configuration file
# you are probably looking for 👉 `.github/labeler.yml`
name: Label PRs

on:
- pull_request_target

jobs:
triage:
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v4
with:
repo-token: '${{ secrets.GITHUB_TOKEN }}'
sync-labels: true
41 changes: 41 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: pull_request check

# trigger condition: pull_request to any branch
on:
pull_request:
paths-ignore:
- '.vscode/**'
- '**/*.md'
- '.github/**'

jobs:
quality:
# server: ubuntu-latest
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Setup PNPM
uses: pnpm/action-setup@v3

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18
registry-url: 'https://registry.npmjs.org'
cache: 'pnpm'

- name: Install deps
run: pnpm install

- name: Lint check
run: pnpm run lint

- name: Unit tests
run: pnpm run test

- name: Format
run: pnpm run format
2 changes: 0 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ on:
push:
branches:
- main
- alpha
- beta
pull_request:
branches: '*'

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"changeset:alpha": "changeset enter pre alpha && changeset",
"changeset:beta": "changeset enter pre beta && changeset",
"changeset:version": "changeset version",
"release": "pnpm changeset:version && pnpm i && pnpm publish -r"
"release": "pnpm changeset publish"
},
"author": "Scott Hu",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/lrucache/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@alova/lrucache",
"version": "1.0.0",
"version": "0.0.1",
"description": "larucache adapter for alova.js on nodejs, deno, bun",
"homepage": "https://alova.js.org",
"main": "dist/alova-adapter-axios.common.cjs",
Expand Down
2 changes: 1 addition & 1 deletion packages/shared/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@alova/shared",
"version": "1.1.0",
"version": "0.0.1",
"type": "module",
"author": "Scott Hu",
"module": "dist/alova.esm.js",
Expand Down

0 comments on commit feea4a0

Please sign in to comment.