Skip to content

Commit 5a7c704

Browse files
committed
feat: set-version at publish task
1 parent b1ff78c commit 5a7c704

File tree

70 files changed

+170
-46
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+170
-46
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Download Cache
2+
description: Download and restore the Cache artifact (check ../upload-cache)
3+
inputs:
4+
artifactName:
5+
description: Name of the artifact on which the cache is published
6+
default: cache-dir
7+
required: false
8+
9+
runs:
10+
using: 'composite'
11+
steps:
12+
- uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
13+
with:
14+
name: ${{ inputs.artifactName }}
15+
path: '.'
16+
- run: unzip -q -n ${{ inputs.artifactName }}.zip
17+
shell: bash
18+
- run: rm -f ${{ inputs.artifactName }}.zip
19+
shell: bash
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Upload Cache
2+
description: Upload a Cache artifact
3+
inputs:
4+
artifactName:
5+
description: Name of the artifact on which the cache is published
6+
default: cache-dir
7+
required: false
8+
9+
runs:
10+
using: 'composite'
11+
steps:
12+
- run: zip -q -r ${{ inputs.artifactName }}.zip . -i ".cache/*" -x "*/node_modules/*"
13+
shell: bash
14+
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
15+
with:
16+
name: ${{ inputs.artifactName }}
17+
path: ${{ inputs.artifactName }}.zip
18+
- run: rm -f ${{ inputs.artifactName }}.zip
19+
shell: bash

.github/workflows/it-tests.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ jobs:
4747
artifactName: ${{ inputs.ref && format('dist-{0}', inputs.ref) || 'dist' }}
4848
- uses: ./tools/github-actions/setup
4949
timeout-minutes: 30
50+
- if: ${{env.NX_SKIP_REMOTE_CACHE == 'true'}}
51+
uses: ./.github/actions/download-cache
52+
continue-on-error: true
5053
- name: Setup verdaccio once for all tests
5154
id: setup-verdaccio
5255
run: |

.github/workflows/main.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ env:
2121
NX_TASK_TARGET_CONFIGURATION: ci
2222
YARN_ENABLE_HARDENED_MODE: 0
2323
NODE_COMPILE_CACHE: ~/.cache/node-compile-cache
24-
NX_SKIP_NX_CACHE: ${{ vars.NX_SKIP_NX_CACHE == 'true' || github.event_name == 'push' && startsWith(github.ref, 'refs/heads/release') && !endsWith(github.ref, '-next') }}
25-
NX_SKIP_REMOTE_CACHE: ${{ vars.NX_SKIP_REMOTE_CACHE == 'true' || (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'skipRemoteCache')) }}
24+
NX_SKIP_NX_CACHE: ${{ vars.NX_SKIP_NX_CACHE == 'true' }}
25+
NX_SKIP_REMOTE_CACHE: ${{ vars.NX_SKIP_REMOTE_CACHE == 'true' || (github.event_name == 'push' && startsWith(github.ref, 'refs/heads/release')) || (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'skipRemoteCache')) }}
2626
jobs:
2727
setupVars:
2828
runs-on: ubuntu-latest
@@ -77,6 +77,9 @@ jobs:
7777
${{ runner.os }}-node-compile
7878
- run: yarn build
7979
- uses: ./tools/github-actions/upload-build-output
80+
- if: ${{env.NX_SKIP_REMOTE_CACHE == 'true'}}
81+
uses: ./.github/actions/upload-cache
82+
continue-on-error: true
8083

8184
version:
8285
permissions:

