Skip to content

Commit

Permalink
Merge pull request #5875 from alibaba/release/next
Browse files Browse the repository at this point in the history
Release 3.1.1
  • Loading branch information
ClarkXia authored Feb 20, 2023
2 parents c63d120 + a20807b commit 6dfc4b0
Show file tree
Hide file tree
Showing 123 changed files with 1,673 additions and 930 deletions.
78 changes: 78 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)

## Add A Changeset

After you have completed a feature or fixed a bug, you need to do three things:

- Select which packages should be released
- Bump released packages version
- Write Changelog for the released packages

You can follow these steps:
- Run the command line script `npm run changeset`
- Select the packages you want to include in the changeset using `` and `` to navigate to packages, and `space` to select a package. Hit enter when all desired packages are selected.
- You will be prompted to select a bump type for each selected package. Select an appropriate bump type for the changes made. See here for information on semver versioning
- Your final prompt will be to provide a message to go alongside the changeset. This will be written into the changelog when the next release occurs.

After that, you should commit changes to the remote repository. For example:

```bash
$ git status
On branch test-3
Untracked files:
(use "git add <file>..." to include in what will be committed)
.changeset/curvy-jobs-fly.md

$ git commit -am "chore: add changeset"

$ git push
```

For more detail, please see [this documentation](https://github.com/changesets/changesets/blob/main/docs/adding-a-changeset.md).

## Publish Beta Version

> NOTE: You must add a changeset first before publishing beta version.
Run the following command to publish the beta version

```bash
$ npm run release:beta
```

Then, we need to commit changes to the remote repository. For example:

```bash
$ git status
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: packages/a/CHANGELOG.md
modified: packages/a/package.json
modified: pnpm-workspace.yaml

Untracked files:
(use "git add <file>..." to include in what will be committed)
.changeset/pre.json

$ git commit -am "chore: beta version"

$ git push
```

For more detail, please see this [documentation](https://github.com/changesets/changesets/blob/main/docs/prereleases.md).

## Publish Latest Version

GitHub bot will automatically create a PR to update the latest versions for the released package.

<img width="701" alt="image" src="https://user-images.githubusercontent.com/44047106/215980879-965da73d-317e-4576-81ee-118e11bcc2d4.png">

What we need to do is merge the PR to the `release*` branch.
14 changes: 14 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "restricted",
"baseBranch": "master",
"updateInternalDependencies": "patch",
"ignore": [
"@examples/*",
"ice-website-v3"
]
}
36 changes: 19 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,34 +14,36 @@ jobs:
os: [ubuntu-latest, windows-latest]
fail-fast: false
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set branch name
run: echo >>$GITHUB_ENV BRANCH_NAME=${GITHUB_REF#refs/heads/}
- name: Echo branch name
run: echo ${BRANCH_NAME}
- name: Checkout Branch
uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
registry-url: https://registry.npmjs.org/
- name: Cache .pnpm-store
id: cache
uses: actions/cache@v1
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-node${{ matrix.node-version }}-${{ hashFiles('**/pnpm-lock.yaml') }}
- name: Install pnpm
run: npm i pnpm -g
uses: pnpm/[email protected]
with:
run_install: false
- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: |
${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
.cache
key: ${{ runner.os }}-pnpm-store-node-${{ matrix.node-version }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-node-${{ matrix.node-version }}
- run: npm run setup
- run: npm run dependency:check
- run: npm run lint
- run: npm run test
env:
TEST: true
- run: npm run version:check
env:
CI: true
ACCESS_KEY_ID: ${{ secrets.ACCESS_KEY_ID }}
ACCESS_KEY_SECRET: ${{ secrets.ACCESS_KEY_SECRET }}
CI: true
8 changes: 5 additions & 3 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,12 @@ jobs:
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-node-jest-${{ matrix.node-version }}-${{ hashFiles('**/pnpm-lock.yaml') }}
path: |
${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
.cache
key: ${{ runner.os }}-pnpm-store-node-${{ matrix.node-version }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-node-jest-${{ matrix.node-version }}
${{ runner.os }}-pnpm-store-node-${{ matrix.node-version }}
- run: npm run setup
- run: npm run cov
- name: Upload coverage to Codecov
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Release

on:
push:
branches:
- master

jobs:
release:
name: Release
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16]

steps:
- name: Checkout Branch
uses: actions/checkout@v3

- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 7

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'

- name: Setup
run: pnpm run setup

- name: Publish to npm
id: changesets
uses: changesets/action@v1
with:
publish: pnpm release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
43 changes: 43 additions & 0 deletions .github/workflows/version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Version

on:
push:
branches:
- release/**

jobs:
version:
name: Version
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16]

steps:
- name: Checkout Branch
uses: actions/checkout@v3

- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 7

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'

- name: Install Dependencies
run: pnpm install

- name: Create Release Pull Request
uses: changesets/action@v1
with:
version: pnpm run version
commit: 'chore: update versions'
title: 'chore: update versions'

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
16 changes: 6 additions & 10 deletions .github/workflows/website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,16 @@ jobs:
with:
fetch-depth: 0

- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 7

- name: Use Node.js 16.x
uses: actions/setup-node@v3
with:
node-version: 16.x

- name: Cache .pnpm-store
id: cache
uses: actions/cache@v1
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-node${{ matrix.node-version }}-${{ hashFiles('**/pnpm-lock.yaml') }}

- name: Install pnpm
run: npm i pnpm -g
cache: 'pnpm'

- run: pnpm install --filter=./website

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ coverage
.happypack
.vscode
.tmp
.cache
*.swp
*.dia~
*.temp.json
Expand Down
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
strict-peer-dependencies=false
9 changes: 9 additions & 0 deletions .puppeteerrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const { join } = require('path');

/**
* @type {import("puppeteer").Configuration}
*/
module.exports = {
// Changes the cache location for Puppeteer.
cacheDirectory: join(__dirname, '.cache', 'puppeteer'),
};
3 changes: 2 additions & 1 deletion examples/app-config/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "app-config",
"name": "@examples/app-config",
"version": "1.0.0",
"private": true,
"scripts": {
"start": "ice start",
"build": "ice build",
Expand Down
3 changes: 2 additions & 1 deletion examples/basic-project/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "basic-project",
"name": "@examples/basic-project",
"version": "1.0.0",
"private": true,
"scripts": {
"start": "ice start",
"build": "ice build",
Expand Down
3 changes: 3 additions & 0 deletions examples/basic-project/src/pages/blog.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { Link, useData, useConfig, definePageConfig } from 'ice';
import { isWeb } from '@uni/env';


console.log('isWeb', isWeb);
export default function Blog() {
const data = useData();
const config = useConfig();
Expand Down
3 changes: 2 additions & 1 deletion examples/csr-project/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "basic-project",
"name": "@examples/basic-project",
"version": "1.0.0",
"private": true,
"scripts": {
"start": "ice start",
"build": "ice build"
Expand Down
3 changes: 2 additions & 1 deletion examples/disable-data-loader/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "disable-data-loader",
"name": "@examples/disable-data-loader",
"version": "1.0.0",
"private": true,
"scripts": {
"start": "ice start",
"build": "ice build",
Expand Down
3 changes: 2 additions & 1 deletion examples/hash-router/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "hash-router-demo",
"name": "@examples/hash-router-demo",
"private": true,
"version": "1.0.0",
"scripts": {
"start": "ice start",
Expand Down
3 changes: 2 additions & 1 deletion examples/icestark-child/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "icestarkchild",
"name": "@examples/icestarkchild",
"private": true,
"version": "1.0.0",
"scripts": {
"start": "ice start",
Expand Down
3 changes: 2 additions & 1 deletion examples/icestark-layout/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "icestark-framework",
"name": "@examples/icestark-framework",
"private": true,
"version": "1.0.0",
"scripts": {
"start": "ice start",
Expand Down
3 changes: 2 additions & 1 deletion examples/memory-router/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "memory-router",
"name": "@examples/memory-router",
"private": true,
"version": "1.0.0",
"scripts": {
"start": "ice start",
Expand Down
3 changes: 2 additions & 1 deletion examples/miniapp-project/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "miniapp-project",
"name": "@examples/miniapp-project",
"private": true,
"version": "1.0.0",
"scripts": {
"start": "ice start",
Expand Down
3 changes: 2 additions & 1 deletion examples/multi-target/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "multi-entry",
"name": "@examples/multi-entry",
"private": true,
"version": "1.0.0",
"scripts": {
"start": "ice start",
Expand Down
Loading

0 comments on commit 6dfc4b0

Please sign in to comment.