Skip to content

Commit

Permalink
Merge pull request #552 from nextcloud-libraries/artonge/feat/publish…
Browse files Browse the repository at this point in the history
…_workflow

Add publish workflow
  • Loading branch information
artonge authored Sep 20, 2023
2 parents a6e586f + 5a1de5b commit 13a14d4
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 7 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Publish

on:
release:
types: [published]

jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: 📥​ Checkout
uses: actions/checkout@v3

- name: 🪄 Read package.json node and npm engines version
uses: skjnldsv/read-package-engines-version-actions@v1.2
id: versions
with:
fallbackNode: '^16'
fallbackNpm: '^8'

- name: 🔧​ Setup Node (NPM Registry)
uses: actions/setup-node@v3
with:
node-version: ${{ steps.versions.outputs.nodeVersion }}
cache: 'npm'
registry-url: 'https://registry.npmjs.org'

- name: 📦 Install dependencies & build
run: |
npm ci
npm run build
- name: 📣 Publish package on NPM
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: 🔧​ Setup Github Registry
uses: actions/setup-node@v3
with:
registry-url: 'https://npm.pkg.github.com'

- name: 📣 Publish package on GPR
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
13 changes: 7 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"@nextcloud/eslint-config": "^8.3.0-beta.2",
"@nextcloud/typings": "^1.6.0",
"@types/jest": "^29.2.5",
"@types/node": "^20.6.3",
"eslint": "^8.44.0",
"jest": "^29.3.1",
"jest-environment-jsdom": "^29.3.1",
Expand All @@ -55,4 +56,4 @@
"dist/",
"CHANGELOG.md"
]
}
}

0 comments on commit 13a14d4

Please sign in to comment.