diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..bbf5b35 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,37 @@ +name: Release + +on: [push] + +jobs: + release: + runs-on: ubuntu-latest + if: "!contains(github.event.head_commit.message, 'ci skip') && !contains(github.event.head_commit.message, 'skip ci')" + steps: + - uses: actions/checkout@v2 + + - name: Prepare repository + run: git fetch --unshallow --tags + + - name: Use Node.js 12.x + uses: actions/setup-node@v1 + with: + node-version: 12.x + + - name: Cache node modules + uses: actions/cache@v1 + with: + path: node_modules + key: yarn-deps-${{ hashFiles('yarn.lock') }} + restore-keys: | + yarn-deps-${{ hashFiles('yarn.lock') }} + + - name: Create Release + env: + GH_TOKEN: ${{ secrets.GH_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + run: | + yarn install --frozen-lockfile + yarn prettier + yarn build + yarn test + npx auto shipit \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 5ed6f30..0000000 --- a/.travis.yml +++ /dev/null @@ -1,51 +0,0 @@ -language: node_js -node_js: - - "12" -cache: yarn - -env: - global: - - GIT_NAME="uikenshoo" - - GIT_EMAIL="ui@kenshoo.com" - -before_script: - - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter - - chmod +x ./cc-test-reporter - - ./cc-test-reporter before-build - -script: - - export BRANCH=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then echo $TRAVIS_BRANCH; else echo $TRAVIS_PULL_REQUEST_BRANCH; fi) - - yarn prettier - - yarn test - - yarn build - - if [ "$BRANCH" == "master" ]; - then - yarn workspace @kenshooui/react-tree-docs chromatic --auto-accept-changes; - elif [[ $TRAVIS_EVENT_TYPE != 'pull_request' || $TRAVIS_PULL_REQUEST_SLUG != $TRAVIS_REPO_SLUG ]]; - then - yarn workspace @kenshooui/react-tree-docs chromatic; - fi - -after_success: - - ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT - - yarn build-storybook - -before_deploy: - - if [ "$BRANCH" == "master" ]; then - git checkout master; - git fetch --tags; - fi; - -deploy: - - provider: script - script: if [ "$GH_TOKEN" != "false" ]; then npx auto shipit; fi; - skip-cleanup: true - on: - all_branches: true - - provider: pages - local-dir: "./storybook-static" - skip-cleanup: true - github-token: $GH_TOKEN - keep-history: true - on: - branch: master \ No newline at end of file