Skip to content

Commit b41eb52

Browse files
authored
Publish through GitHub actions (#380)
* Windows paths with spaces in Makefile * publish workflow (ported from vscode-ui-components) * publish config * cancel in progress actions on new push Signed-off-by: Jens Reinecke <jens.reinecke@arm.com> --------- Signed-off-by: Jens Reinecke <jens.reinecke@arm.com>
1 parent 135f862 commit b41eb52

File tree

5 files changed

+37
-3
lines changed

5 files changed

+37
-3
lines changed

.github/workflows/build-pr.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
# see report.yml for more details
44
name: build-pr
55
on: [pull_request]
6+
concurrency:
7+
group: ${{ github.workflow }}-${{ github.ref }}
8+
cancel-in-progress: true
69
jobs:
710
Build-on-Ubuntu:
811
name: Build & Test on Ubuntu

.github/workflows/build-push.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
# results back
55
name: build-push
66
on: [push]
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.ref }}
9+
cancel-in-progress: true
710
jobs:
811
Build-on-Ubuntu:
912
name: Build & Test on Ubuntu
@@ -84,3 +87,22 @@ jobs:
8487
fail_on_failure: true
8588
require_tests: true
8689
check_name: Test Results on Windows
90+
# Publish to NPM if tag is pushed and build and test succeeds
91+
# on both Linux and Windows. Note this is not restricted to 'main'.
92+
Publish-to-NPM:
93+
name: Publish Package to NPM
94+
runs-on: ubuntu-latest
95+
needs: [Build-on-Ubuntu, Build-on-Windows]
96+
if: startsWith(github.ref, 'refs/tags/')
97+
steps:
98+
- uses: actions/checkout@v4
99+
- uses: actions/setup-node@v4
100+
with:
101+
node-version: '20'
102+
registry-url: 'https://registry.npmjs.org'
103+
- name: Build
104+
run: yarn
105+
- name: Publish
106+
run: yarn publish
107+
env:
108+
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}

.github/workflows/report.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ on:
88
workflow_run:
99
workflows: [build-pr]
1010
types: [completed]
11+
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: true
15+
1116
permissions:
1217
checks: write
1318

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,5 +117,9 @@
117117
"src/native/*.ts",
118118
"install.js",
119119
"binding.gyp"
120-
]
120+
],
121+
"publishConfig": {
122+
"access": "public",
123+
"registry": "https://registry.npmjs.org"
124+
}
121125
}

src/integration-tests/test-programs/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ count\ space.o: count\ space.c
3333
# debug-prefix-map used like this is to put an "incorrect"
3434
# DW_AT_comp_dir in the debug info
3535
cwd.o: cwd.c
36-
$(CC) -fdebug-prefix-map=$(CURDIR)=. -c $< -g3 -O0
36+
$(CC) -fdebug-prefix-map="$(CURDIR)"=. -c $< -g3 -O0
3737

3838
cwd.exe: cwd.o
39-
$(LINK) -fdebug-prefix-map=$(CURDIR)=.
39+
$(LINK) -fdebug-prefix-map="$(CURDIR)"=.
4040
mkdir -p Debug
4141
cp cwd.exe Debug
4242
mkdir -p EmptyDir

0 commit comments

Comments
 (0)