.github/workflows/publish.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,20 +72,22 @@ jobs:
7272
fetch-depth: 2
7373
ref: ${{ inputs.gitRef }}
7474
- uses: ./tools/github-actions/download-build-output
75+
- if: ${{env.NX_SKIP_REMOTE_CACHE == 'true'}}
76+
uses: ./.github/actions/download-cache
77+
continue-on-error: true
7578
- uses: ./tools/github-actions/setup
7679
timeout-minutes: 30
7780
with:
7881
#TODO Remove when migrate to Node 24
7982
npm-version: '11.5'
80-
- run: yarn set:version ${{ inputs.version }}
8183
- name: Get tag name
8284
id: get-npm-tag
8385
uses: ./tools/github-actions/get-npm-tag
8486
with:
8587
is-prerelease: ${{ inputs.prerelease }}
8688
version: ${{ inputs.version }}
8789
- name: Publish
88-
run: yarn run publish --tag=${{ inputs.isPullRequest && 'pr' || steps.get-npm-tag.outputs.tag }} ${{ inputs.isPullRequest && '--userconfig=./.npmrc.pr' || ''}}
90+
run: yarn run publish --set-version=${{ inputs.version }} --tag=${{ inputs.isPullRequest && 'pr' || steps.get-npm-tag.outputs.tag }} ${{ inputs.isPullRequest && '--userconfig=./.npmrc.pr' || ''}}
8991
env:
9092
GITHUB_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
9193
AZURE_AUTH_TOKEN: ${{ secrets.AZURE_AUTH_TOKEN }}
@@ -103,6 +105,9 @@ jobs:
103105
with:
104106
fetch-depth: 2
105107
- uses: ./tools/github-actions/download-build-output
108+
- if: ${{env.NX_SKIP_REMOTE_CACHE == 'true'}}
109+
uses: ./.github/actions/download-cache
110+
continue-on-error: true
106111
- uses: ./tools/github-actions/setup
107112
timeout-minutes: 30
108113
- run: yarn set:version ${{ inputs.version }}
@@ -137,12 +142,14 @@ jobs:
137142
with:
138143
fetch-depth: 2
139144
- uses: ./tools/github-actions/download-build-output
145+
- if: ${{env.NX_SKIP_REMOTE_CACHE == 'true'}}
146+
uses: ./.github/actions/download-cache
147+
continue-on-error: true
140148
- uses: ./tools/github-actions/setup
141149
timeout-minutes: 30
142-
- run: yarn set:version ${{ inputs.version }}
143150
- name: Publish Extensions
144151
if: '!inputs.prerelease'
145-
run: yarn run publish:extensions
152+
run: yarn run publish:extensions --set-version=${{ inputs.version }}
146153
env:
147154
NX_BASE: HEAD~1
148155
VSCE_PAT: ${{ secrets.AZURE_VSC_EXT_TOKEN }}

.yarn/sdks/eslint/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "eslint",
3-
"version": "9.38.0-sdk",
3+
"version": "9.39.1-sdk",
44
"main": "./lib/api.js",
55
"type": "commonjs",
66
"bin": {

apps/chrome-devtools/project.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,8 @@
161161
"{projectRoot}/src/options.html"
162162
]
163163
},
164+
"set-version": {},
165+
"prepare-publish": {},
164166
"publish-extension": {
165167
"executor": "nx:run-script",
166168
"options": {

apps/vscode-extension/project.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
},
2828
"lint": {},
2929
"test": {},
30+
"set-version": {},
3031
"prepare-publish": {
3132
"options": {
3233
"commands": [

codecov.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,19 @@ coverage:
77
patch:
88
default:
99
target: auto
10-
threshold: 5%
10+
threshold: 0.3%
1111
informational: true
1212

1313
default_rules:
1414
flag_coverage_not_uploaded_behavior: exclude
1515
target: auto
16-
threshold: 5%
16+
threshold: 0.3%
1717
informational: true
1818

1919
project:
2020
default:
2121
target: auto
22-
threshold: 5%
22+
threshold: 0.3%
2323
base: auto
2424
if_ci_failed: error
2525
informational: true

nx.json

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,35 @@
273273
"outputs": [],
274274
"inputs": [
275275
"{projectRoot}/dist"
276+
],
277+
"dependsOn": [
278+
"prepare-publish",
279+
{
280+
"projects": "self",
281+
"target": "set-version",
282+
"params": "forward"
283+
}
284+
]
285+
},
286+
"set-version": {
287+
"cache": false,
288+
"executor": "nx:run-commands",
289+
"options": {
290+
"cwd": "{workspaceRoot}",
291+
"command": "O3R_SET_PUBLIC='{args.set-public}' yarn o3r-set-version {args.set-version} --placeholder=0.0.0-placeholder --include='{projectRoot}/dist/package.json' --include='{projectRoot}/dist/manifest.json'",
292+
"forwardAllArgs": false
293+
},
294+
"inputs": [
295+
"{projectRoot}/dist/package.json",
296+
"{projectRoot}/dist/manifest.json"
297+
],
298+
"outputs": [
299+
"{projectRoot}/dist/package.json",
300+
"{projectRoot}/dist/manifest.json"
301+
],
302+
"dependsOn": [
303+
"build",
304+
"prepare-publish"
276305
]
277306
},
278307
"prepare-publish": {
@@ -302,7 +331,15 @@
302331
]
303332
},
304333
"publish-extension": {
305-
"cache": false
334+
"cache": false,
335+
"dependsOn": [
336+
"prepare-publish",
337+
{
338+
"projects": "self",
339+
"target": "set-version",
340+
"params": "forward"
341+
}
342+
]
306343
},
307344
"build": {
308345
"dependsOn": [
@@ -650,7 +687,7 @@
650687
"libsDir": "packages",
651688
"appsDir": "apps"
652689
},
653-
"useDaemonProcess": false,
690+
"useDaemonProcess": true,
654691
"cacheDirectory": ".cache/nx",
655692
"nxCloudId": "63e6951e043da20dd8321aec"
656693
}

0 commit comments

Comments
 (0)