Unverified Commit 007054cb authored by Tom Darneix's avatar Tom Darneix Committed by GitHub
Browse files

enh(npm-publish): Push npm package version using github PAT token (#324)



Co-authored-by: default avatartechnique-ci <technique-ci@users.noreply.github.com>
parent 49a28b9e
......@@ -16,7 +16,6 @@ on:
- js-config-*
env:
version: "23.04"
directory: "centreon/packages/js-config"
centreon_directory: "centreon"
......@@ -27,6 +26,8 @@ jobs:
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.head_ref || github.ref_name }}
- uses: actions/setup-node@v3
with:
......@@ -34,25 +35,35 @@ jobs:
- name: Update JS config version
run: |
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
git config user.name "$GITHUB_ACTOR"
git config --local user.email "technique-ci@users.noreply.github.com"
git config --local user.name "technique-ci"
git config pull.rebase false
npm version patch -m "js-config-%s" --legacy-peer-deps
VERSION=js-config-$(node -p "require('./package.json').version")
git pull
git pull origin ${{ github.head_ref || github.ref_name }}
git add .
git commit -m "chore: release ${VERSION}"
git tag ${VERSION}
working-directory: ${{ env.directory }}
- name: Push changes to repository
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: git push origin develop && git push --tags
- name: Push changes
uses: ad-m/github-push-action@master
with:
branch: ${{ github.head_ref || github.ref_name }}
github_token: ${{ secrets.CENTREON_TECHNIQUE_PAT }}
ssh: false
- name: Push changes with tags
uses: ad-m/github-push-action@master
with:
branch: ${{ github.head_ref || github.ref_name }}
github_token: ${{ secrets.CENTREON_TECHNIQUE_PAT }}
tags: true
ssh: false
- uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}
package: ${{ env.directory }}/package.json
tag: ${{ github.head_ref || github.ref_name }}
tag: latest
access: public
......@@ -71,10 +71,20 @@ jobs:
git tag ${VERSION}
working-directory: ${{ env.directory }}
- name: Push changes to repository
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: git push origin develop && git push --tags
- name: Push changes
uses: ad-m/github-push-action@master
with:
branch: ${{ github.head_ref || github.ref_name }}
github_token: ${{ secrets.CENTREON_TECHNIQUE_PAT }}
ssh: false
- name: Push changes with tags
uses: ad-m/github-push-action@master
with:
branch: ${{ github.head_ref || github.ref_name }}
github_token: ${{ secrets.CENTREON_TECHNIQUE_PAT }}
tags: true
ssh: false
- uses: JS-DevTools/npm-publish@v1
with:
......
......@@ -107,10 +107,20 @@ jobs:
git tag ${VERSION}
working-directory: ${{ env.directory }}
- name: Push changes to repository
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: git push origin develop && git push --tags
- name: Push changes
uses: ad-m/github-push-action@master
with:
branch: ${{ github.head_ref || github.ref_name }}
github_token: ${{ secrets.CENTREON_TECHNIQUE_PAT }}
ssh: false
- name: Push changes with tags
uses: ad-m/github-push-action@master
with:
branch: ${{ github.head_ref || github.ref_name }}
github_token: ${{ secrets.CENTREON_TECHNIQUE_PAT }}
tags: true
ssh: false
- uses: JS-DevTools/npm-publish@v1
with:
......
{
"name": "@centreon/js-config",
"description": "Centreon Frontend shared build configuration",
"version": "23.4.0",
"version": "23.4.1",
"repository": {
"type": "git",
"url": "git+https://github.com/centreon/centreon-frontend.git"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment