diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml index c7f158389..dd6c2b9e8 100644 --- a/.github/workflows/node.yml +++ b/.github/workflows/node.yml @@ -14,7 +14,6 @@ permissions: pull-requests: write packages: write - jobs: lint: runs-on: ubuntu-latest @@ -30,6 +29,7 @@ jobs: cache: 'npm' - run: npm ci - run: npm run lint + tests: runs-on: ubuntu-latest strategy: @@ -58,9 +58,11 @@ jobs: strategy: matrix: node-version: [16.20.0] - # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ steps: - uses: actions/checkout@v2 + with: + token: ${{ secrets.PAT_TOKEN }} + fetch-depth: 0 - name: Install, build, configure git and lerna publish uses: actions/setup-node@v2 with: @@ -69,29 +71,31 @@ jobs: registry-url: 'https://registry.npmjs.org' - run: npm ci - run: npm run build --if-present - - run: git config --global user.email "octocat@github.com" - - run: git config --global user.name "GitHub Actions" - - run: git remote set-url origin https://wix@github.com/wix/pro-gallery - run: | + git config --global user.email "octocat@github.com" + git config --global user.name "GitHub Actions" + git remote set-url origin https://${{ secrets.PAT_TOKEN }}@github.com/wix/pro-gallery echo "registry=http://registry.npmjs.org/" >> .npmrc echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> .npmrc env: NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + PAT_TOKEN: ${{ secrets.PAT_TOKEN }} - name: Push to master if: github.event_name == 'push' - # run: echo "this is a push to master" run: | git checkout ${{ github.ref_name }} lerna publish patch --exact --yes --dist-tag stable --registry https://registry.npmjs.org npm run changelog env: NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + PAT_TOKEN: ${{ secrets.PAT_TOKEN }} - name: Push to pull request if: github.event_name == 'pull_request' && github.actor != 'dependabot' - # run: echo "PULL REQUEST PUSH" run: lerna publish --canary --preid ${{ github.sha }} --yes --registry https://registry.npmjs.org env: NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + PAT_TOKEN: ${{ secrets.PAT_TOKEN }} + update-playground: runs-on: ubuntu-latest if: github.ref == 'refs/heads/master' @@ -113,5 +117,3 @@ jobs: env: SURGE_LOGIN: ${{ secrets.SURGE_LOGIN }} SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }} - -