-
Notifications
You must be signed in to change notification settings - Fork 876
121 lines (106 loc) · 3.36 KB
/
publish_candidates.yml
File metadata and controls
121 lines (106 loc) · 3.36 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
name: Publish Candidates
on:
workflow_call:
inputs:
js-sdk:
required: false
type: boolean
default: false
python-sdk:
required: false
type: boolean
default: false
cli:
required: false
type: boolean
default: false
tag:
required: true
type: string
preid:
required: true
type: string
permissions:
contents: read
id-token: write
jobs:
publish:
name: Publish Release Candidates
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Parse .tool-versions
uses: wistia/parse-tool-versions@v2.1.1
with:
filename: '.tool-versions'
uppercase: 'true'
prefix: 'tool_version_'
- uses: pnpm/action-setup@v4
if: ${{ inputs.js-sdk || inputs.cli }}
with:
version: '${{ env.TOOL_VERSION_PNPM }}'
- name: Setup Node.js
uses: actions/setup-node@v6
if: ${{ inputs.js-sdk || inputs.cli }}
with:
node-version: '${{ env.TOOL_VERSION_NODEJS }}'
registry-url: https://registry.npmjs.org
cache: pnpm
- name: Configure pnpm
if: ${{ inputs.js-sdk || inputs.cli }}
run: |
pnpm config set auto-install-peers true
pnpm config set exclude-links-from-lockfile true
- name: Update npm
if: ${{ inputs.js-sdk || inputs.cli }}
run: |
npm install -g npm@^11.6
npm --version
- name: Set up Python
uses: actions/setup-python@v4
if: ${{ inputs.python-sdk }}
with:
python-version: '${{ env.TOOL_VERSION_PYTHON }}'
- name: Install and configure Poetry
uses: snok/install-poetry@v1
if: ${{ inputs.python-sdk }}
with:
version: '${{ env.TOOL_VERSION_POETRY }}'
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- name: Publish Python RC
if: ${{ inputs.python-sdk }}
working-directory: packages/python-sdk
run: |
BASE_VERSION=$(poetry version -s)
poetry version "${BASE_VERSION}rc${{ github.run_number }}"
poetry build
poetry config pypi-token.pypi ${PYPI_TOKEN} && poetry publish --skip-existing
env:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
- name: Install JS dependencies
if: ${{ inputs.js-sdk || inputs.cli }}
run: pnpm install --frozen-lockfile
- name: Publish JS RC
if: ${{ inputs.js-sdk }}
working-directory: packages/js-sdk
env:
RC_PREID: ${{ inputs.preid }}
RC_TAG: ${{ inputs.tag }}
run: |
npm version prerelease --preid="${RC_PREID}.${{ github.run_number }}" --no-git-tag-version
npm publish --tag "$RC_TAG" --provenance
- name: Reinstall dependencies
if: ${{ inputs.js-sdk || inputs.cli }}
run: pnpm install --frozen-lockfile
- name: Publish CLI RC
if: ${{ inputs.cli }}
working-directory: packages/cli
env:
RC_PREID: ${{ inputs.preid }}
RC_TAG: ${{ inputs.tag }}
run: |
npm version prerelease --preid="${RC_PREID}.${{ github.run_number }}" --no-git-tag-version
npm publish --tag "$RC_TAG" --provenance