This repository was archived by the owner on Aug 6, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +44
-11
lines changed Expand file tree Collapse file tree 4 files changed +44
-11
lines changed Original file line number Diff line number Diff line change 40
40
uses : actions/setup-node@master
41
41
with :
42
42
node-version : ${{ matrix.node }}
43
- env :
44
- NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
45
43
46
44
- name : Update to npm 7
47
45
run : npm i -g npm@7 --registry=https://registry.npmjs.org
@@ -76,11 +74,20 @@ jobs:
76
74
NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
77
75
GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
78
76
77
+ - name : Set flag as to whether we released
78
+ id : did-release
79
+ run : echo "::set-output name=released::$(node ./playwright-test/check-package.js)"
80
+
81
+ - name : Setup node for second publish
82
+ uses : actions/setup-node@master
83
+ if : ${{ matrix.node == '14' && matrix.playwright == 'latest' && steps.did-release.outputs.released == 'true' }}
84
+ with :
85
+ node-version : ${{ matrix.node }}
86
+ env :
87
+ NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
88
+
79
89
- name : Upload Coverage / Release / Playwright Test
90
+ if : ${{ matrix.node == '14' && matrix.playwright == 'latest' && steps.did-release.outputs.released == 'true' }}
80
91
run : |
81
92
npm run prepare:playwright-test
82
93
npm publish
83
- if : ${{ matrix.node == '14' && matrix.playwright == 'latest' }}
84
- env :
85
- NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
86
- GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change
1
+ #!/usr/bin/env node
2
+ /* eslint-disable no-console */
3
+
4
+ const fs = require ( 'fs/promises' )
5
+ const path = require ( 'path' )
6
+ const process = require ( 'process' )
7
+
8
+ const PACKAGE = path . join ( __dirname , '..' , 'package.json' )
9
+
10
+ const run = async ( ) => {
11
+ const package = JSON . parse ( await fs . readFile ( PACKAGE , { encoding : 'utf-8' } ) )
12
+
13
+ process . stdout . write ( JSON . stringify ( package . version !== '0.0.0-semantically-released' ) )
14
+ }
15
+
16
+ run ( )
17
+ . then ( ( ) => process . exit ( 0 ) )
18
+ . catch ( error => {
19
+ console . error ( error )
20
+ process . exit ( 1 )
21
+ } )
Original file line number Diff line number Diff line change
1
+ const fs = require ( 'fs/promises' )
2
+ const path = require ( 'path' )
3
+
4
+ const PACKAGE = path . join ( __dirname , '..' , 'package.json' )
5
+
6
+ const getPackage = async ( ) => JSON . parse ( await fs . readFile ( PACKAGE , { encoding : 'utf-8' } ) )
7
+
8
+ module . exports = { PACKAGE , getPackage}
Original file line number Diff line number Diff line change 2
2
/* eslint-disable no-console */
3
3
4
4
const fs = require ( 'fs/promises' )
5
- const path = require ( 'path' )
6
5
7
- const PACKAGE = path . join ( __dirname , '..' , ' package.json ')
6
+ const { PACKAGE , getPackage } = require ( './ package')
8
7
9
8
const run = async ( ) => {
10
- const package = JSON . parse ( await fs . readFile ( PACKAGE , { encoding : 'utf-8' } ) )
11
-
12
9
const modifiedPackage = {
13
- ...package ,
10
+ ...getPackage ( ) ,
14
11
name : '@playwright-testing-library/test' ,
15
12
}
16
13
You can’t perform that action at this time.
0 commit comments