Skip to content

Commit

Permalink
setup: integrate publishing to github packages
Browse files Browse the repository at this point in the history
Co-Authored-By: Jan Vogt <[email protected]>
Co-Authored-By: Sven Kube <[email protected]>
  • Loading branch information
3 people committed Apr 14, 2020
1 parent 829f2e3 commit e116c8a
Showing 1 changed file with 43 additions and 9 deletions.
52 changes: 43 additions & 9 deletions .github/workflows/github-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,46 @@ on:
- v*

jobs:
build:
run-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Install Node-Version 12
uses: actions/setup-node@v1
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '12'
- name: Run npm install, bundle and test
run: |
- run: |
npm install
npm run test:unit
npm run test:integration
env:
CI: true
publish-github-package:
needs: run-tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '12'
registry-url: https://npm.pkg.github.com/
- run: npm install
- run: sed -i '2s/sipgateio/\@sipgate-io\/sipgateio/' package.json
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.ACCESS_TOKEN}}

publish-github-release:
needs: run-tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '12'
- run: |
npm install
npm run bundle
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
Expand All @@ -40,7 +65,16 @@ jobs:
env:
GHR_PATH: bundle/sipgate-io.min.js
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
- name: NPM Publish
uses: JS-DevTools/npm-publish@v1

publish-npm-package:
needs: run-tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '12'
- run: npm install
- uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_AUTH_TOKEN }}

0 comments on commit e116c8a

Please sign in to comment.