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:
parent
d9dfd29ce8
commit
5b5b548036
37
.github/workflows/release.yml
vendored
37
.github/workflows/release.yml
vendored
@ -5,12 +5,43 @@ on:
|
|||||||
tags: ["v*"]
|
tags: ["v*"]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
github_release:
|
log-updates:
|
||||||
name: Trigger GitHub release
|
name: Log packages to publish
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout the new tag
|
- 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
|
- name: Get tag info
|
||||||
id: tags
|
id: tags
|
||||||
|
|||||||
11
Makefile
11
Makefile
@ -217,17 +217,6 @@ ifneq ("$(shell grep 3155328e5 .yarn/releases/yarn-*.cjs -c)", "0")
|
|||||||
@exit 1
|
@exit 1
|
||||||
endif
|
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:
|
publish-test:
|
||||||
ifneq ("$(I_AM_USING_VERDACCIO)", "I_AM_SURE")
|
ifneq ("$(I_AM_USING_VERDACCIO)", "I_AM_SURE")
|
||||||
echo "You probably don't know what you are doing"
|
echo "You probably don't know what you are doing"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user