forked from facebook/hermes
-
Notifications
You must be signed in to change notification settings - Fork 0
134 lines (118 loc) · 3.79 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
name: Compile Hermesc Package
on:
pull_request:
push:
workflow_dispatch:
inputs:
release:
type: boolean
description: Publish release to NPM
default: false
version:
type: string
description: Package version
required: false
jobs:
build-windows:
runs-on: "windows-2019"
steps:
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
variant: sccache
key: windows
- uses: actions/checkout@v3
- name: Compile Hermesc for Windows
run: |
choco install ninja
cmake -S . -B build -G 'Visual Studio 16 2019' -DCMAKE_BUILD_TYPE=Release
cmake --build ./build --config Release --target hermesc
Copy-Item -Path "c:\windows\system32\msvcp140.dll" -Destination ".\build\bin\Release"
Copy-Item -Path "c:\windows\system32\vcruntime140.dll" -Destination ".\build\bin\Release"
Copy-Item -Path "c:\windows\system32\vcruntime140_1.dll" -Destination ".\build\bin\Release"
- uses: actions/upload-artifact@v3
name: Upload Windows Binaries
with:
name: hermesc-windows
path: |
build/bin/Release/hermesc.exe
build/bin/Release/vcruntime140_1.dll
build/bin/Release/vcruntime140.dll
build/bin/Release/msvcp140.dll
build-linux:
runs-on: "ubuntu-latest"
steps:
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
key: linux
- uses: actions/checkout@v3
- name: Compile Hermesc for Linux
run: |
sudo apt update
sudo apt install cmake git ninja-build libicu-dev python2 zip libreadline-dev
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release
cmake --build ./build --config Release --target hermesc
- uses: actions/upload-artifact@v3
name: Upload Linux Binaries
with:
name: hermesc-linux
path: build/bin/hermesc
build-mac:
runs-on: "macos-latest"
steps:
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
key: macos
- uses: actions/checkout@v3
- name: Compile Hermesc for MacOS
run: |
brew install cmake git ninja
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release
cmake --build ./build --config Release --target hermesc
- uses: actions/upload-artifact@v3
name: Upload MacOS Binaries
with:
name: hermesc-mac
path: build/bin/hermesc
package:
runs-on: "ubuntu-latest"
needs: [build-windows, build-linux, build-mac]
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: hermesc-linux
path: ./npm/hermesc/linux
- uses: actions/download-artifact@v3
with:
name: hermesc-mac
path: ./npm/hermesc/darwin
- uses: actions/download-artifact@v3
with:
name: hermesc-windows
path: ./npm/hermesc/win32
- uses: actions/setup-node@v3
with:
node-version: 18
registry-url: 'https://registry.npmjs.org'
- name: Make NPM Tarball
run: |
cd npm/hermesc
chmod +rx ./**/hermesc
npm pkg set version=${{ inputs.version || github.ref_name }}
npm pack
- uses: actions/upload-artifact@v3
name: Upload Hermesc Tarball
with:
name: hermesc-tarball
path: ./npm/hermesc/*.tgz
- name: NPM Publish
if: ${{ inputs.release == true }}
run: |
cd npm/hermesc
npm pkg set version=${{ inputs.version || github.ref_name }}
npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}