-
Notifications
You must be signed in to change notification settings - Fork 19
107 lines (104 loc) · 3.73 KB
/
manual-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
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
98
99
100
101
102
103
104
105
106
107
name: Publish Package
on:
workflow_dispatch:
inputs:
package_registry:
description: 'Publish to'
required: true
default: 'npm'
type: choice
options:
- npm
- jsr
workspace_path:
description: 'The workspace to publish'
required: true
default: 'packages/shared/common'
type: choice
options:
- packages/shared/common
- packages/shared/sdk-client
- packages/shared/sdk-server
- packages/shared/sdk-server-edge
- packages/shared/akamai-edgeworker-sdk
- packages/sdk/cloudflare
- packages/sdk/react-native
- packages/sdk/server-node
- packages/sdk/vercel
- packages/sdk/akamai-base
- packages/sdk/akamai-edgekv
- packages/store/node-server-sdk-redis
- packages/store/node-server-sdk-dynamodb
- packages/telemetry/node-server-sdk-otel
- packages/telemetry/browser-telemetry
prerelease:
description: 'Is this a prerelease. If so, then the latest tag will not be updated in npm.'
type: boolean
required: true
dry_run:
description: 'Is this a dry run. If so no package will be published.'
type: boolean
required: true
jobs:
build-publish:
runs-on: ubuntu-latest
# Needed to get tokens during publishing.
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20.x
registry-url: 'https://registry.npmjs.org'
- name: 'Setup Redis'
if: ${{ inputs.workspace_path == 'packages/store/node-server-sdk-redis' }}
run: |
sudo apt-get update
sudo apt-get install redis-server
sudo service redis-server start
- name: 'Setup DynamoDB'
if: ${{ inputs.workspace_path == 'packages/store/node-server-sdk-dynamodb' }}
run: |
sudo docker run -d -p 8000:8000 amazon/dynamodb-local
- name: 'Set WORKSPACE_NAME variable'
run: |
WORKSPACE_NAME=$(./scripts/package-name.sh ${{ inputs.workspace_path }})
echo "WORKSPACE_NAME=$WORKSPACE_NAME" >> $GITHUB_ENV
- id: build-and-test
# Build using the same steps from CI.
name: Build and Test
uses: ./actions/ci
with:
workspace_name: ${{ env.WORKSPACE_NAME }}
workspace_path: ${{ inputs.workspace_path }}
- uses: ./actions/release-secrets
name: 'Get NPM token'
with:
aws_assume_role: ${{ vars.AWS_ROLE_ARN }}
ssm_parameter_pairs: '/production/common/releasing/npm/token = NODE_AUTH_TOKEN'
- name: Setup .yarnrc.yml
if: ${{ inputs.package_registry == 'npm' }}
shell: bash
run: |
yarn config set npmScopes.launchdarkly.npmRegistryServer "https://registry.npmjs.org"
yarn config set npmScopes.launchdarkly.npmAlwaysAuth true
yarn config set npmScopes.launchdarkly.npmAuthToken $NODE_AUTH_TOKEN
- id: publish-jsr
name: Publish Package to jsr
if: ${{ inputs.package_registry == 'jsr' }}
uses: ./actions/publish-jsr
with:
workspace_name: ${{ env.WORKSPACE_NAME }}
workspace_path: ${{ inputs.workspace_path }}
dry_run: ${{ inputs.dry_run }}
- id: publish-npm
name: Publish Package to npm
if: ${{ inputs.package_registry == 'npm' }}
uses: ./actions/publish
with:
workspace_name: ${{ env.WORKSPACE_NAME }}
workspace_path: ${{ inputs.workspace_path }}
prerelease: ${{ inputs.prerelease }}
dry_run: ${{ inputs.dry_run }}