-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
94e0668
commit d37275c
Showing
1 changed file
with
25 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
# This is a workflow to publish new package on npm after github release | ||
|
||
name: CI | ||
|
||
# Controls when the action will run. Triggers the workflow on push or pull request | ||
|
@@ -10,23 +8,40 @@ on: | |
types: [published] | ||
|
||
jobs: | ||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v1 | ||
with: | ||
node-version: 12 | ||
registry-url: https://registry.npmjs.org/ | ||
- run: npm install | ||
- run: npm run build | ||
|
||
publish: | ||
name: Write release notes | ||
needs: [build] | ||
runs-on: ubuntu-latest | ||
if: github.event_name == 'release' && startsWith(github.ref, 'refs/tags') | ||
# additional if condition: compare tag with package.json version | ||
# - name: Get the version | ||
# id: get_version | ||
# run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} | ||
# --> solution from https://github.community/t5/GitHub-Actions/How-to-get-just-the-tag-name/td-p/31595 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v1 | ||
with: | ||
node-version: 12 | ||
registry-url: https://registry.npmjs.org/ | ||
- run: npm install | ||
- run: npm run build | ||
- if: "github.event.release.prerelease" | ||
uses: lakto/[email protected] | ||
uses: lakto/[email protected] | ||
with: | ||
options: '--override --prerelease' | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | ||
- if: "!github.event.release.prerelease" | ||
uses: lakto/gren-action@v1.1.0 | ||
uses: lakto/gren-action@v2.0.0 | ||
with: | ||
options: ' --override' | ||
options: '--override' | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} |