Skip to content
This repository has been archived by the owner on Oct 3, 2024. It is now read-only.

Workflow file for this run

on:
release:
types:
- published
jobs:
publish:
permissions:
id-token: write # required for SonarSource/vault-action-wrapper
runs-on: ubuntu-latest
env:
RELEASE_TAG: ${{ github.event.release.tag_name }}
NPM_REPOSITORY: "sonarsource-npm-public"
SCOPE: ""
PACKAGE: "eslint-plugin-sonarjs"
steps:
- name: Vault
id: secrets
uses: SonarSource/vault-action-wrapper@d1c1ab4ca5ad07fd9cdfe1eff038a39673dfca64 # tag=2.4.2-1
with:
secrets:
development/kv/data/repox url | repox_url;
development/artifactory/token/SonarSource-eslint-plugin-sonarjs-qa-deployer access_token | qa_deployer_access_token;
development/artifactory/token/SonarSource-eslint-plugin-sonarjs-promoter access_token | promoter_access_token;
development/kv/data/npmjs sonartech_npm_token | npm_token;
- name: Setup JFrog for deploy
uses: SonarSource/jfrog-setup-wrapper@eb712d76540e5d1f3756303f30387657fb204e52 # tag=2.4.1-1
with:
jfrogAccessToken: ${{ fromJSON(steps.secrets.outputs.vault).qa_deployer_access_token }}
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: 12
- run: mv .github/workflows/.npmrc .npmrc
- name: Publish npm package
env:
NPM_TOKEN: ${{ fromJSON(steps.secrets.outputs.vault).npm_token }}
run: |
jfrog rt npm-config --repo-resolve npm --repo-deploy sonarsource-npm-public-qa
jfrog rt npm-ci
npm publish
jfrog rt npm-publish --build-name=eslint-plugin-sonarjs --build-number=${{ github.event.release.tag_name }}
jfrog rt build-publish eslint-plugin-sonarjs ${{ github.event.release.tag_name }}
- name: Promote npm package
env:
PROMOTER_TOKEN: ${{ fromJSON(steps.secrets.outputs.vault).promoter_access_token }}
REPOX_URL: ${{ fromJSON(steps.secrets.outputs.vault).repox_url }}
run: |
jfrog rt bpr --access-token $PROMOTER_TOKEN --url $REPOX_URL --status it-passed eslint-plugin-sonarjs ${{ github.event.release.tag_name }} sonarsource-npm-public-builds
jfrog rt bpr --access-token $PROMOTER_TOKEN --url $REPOX_URL --status released eslint-plugin-sonarjs ${{ github.event.release.tag_name }} sonarsource-npm-public-releases