Skip to content

Commit 13a14d4

Browse files
authored
Merge pull request #552 from nextcloud-libraries/artonge/feat/publish_workflow
Add publish workflow
2 parents a6e586f + 5a1de5b commit 13a14d4

3 files changed

Lines changed: 55 additions & 7 deletions

File tree

.github/workflows/publish.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Publish
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
publish:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: 📥​ Checkout
12+
uses: actions/checkout@v3
13+
14+
- name: 🪄 Read package.json node and npm engines version
15+
uses: skjnldsv/read-package-engines-version-actions@v1.2
16+
id: versions
17+
with:
18+
fallbackNode: '^16'
19+
fallbackNpm: '^8'
20+
21+
- name: 🔧​ Setup Node (NPM Registry)
22+
uses: actions/setup-node@v3
23+
with:
24+
node-version: ${{ steps.versions.outputs.nodeVersion }}
25+
cache: 'npm'
26+
registry-url: 'https://registry.npmjs.org'
27+
28+
- name: 📦 Install dependencies & build
29+
run: |
30+
npm ci
31+
npm run build
32+
33+
- name: 📣 Publish package on NPM
34+
run: npm publish
35+
env:
36+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
37+
38+
- name: 🔧​ Setup Github Registry
39+
uses: actions/setup-node@v3
40+
with:
41+
registry-url: 'https://npm.pkg.github.com'
42+
43+
- name: 📣 Publish package on GPR
44+
run: npm publish
45+
env:
46+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

package-lock.json

Lines changed: 7 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
"@nextcloud/eslint-config": "^8.3.0-beta.2",
3838
"@nextcloud/typings": "^1.6.0",
3939
"@types/jest": "^29.2.5",
40+
"@types/node": "^20.6.3",
4041
"eslint": "^8.44.0",
4142
"jest": "^29.3.1",
4243
"jest-environment-jsdom": "^29.3.1",
@@ -55,4 +56,4 @@
5556
"dist/",
5657
"CHANGELOG.md"
5758
]
58-
}
59+
}

0 commit comments

Comments
 (0)