-
Notifications
You must be signed in to change notification settings - Fork 2
53 lines (46 loc) · 1.44 KB
/
publish.yml
File metadata and controls
53 lines (46 loc) · 1.44 KB
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: publish
on:
push:
branches:
- main
jobs:
publish:
runs-on: ubuntu-24.04
permissions:
contents: 'write'
id-token: 'write'
issues: 'write'
pull-requests: 'write'
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up pnpm
uses: pnpm/action-setup@v4
- name: Set up Node 22
uses: actions/setup-node@v4
with:
node-version: '22'
- name: Cache node_modules
uses: actions/cache@v4
with:
path: node_modules
key: node-modules-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}
- name: Install
run: pnpm run ci
- name: Build
run: pnpm run build:ci
- uses: google-github-actions/auth@v2
id: auth
with:
token_format: access_token
workload_identity_provider: projects/1030413944741/locations/global/workloadIdentityPools/github-pool/providers/github-provider
service_account: github-publisher@hypertrace-repos.iam.gserviceaccount.com
# Ref https://github.com/semantic-release/npm/pull/844
- name: Update npmrc for publish
shell: bash
run: echo "@hypertrace:registry=${{ secrets.GAR_NPM_PUBLISH_REGISTRY }}" >> .npmrc
- name: Publish
run: pnpm run semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ steps.auth.outputs.access_token }}