-
Notifications
You must be signed in to change notification settings - Fork 8
97 lines (84 loc) · 2.91 KB
/
release.yml
File metadata and controls
97 lines (84 loc) · 2.91 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
name: Release
on:
workflow_dispatch:
inputs:
dryRun:
description: 'Do a dry run to preview instead of a real release'
required: true
default: 'true'
jobs:
authorize:
name: Authorize
runs-on: ubuntu-latest
steps:
- name: ${{ github.actor }} permission check to do a release
uses: octokit/request-action@57ec46afcc4c58c813af3afe67e57ced1ea9f165 # v2.0.0
with:
route: GET /repos/:repository/collaborators/${{ github.actor }}
repository: ${{ github.repository }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
release:
name: Release
runs-on: ubuntu-latest
needs: [ authorize ]
permissions:
id-token: write
contents: write
steps:
- name: Checkout
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
# Needed for lerna version to determine last tag
- name: Fetch
run: git fetch --prune --unshallow --tags
- name: Cache Node Modules
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- name: Setup Node
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: '20'
registry-url: 'https://registry.npmjs.org'
- name: Update npm
run: npm install -g npm@latest
- name: Install
run: yarn install --frozen-lockfile
- name: Build
run: npx lerna exec yarn
- name: Test
run: yarn test --testPathIgnorePatterns "benchmark.test.ts"
env:
API_KEY: ${{ secrets.API_KEY }}
SECRET_KEY: ${{ secrets.SECRET_KEY }}
EU_API_KEY: ${{ secrets.EU_API_KEY }}
EU_SECRET_KEY: ${{ secrets.EU_SECRET_KEY }}
MANAGEMENT_API_KEY: ${{ secrets.MANAGEMENT_API_KEY }}
- name: Configure Git User
run: |
git config --global user.name amplitude-sdk-bot
git config --global user.email amplitude-sdk-bot@users.noreply.github.com
- name: Release (Dry Run)
if: ${{ github.event.inputs.dryRun == 'true'}}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_CONFIG_PROVENANCE: true
run: |
yarn lerna version -m "chore(release): publish %s" \
--conventional-commits \
--no-push \
--no-git-tag-version \
--loglevel silly \
--yes
- name: Release
if: ${{ github.event.inputs.dryRun == 'false'}}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
yarn lerna version -m "chore(release): publish %s" \
--conventional-commits \
--create-release github \
--loglevel silly \
--yes
yarn lerna publish from-git --yes --loglevel silly