-
Notifications
You must be signed in to change notification settings - Fork 21
53 lines (44 loc) · 1.51 KB
/
build-publish.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
name: "JFrog-GitHub NPM Publish OIDC Integration"
on: push
# This is required as per
# https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/configuring-openid-connect-in-cloud-providers#adding-permissions-settings
permissions:
id-token: write
jobs:
build:
runs-on: ubuntu-latest
env:
OIDC_AUDIENCE: 'jfrog-github'
OIDC_PROVIDER: 'github'
PLATFORM_REPO: 'eks-npm'
defaults:
run:
working-directory: ./package
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node npm
uses: actions/setup-node@v3
- name: Setup JFrog CLI
uses: jfrog/setup-jfrog-cli@v3
env:
JF_URL: ${{ secrets.JF_URL }}
with:
oidc-provider-name: ${{ env.OIDC_PROVIDER }}
oidc-audience: ${{ env.OIDC_AUDIENCE }}
- name: Set CLI Config
run: jf npm-config --global=true --repo-resolve=$PLATFORM_REPO --repo-deploy=$PLATFORM_REPO
- name: Install Dependencies
run: jf npm install
- name: Run tests
run: npm test
- name: Publish
run: jf npm publish
- name: Publish Build info With JFrog CLI
run: |
# Collect environment variables for the build
jf rt build-collect-env
# Collect VCS details from git and add them to the build
jf rt build-add-git
# Publish build info
jf rt build-publish