From 933b0e4cd42538512d87b412d4eec293be474b4d Mon Sep 17 00:00:00 2001 From: George Avsetsin Date: Tue, 18 May 2021 18:27:58 +0300 Subject: [PATCH] feature: release workflow --- .github/workflows/release.yml | 39 +++++++++++++++++++++++++++++++++++ package.json | 3 +-- 2 files changed, 40 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..bb7b7dac --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,39 @@ +name: Publish +on: + release: + types: [created] + +jobs: + test-components: + runs-on: ubuntu-latest + steps: + - name: Checkout repo + uses: actions/checkout@v2 + - name: Set up node + uses: actions/setup-node@v2 + with: + node-version: '12.x' + registry-url: 'https://registry.npmjs.org' + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(yarn config get cacheFolder)" + - name: Cache Yarn + id: yarn-cache + uses: actions/cache@v2 + with: + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- + - name: Install dependencies + run: yarn install --immutable + - name: Run lint + run: yarn lint + - name: Build Components + run: yarn build + - name: Run tests + run: yarn test + - name: Publish packages + run: yarn publish:submit + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/package.json b/package.json index a54cb0d8..1d280627 100644 --- a/package.json +++ b/package.json @@ -16,8 +16,7 @@ "g:types": "cd $INIT_CWD && tsc", "test": "jest", "test:coverage": "jest coverage", - "publish": "yarn build && yarn test && yarn publish:submit", - "publish:submit": "yarn workspaces foreach -p -i -v -t --exclude lido-ui-components npm publish --tolerate-republish", + "publish:submit": "yarn workspaces foreach -piv --topological-dev --exclude lido-ui-components npm publish --tolerate-republish", "lint": "eslint --ext ts,tsx,js,jsx --ignore-path .gitignore .", "postinstall": "husky install" },