Skip to content

Commit

Permalink
ci: add publish on npm job
Browse files Browse the repository at this point in the history
  • Loading branch information
marc-gavanier committed May 31, 2022
1 parent 67720cf commit 4862e4c
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: Release
name: Release and publish

on:
push:
Expand Down Expand Up @@ -124,6 +124,12 @@ jobs:
- name: Build
run: yarn build client-application

- name: Add readme, license and package files
run: |
mv projects/client-application/README.md dist/client-application/
mv projects/client-application/LICENSE.md dist/client-application/
mv projects/client-application/package.json dist/client-application/
- name: Upload build artifact
uses: actions/upload-artifact@v3
with:
Expand Down Expand Up @@ -184,8 +190,11 @@ jobs:
name: build
path: dist

- name: Add license file
run: mv LICENSE.md dist/client-application/
- name: Add readme, license and package files
run: |
mv README.md dist/client-application/
mv LICENSE.md dist/client-application/
mv package.json dist/client-application/
- name: Zip release
run: zip -r release.zip dist/client-application/
Expand All @@ -194,3 +203,30 @@ jobs:
uses: softprops/action-gh-release@v1
with:
files: release.zip

publish:
name: Publish
runs-on: ubuntu-latest
needs: [release]

steps:
- name: Set up Node.js
uses: actions/setup-node@v3
with:
always-auth: true
node-version: '16.x'
registry-url: https://registry.npmjs.org
scope: '@gouvfr-anct'

- name: Download build artifact
uses: actions/download-artifact@v3
with:
name: build
path: release

- name: Publish on npm
run: |
cd release/client-application/
yarn publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}
27 changes: 27 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"name": "@gouvfr-anct/cartographie-nationale",
"version": "2.0.0",
"description": "💻 Client pour l'affichage de la cartographie nationale de l’offre de médiation numérique dans un navigateur web.",
"keywords": [
"angular",
"client",
"gouvernement",
"betagouv",
"cartographie",
"anct",
"médiation numérique"
],
"homepage": "https://npmjs.com/package/@gouvfr-anct/cartographie-nationale",
"license": "SEE LICENSE IN LICENSE.md",
"contributors": [
{
"name": "Marc Gavanier",
"email": "marc.gavanier@gmail.com",
"url": "https://www.linkedin.com/in/marc-gavanier/"
}
],
"repository": {
"type": "git",
"url": "https://github.com/anct-cartographie-nationale/client-base.git"
}
}

0 comments on commit 4862e4c

Please sign in to comment.