-
Notifications
You must be signed in to change notification settings - Fork 183
62 lines (60 loc) · 2.6 KB
/
release_eslint_plugin.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: Release eslint-plugin-sonarjs
# Workflow runs when manually triggered using the UI or API.
on:
workflow_dispatch:
# Inputs the workflow accepts.
inputs:
release_version:
description: 'Version (semver)'
required: true
jobs:
publish:
permissions:
id-token: write # required for SonarSource/vault-action-wrapper
runs-on: ubuntu-latest
env:
RELEASE_TAG: ${{ github.event.inputs.release_version }}
NPM_REPOSITORY: "sonarsource-npm-public"
SCOPE: ""
PACKAGE: "eslint-plugin-sonarjs"
steps:
- name: Vault
id: secrets
uses: SonarSource/vault-action-wrapper@v3
with:
secrets:
development/kv/data/repox url | repox_url;
development/artifactory/token/{REPO_OWNER_NAME_DASH}-qa-deployer access_token | qa_deployer_access_token;
development/artifactory/token/{REPO_OWNER_NAME_DASH}-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@907e87c3d2081a98d2ab8cb03284ee6711f1ee83 # tag=3.2.3
with:
jfrogAccessToken: ${{ fromJSON(steps.secrets.outputs.vault).qa_deployer_access_token }}
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
- run: cp .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 run eslint-plugin:compile
cp .npmrc lib/.npmrc
cd lib
npm version $RELEASE_TAG --no-git-tag-version
npm publish
jfrog rt npm-publish --build-name=eslint-plugin-sonarjs --build-number=${{ github.event.inputs.release_version }}
jfrog rt build-publish eslint-plugin-sonarjs ${{ github.event.inputs.release_version }}
- name: Promote npm package
env:
REPOX_URL: ${{ fromJSON(steps.secrets.outputs.vault).repox_url }}
PROMOTE_ACCESS_TOKEN: ${{ fromJSON(steps.secrets.outputs.vault).promoter_access_token }}
run: |
jfrog config add repox --artifactory-url $REPOX_URL --access-token $PROMOTE_ACCESS_TOKEN
jfrog config use repox
jfrog rt bpr --status it-passed $PACKAGE $RELEASE_TAG sonarsource-npm-public-builds
jfrog rt bpr --status released $PACKAGE $RELEASE_TAG sonarsource-npm-public-releases