File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1212 - ' .github/workflows/ci-double.yml'
1313 - ' .github/workflows/build.yml'
1414 - ' .github/workflows/build*.yml'
15+ - ' .github/workflows/publish*.yml'
1516 - ' .github/actions/test-build/action.yml'
1617 - ' .github/actions/build*/*.*'
1718 - ' .github/actions/build/*.*'
5152 - ' .github/workflows/ci-double.yml'
5253 - ' .github/workflows/build.yml'
5354 - ' .github/workflows/build*.yml'
55+ - ' .github/workflows/publish*.yml'
5456 - ' .github/actions/test-build/action.yml'
5557 - ' .github/actions/build*/*.*'
5658 - ' .github/actions/build/*.*'
Original file line number Diff line number Diff line change 1212 - ' .github/workflows/ci-double.yml'
1313 - ' .github/workflows/build.yml'
1414 - ' .github/workflows/build*.yml'
15+ - ' .github/workflows/publish*.yml'
1516 - ' .github/actions/test-build/action.yml'
1617 - ' .github/actions/build*/*.*'
1718 - ' .github/actions/build/*.*'
5051 - ' .github/workflows/ci-double.yml'
5152 - ' .github/workflows/build.yml'
5253 - ' .github/workflows/build*.yml'
54+ - ' .github/workflows/publish*.yml'
5355 - ' .github/actions/test-build/action.yml'
5456 - ' .github/actions/build*/*.*'
5557 - ' .github/actions/build/*.*'
Original file line number Diff line number Diff line change 1+ name : Publish Package
2+
3+ on :
4+ workflow_dispatch :
5+
6+ permissions :
7+ id-token : write # Required for OIDC
8+ contents : read
9+ env :
10+ node : 22
11+
12+ jobs :
13+ publish :
14+ runs-on : ubuntu-latest
15+ steps :
16+ - uses : actions/checkout@v4
17+
18+ - name : Read package.json
19+ uses : actions/github-script@v7
20+ with :
21+ result-encoding : string
22+ script : |
23+ try {
24+ const fs = require('fs')
25+ const jsonString = fs.readFileSync('package.json')
26+ var json = JSON.parse(jsonString);
27+ core.exportVariable('version', json.version.toString())
28+ } catch(err) {
29+ core.error("Error while reading or parsing package.json")
30+ core.setFailed(err)
31+ }
32+
33+ - uses : actions/setup-node@v4
34+ with :
35+ node-version : ${{ env.node }}
36+ registry-url : ' https://registry.npmjs.org'
37+
38+ # Ensure npm 11.5.1 or later is installed
39+ - run : npm install -g npm@latest
40+
41+ - name : Publish package
42+ run : |
43+ echo "Publishing version ${{ env.version }}"
44+ npm pack --pack-destination package
45+ ls -R package
46+ # npm publish
47+
48+ - name : Upload artifacts
49+ if : success()
50+ uses : actions/upload-artifact@v4
51+ with :
52+ name : edge-js-${{ env.version }}
53+ path : |
54+ package/edge-js-${{ env.version }}.tgz
55+
56+ # - name : Tag version
57+ # run: |
58+ # git tag v${{ env.version }}
59+ # git push origin --tags
You can’t perform that action at this time.
0 commit comments