Skip to content

Commit 99b4f73

Browse files
committed
Workflow for npm publish got included!
1 parent 6e40b28 commit 99b4f73

File tree

2 files changed

+46
-1
lines changed

2 files changed

+46
-1
lines changed

.github/workflows/npm-publish.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages
3+
4+
name: '@smakss/random-array-element'
5+
6+
on:
7+
release:
8+
types: [created]
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v2
15+
- uses: actions/setup-node@v1
16+
with:
17+
node-version: 12
18+
19+
publish-npm:
20+
needs: build
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v2
24+
- uses: actions/setup-node@v1
25+
with:
26+
node-version: 12
27+
registry-url: https://registry.npmjs.org/
28+
scope: '@smakss'
29+
- run: npm publish
30+
env:
31+
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
32+
33+
publish-gpr:
34+
needs: build
35+
runs-on: ubuntu-latest
36+
steps:
37+
- uses: actions/checkout@v2
38+
- uses: actions/setup-node@v1
39+
with:
40+
node-version: 12
41+
registry-url: https://npm.pkg.github.com/
42+
scope: '@smakss'
43+
- run: npm publish
44+
env:
45+
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@smakss/random-array-element",
3-
"version": "1.1.1",
3+
"version": "1.1.2",
44
"description": "Selects a random unique array element without repetition from provided array.",
55
"type": "module",
66
"main": "./index.cjs",

0 commit comments

Comments
 (0)