-
Notifications
You must be signed in to change notification settings - Fork 1
60 lines (49 loc) · 1.81 KB
/
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
54
55
56
57
58
59
60
name: Publish Package to npmjs
on:
workflow_call:
workflow_dispatch:
jobs:
publish:
runs-on: ["self-hosted", "org", "npm-publish"]
permissions:
contents: write
id-token: write
pull-requests: write
repository-projects: write
steps:
- name: Get GitHub Token from Akeyless
id: get_github_token
uses:
docker://us-west1-docker.pkg.dev/devopsre/akeyless-public/akeyless-action:latest
with:
api-url: https://api.gateway.akeyless.celo-networks-dev.org
access-id: p-kf9vjzruht6l
dynamic-secrets: '{"/dynamic-secrets/keys/github/compliance/contents=write,pull_requests=write":"PAT"}'
- name: Get NPM Token from Akeyless
id: get_npmjs_token
uses: docker://us-west1-docker.pkg.dev/devopsre/akeyless-public/akeyless-action:latest
with:
api-url: https://api.gateway.akeyless.celo-networks-dev.org
access-id: p-kf9vjzruht6l
static-secrets: '{"/static-secrets/NPM/npm-publish-token":"NPM_TOKEN"}'
- uses: actions/checkout@v4
with:
token: ${{ env.PAT }}
- uses: actions/setup-node@v3
with:
node-version: "18.x"
registry-url: "https://registry.npmjs.org"
- run: npm install
- name: Compile typescript library
run: npm run build
- name: Bump version
id: bump_version
run: echo "NPM_VERSION=$(npm version patch --no-git-tag-version)" >> $GITHUB_OUTPUT
- name: Publish
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ env.NPM_TOKEN }}
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "auto: publish ${{ steps.bump_version.outputs.NPM_VERSION }}"
tagging_message: ${{ steps.bump_version.outputs.NPM_VERSION }}