From 42fb9fda6c7e9da3faa7c375a77426fc01c39982 Mon Sep 17 00:00:00 2001 From: Yann Soubeyrand Date: Tue, 19 Mar 2024 11:59:46 +0100 Subject: [PATCH] ci: add NPM package publication workflow --- .github/workflows/publish.yml | 39 +++++++++++++++++++++++++++++++++++ package.json | 4 ++-- 2 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 00000000000..22846d3fcf7 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,39 @@ +name: 'Publish NPM package' + +on: + release: + types: + - 'published' + +jobs: + publish: + name: 'Publish' + runs-on: 'ubuntu-22.04' + + permissions: + contents: 'read' + packages: 'write' + + steps: + - name: 'Check out repository' + id: 'checkout' + uses: 'actions/checkout@v4' + + - name: 'Set up Node.js' + id: 'setup-node' + uses: 'actions/setup-node@v4' + with: + registry-url: 'https://npm.pkg.github.com' + cache: 'npm' + + - name: 'Run npm clean-install' + id: 'run-npm-clean-install' + run: | + npm clean-install + + - name: 'Run npm publish' + id: 'run-npm-publish' + env: + NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + npm publish --access 'public' diff --git a/package.json b/package.json index 59cbdc312f8..124c807c54f 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "reveal.js", + "name": "@camptocamp/reveal.js", "version": "5.1.0", "description": "The HTML Presentation Framework", "homepage": "https://revealjs.com", @@ -19,7 +19,7 @@ }, "repository": { "type": "git", - "url": "git://github.com/hakimel/reveal.js.git" + "url": "git://github.com/camptocamp/reveal.js.git" }, "engines": { "node": ">=18.0.0"