Skip to content

Commit

Permalink
CI: add build & automatically update npm version
Browse files Browse the repository at this point in the history
  • Loading branch information
davidkudera committed Jun 25, 2020
1 parent c206861 commit 8bdb28d
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
24 changes: 21 additions & 3 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,15 @@ jobs:
with:
node-version: 12
- run: npm ci
- run: npm test
- run: sed -i "s/0.0.0-version-placeholder/${{github.event.release.tag_name}}/" package.json
- uses: actions/upload-artifact@v1
with:
name: package
path: package.json
- uses: actions/upload-artifact@v1
with:
name: build
path: lib

publish-npm:
needs: build
Expand All @@ -24,7 +32,12 @@ jobs:
with:
node-version: 12
registry-url: https://registry.npmjs.org/
- run: npm ci
- uses: actions/download-artifact@v1
with:
- name: package
- uses: actions/download-artifact@v1
with:
- name: build
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
Expand All @@ -38,7 +51,12 @@ jobs:
with:
node-version: 12
registry-url: https://npm.pkg.github.com/
- run: npm ci
- uses: actions/download-artifact@v1
with:
- name: package
- uses: actions/download-artifact@v1
with:
- name: build
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "google-maps",
"description": "Async loader for google maps api (browser, typescript)",
"version": "4.2.3",
"version": "0.0.0-version-placeholder",
"author": {
"name": "David Kudera",
"email": "kudera.d@gmail.com"
Expand Down

0 comments on commit 8bdb28d

Please sign in to comment.