-
Notifications
You must be signed in to change notification settings - Fork 1
61 lines (51 loc) · 1.67 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
61
name: Publish Package to npmjs
on:
workflow_call:
inputs:
commit_hash:
description: "Commit to checkout and to publish"
required: true
type: string
workflow_dispatch:
inputs:
commit_hash:
description: "Commit to checkout and to publish"
required: true
type: string
jobs:
publish:
runs-on: ["self-hosted", "org", "npm-publish"]
permissions:
contents: write
id-token: write
pull-requests: write
repository-projects: write
steps:
- uses: actions/checkout@v4
with:
ref: main
- 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/setup-node@v4
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 --access public
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 }}