Skip to content

Commit 82a06e0

Browse files
committed
windows github action build
1 parent d152ff5 commit 82a06e0

5 files changed

Lines changed: 74 additions & 55 deletions

File tree

.github/workflows/build_win.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: win-embedr-build
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches: [master]
7+
pull_request:
8+
branches: [master]
9+
types: [opened, synchronize, reopened]
10+
release:
11+
types: [created]
12+
13+
jobs:
14+
build-windows:
15+
name: Windows 64-bit
16+
runs-on: windows-latest
17+
18+
env:
19+
BITS: 64
20+
R_ARCH: x64
21+
Q_ARCH: w64
22+
R_HOME: C:\R
23+
24+
steps:
25+
- name: Check out repository
26+
uses: actions/checkout@v5
27+
28+
- name: Set up R
29+
uses: r-lib/actions/setup-r@v2
30+
with:
31+
r-version: "4.4.2"
32+
33+
- name: Check
34+
shell: cmd
35+
run: |
36+
dir C:\R
37+
dir C:\R\bin
38+
dir C:\R\bin\x64
39+
40+
- name: Build embedr.dll
41+
shell: pwsh
42+
run: |
43+
New-Item -ItemType Directory -Force -Path w64 | Out-Null
44+
& C:\R\bin\x64\R.exe CMD SHLIB -o "w64/embedr.dll" embedr.c src/w64/q.lib -lws2_32 -liphlpapi
45+
if ($LASTEXITCODE -ne 0) { exit 1 }
46+
47+
- name: Package distribution
48+
shell: pwsh
49+
run: |
50+
$version = "${{ github.ref_name }}" -replace '[\\/:*?"<>|]', '-'
51+
52+
New-Item -ItemType Directory -Force -Path embedr | Out-Null
53+
Copy-Item "w64" -Destination ".\embedr\w64" -Recurse
54+
Copy-Item rinit.q -Destination .\embedr
55+
Copy-Item rtest.q -Destination .\embedr
56+
Copy-Item LICENSE -Destination .\embedr\LICENSE.embedr
57+
Copy-Item README.md -Destination .\embedr\README.embedr
58+
59+
7z a "embedr_win64-$version.zip" ".\embedr\*"
60+
61+
- name: Upload workflow artifact
62+
uses: actions/upload-artifact@v4
63+
with:
64+
name: embedr_win64
65+
path: embedr_win*.zip
66+
if-no-files-found: error

appveyor.yml

Lines changed: 0 additions & 46 deletions
This file was deleted.

embedr.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include <sys/socket.h>
1616
//#include <unistd.h>
1717
#else
18+
#include <winsock2.h>
1819
#include <windows.h>
1920
#include <process.h>
2021
#endif

src/rserver.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -720,17 +720,17 @@ K ropen(K x)
720720
s=Rf_initEmbeddedR(argc, argv);
721721
if (s<0) return krr("open failed");
722722
if(dumb_socketpair(spair, 1) == -1){
723-
return krr("Init failed for socketpair");
724-
}
723+
return krr("Init failed for socketpair");
724+
}
725725
sd1(-spair[0], &processR);
726726
#ifndef WIN32
727727
pthread_t t;
728-
if(pthread_create(&t, NULL, pingmain, NULL))
729-
R krr("poller_thread");
730-
pingthread= &t;
728+
if(pthread_create(&t, NULL, pingmain, NULL))
729+
R krr("poller_thread");
730+
pingthread= &t;
731731
#else
732-
if(_beginthreadex(0,0,pingmain,NULL,0,0)==-1)
733-
R krr("poller_thread");
732+
if(_beginthreadex(0,0,pingmain,NULL,0,0)==-1)
733+
R krr("poller_thread");
734734
#endif
735735
ROPEN=mode;
736736
return ki(ROPEN);

src/socketpair.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,7 @@
2626
#include <string.h>
2727

2828
#ifdef WIN32
29-
# include <winsock2.h>
3029
# include <ws2tcpip.h>
31-
# include <windows.h>
3230
# include <io.h>
3331
#else
3432
# include <sys/types.h>

0 commit comments

Comments
 (0)