Skip to content

Commit b534a3e

Browse files
authored
Merge pull request Azure#405 from AllyW/adjust-release
adjust build process
2 parents f8b192f + 84951c6 commit b534a3e

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

.github/workflows/python-publish.yml

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,13 @@ jobs:
6666

6767
steps:
6868
- uses: actions/checkout@v3
69+
with:
70+
submodules: 'recursive'
6971

7072
- name: Setup Node.js
7173
uses: actions/setup-node@v3
7274
with:
73-
node-version: '18.x'
75+
node-version: '20.x'
7476

7577
- name: Setup Python
7678
uses: actions/setup-python@v3
@@ -96,8 +98,10 @@ jobs:
9698
with:
9799
path: |
98100
.venv
101+
node_modules
99102
src/web/node_modules
100-
key: ${{ env.CACHE_PREFIX }}-${{ env.WEEK_NUMBER }}-${{ runner.os }}-${{ env.RUNNER_ARCH }}-${{ env.PYTHON_VERSION }}-${{ hashFiles('requirements.txt') }}-${{ env.NODE_VERSION }}-${{ hashFiles('src/web/package-lock.json') }}
103+
src/typespec-aaz/node_modules
104+
key: ${{ env.CACHE_PREFIX }}-${{ env.WEEK_NUMBER }}-${{ runner.os }}-${{ env.RUNNER_ARCH }}-${{ env.PYTHON_VERSION }}-${{ hashFiles('requirements.txt') }}-${{ env.NODE_VERSION }}-${{ hashFiles('pnpm-lock.yaml') }}
101105
restore-keys: |
102106
${{ env.CACHE_PREFIX }}-${{ env.WEEK_NUMBER }}-${{ runner.os }}-${{ env.RUNNER_ARCH }}-${{ env.PYTHON_VERSION }}-${{ env.NODE_VERSION }}
103107
@@ -107,8 +111,8 @@ jobs:
107111
test -d .venv || virtualenv -p $(which python) --copies --reset-app-data .venv
108112
. .venv/bin/activate
109113
pip install -e .[dev]
110-
cd src/web
111-
npm install
114+
npm install -g pnpm
115+
pnpm install
112116
113117
- name: Install editable (cache hit)
114118
if: steps.virtualenv-cache.outputs.cache-hit == 'true'
@@ -124,11 +128,14 @@ jobs:
124128
pip freeze
125129
which node
126130
node --version
131+
npm --version
132+
pnpm --version
127133
128134
- name: Build Web
129135
run: |
130-
cd src/web
131-
npm run build
136+
pnpm build:typespec
137+
pnpm build:web
138+
pnpm bundle
132139
env:
133140
CI: false
134141

@@ -139,7 +146,7 @@ jobs:
139146
140147
- name: Upload package distribution files
141148
if: matrix.task.name == 'Build'
142-
uses: actions/upload-artifact@v2
149+
uses: actions/upload-artifact@v4
143150
with:
144151
name: package
145152
path: dist
@@ -174,7 +181,7 @@ jobs:
174181
echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
175182
176183
- name: Download package distribution files
177-
uses: actions/download-artifact@v2
184+
uses: actions/download-artifact@v4
178185
with:
179186
name: package
180187
path: dist

0 commit comments

Comments
 (0)