Skip to content

Commit

Permalink
workflow to publish package
Browse files Browse the repository at this point in the history
  • Loading branch information
ntrappe-msft committed May 16, 2024
1 parent 4a05eae commit f7d8bc4
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 2 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/release-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Node.js Package

on:
release:
types: [created]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 16
- run: npm ci
- run: npm test

publish-gpr:
needs: build
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 16
registry-url: https://npm.pkg.github.com/
- run: npm ci
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@microsoft:registry=https://npm.pkg.github.com
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,8 @@
"bugs": {
"url": "https://github.com/microsoft/Windows-Containers-Tutorials/issues"
},
"homepage": "https://github.com/microsoft/Windows-Containers-Tutorials#readme"
}
"homepage": "https://github.com/microsoft/Windows-Containers-Tutorials#readme",
"publishConfig": {
"@microsoft:registry": "https://npm.pkg.github.com"
}
}

0 comments on commit f7d8bc4

Please sign in to comment.