Skip to content

Commit

Permalink
Update main.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
kilchenmann committed Aug 4, 2020
1 parent 94e0668 commit d37275c
Showing 1 changed file with 25 additions and 10 deletions.
35 changes: 25 additions & 10 deletions .github/workflows/main.yml
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
Expand All @@ -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 }}

0 comments on commit d37275c

Please sign in to comment.