Publish to npm from GitHub actions (#12526)

* Publish to npm from GitHub actions

* Remove publish-ci from Makefile

This was meant to be used _now_, but I didn't end up using it

* Test

* Revert "Test"

This reverts commit 04095c17db8352710c12849a5b1fa53e853bd6f5.
This commit is contained in:
Nicolò Ribaudo 2020-12-23 00:18:03 +01:00 committed by GitHub
parent d9dfd29ce8
commit 5b5b548036
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 34 additions and 14 deletions

View File

@ -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

View File

@ -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"