diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f1ab63f960..d05380071d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,12 +5,43 @@ on: tags: ["v*"] jobs: - github_release: - name: Trigger GitHub release + log-updates: + name: Log packages to publish runs-on: ubuntu-latest steps: - name: Checkout the new tag - uses: actions/checkout@v1.0.0 + uses: actions/checkout@v2 + with: + fetch-depth: 2 + - name: This release will publish the following packages + run: git diff --name-only HEAD^..HEAD + + npm-release: + name: Publish release on npm + runs-on: ubuntu-latest + needs: log-updates + environment: npm + steps: + - name: Checkout the new tag + uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Build and Test + run: make prepublish + - name: Publish to npm + run: yarn release-tool publish --yes + env: + YARN_NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + + github-release: + name: Trigger GitHub release + runs-on: ubuntu-latest + needs: npm-release + steps: + - name: Checkout the new tag + uses: actions/checkout@v2 + with: + fetch-depth: 0 - name: Get tag info id: tags diff --git a/Makefile b/Makefile index 7cca3c63d8..54179a972b 100644 --- a/Makefile +++ b/Makefile @@ -217,17 +217,6 @@ ifneq ("$(shell grep 3155328e5 .yarn/releases/yarn-*.cjs -c)", "0") @exit 1 endif -publish-ci: prepublish -ifneq ("$(NPM_TOKEN)", "") - echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > .npmrc -else - echo "Missing NPM_TOKEN env var" - exit 1 -endif - $(YARN) release-tool publish --yes - rm -f .npmrc - $(MAKE) clean - publish-test: ifneq ("$(I_AM_USING_VERDACCIO)", "I_AM_SURE") echo "You probably don't know what you are doing"