diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..a331c42 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,39 @@ +name: CI + +on: + push: + branches: [ $default-branch ] + pull_request: + branches: [ $default-branch ] + +jobs: + build: + + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [12.x, 14.x] + + steps: + - uses: actions/checkout@v2 + + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v2 + with: + node-version: ${{ matrix.node-version }} + + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(yarn cache dir)" + + - uses: actions/cache@v2 + id: yarn-cache + with: + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- + - run: yarn + - run: yarn ci + - run: yarn docs:build diff --git a/.github/workflows/now.yml b/.github/workflows/now.yml index 7543c88..16064b8 100644 --- a/.github/workflows/now.yml +++ b/.github/workflows/now.yml @@ -12,7 +12,7 @@ jobs: env: NOW_DEPLOY: true run: | - yarn install + yarn yarn docs:build - uses: amondnet/vercel-action@v19 id: vercel-deployment-production diff --git a/.github/workflows/publish-1.x.yml b/.github/workflows/publish-1.x.yml new file mode 100644 index 0000000..21b3792 --- /dev/null +++ b/.github/workflows/publish-1.x.yml @@ -0,0 +1,28 @@ +name: Publish 1.x VERSION + +on: + push: + branches: + - 1.x + tags: + - v1.* + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - uses: actions/setup-node@v2 + with: + node-version: '14.x' + check-latest: true + registry-url: 'https://registry.npmjs.org' + + - run: yarn + - run: yarn ci + - run: yarn publish --tag qiankun1 + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} diff --git a/.github/workflows/publish-latest.yml b/.github/workflows/publish-latest.yml new file mode 100644 index 0000000..6030d7e --- /dev/null +++ b/.github/workflows/publish-latest.yml @@ -0,0 +1,28 @@ +name: Publish LATEST VERSION + +on: + push: + branches: + - master + tags: + - v2.* + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - uses: actions/setup-node@v2 + with: + node-version: '14.x' + check-latest: true + registry-url: 'https://registry.npmjs.org' + + - run: yarn + - run: yarn ci + - run: yarn publish --tag latest + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} diff --git a/.github/workflows/publish-next.yml b/.github/workflows/publish-next.yml new file mode 100644 index 0000000..0263b24 --- /dev/null +++ b/.github/workflows/publish-next.yml @@ -0,0 +1,28 @@ +name: Publish NEXT VERSION + +on: + push: + branches: + - next + tags: + - v3.* + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - uses: actions/setup-node@v2 + with: + node-version: '14' + check-latest: true + registry-url: 'https://registry.npmjs.org' + + - run: yarn + - run: yarn ci + - run: yarn publish --tag next + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index ce50dce..0000000 --- a/.travis.yml +++ /dev/null @@ -1,42 +0,0 @@ -language: node_js -node_js: - - lts/* -install: - - yarn install -cache: - yarn: true - directories: - - node_modules -script: - - yarn ci - - yarn docs:build - -#after_success: -# - npm run codecov - -before_deploy: | - function npm_dist_tag() { - if [[ "$TRAVIS_TAG" = *"-"* ]]; then - echo "next" - else - echo "latest" - fi - } - -deploy: - - edge: true - provider: npm - email: kuitos.lau@gmail.com - api_key: $NPM_AUTH_TOKEN - skip_cleanup: true - on: - tags: true - tag: $(npm_dist_tag) - - - provider: pages - skip_cleanup: true - local_dir: dist - github_token: $GITHUB_TOKEN - keep_history: true - on: - branch: master