From 4dcb0ebd8a0bf26e393dc785bb55e5fd63d490e4 Mon Sep 17 00:00:00 2001 From: Lior Date: Thu, 25 Feb 2021 09:30:44 -0500 Subject: [PATCH 1/3] Migrate to Github Actions --- .github/workflows/release.yml | 37 +++++++++++++++++++++++++ .travis.yml | 51 ----------------------------------- 2 files changed, 37 insertions(+), 51 deletions(-) create mode 100644 .github/workflows/release.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..3f617fe --- /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: + GITHUB_TOKEN: ${{ secrets.GITHUB_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 From 9f8b85b2d9dd8343b7225ca88a791e060b1bff15 Mon Sep 17 00:00:00 2001 From: Lior Date: Thu, 25 Feb 2021 09:38:05 -0500 Subject: [PATCH 2/3] use CI token --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3f617fe..6a740cf 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -27,7 +27,7 @@ jobs: - name: Create Release env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} run: | yarn install --frozen-lockfile From 284d39fb6ae1723a5605cdfc18e76405d8f361fe Mon Sep 17 00:00:00 2001 From: Lior Date: Thu, 25 Feb 2021 09:41:10 -0500 Subject: [PATCH 3/3] change env name --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6a740cf..bbf5b35 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -27,7 +27,7 @@ jobs: - name: Create Release env: - GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + GH_TOKEN: ${{ secrets.GH_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} run: | yarn install --frozen-lockfile