-
Notifications
You must be signed in to change notification settings - Fork 2
183 lines (162 loc) · 5.55 KB
/
push.yaml
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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
name: Push Build
on: push
jobs:
build_and_test:
name: ${{matrix.config.name}}
runs-on: ${{matrix.config.os}}
strategy:
matrix:
config:
- {
name: "Linux Build & Test",
os: ubuntu-latest
}
- {
name: "Microsoft Windows Build & Test",
os: windows-latest
}
- {
name: "MacOs Build & Test",
os: macos-latest
}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install Cargo make
run: |
cargo install cargo-make
- name: Download files Linux
if: matrix.config.os == 'ubuntu-latest'
run: |
wget "https://github.com/neovim/neovim/releases/latest/download/nvim-linux64.tar.gz"
tar -xzf nvim-linux64.tar.gz
wget "https://ziglang.org/download/0.11.0/zig-linux-x86_64-0.11.0.tar.xz"
tar -xf zig-linux-x86_64-0.11.0.tar.xz
- name: Download files MacOs
if: matrix.config.os == 'macos-latest'
run: |
wget "https://github.com/neovim/neovim/releases/download/v0.9.1/nvim-macos.tar.gz"
tar -xzf nvim-macos.tar.gz
wget "https://ziglang.org/download/0.11.0/zig-macos-x86_64-0.11.0.tar.xz"
tar -xf zig-macos-x86_64-0.11.0.tar.xz
- name: Download files Windows
if: matrix.config.os == 'windows-latest'
run: |
Invoke-WebRequest "https://github.com/neovim/neovim/releases/download/stable/nvim-win64.zip" -OutFile .\nvim-win64.zip
Expand-Archive nvim-win64.zip
Invoke-WebRequest "https://ziglang.org/download/0.11.0/zig-windows-x86_64-0.11.0.zip" -OutFile .\zig-windows-x86_64-0.11.0.zip
Expand-Archive zig-windows-x86_64-0.11.0.zip
- name: Test For Linux
if: matrix.config.os == 'ubuntu-latest'
run: |
export PATH=$PWD/nvim-linux64/bin/:$PATH
export PATH=$PWD/zig-linux-x86_64-0.11.0/:$PATH
cargo make zig_test
nvim -l ./default_cfg/testing_linux.lua
rm ./lua/wasm_nvim.so
cargo make test
- name: Test For MacOs
if: matrix.config.os == 'macos-latest'
run: |
export PATH=$PWD/nvim-macos/bin/:$PATH
export PATH=$PWD/zig-macos-x86_64-0.11.0/:$PATH
cargo make zig_test
nvim -l ./default_cfg/testing_macos.lua
rm ./lua/wasm_nvim.so
cargo make test
- name: Test For Windows
if: matrix.config.os == 'windows-latest'
shell: pwsh
run: |
$env:CD = Get-Location
$env:PATH=$env:CD+'/nvim-win64/bin/;'+$env:PATH
$env:PATH=$env:CD+'/zig-windows-x86_64-0.11.0/zig-windows-x86_64-0.11.0/;'+$env:PATH
cargo make ci_zig_test
./nvim-win64/nvim-win64/bin/nvim -l ./default_cfg/testing_macos.lua
cargo make ci_test
- name: Zip file Unix
if: matrix.config.os != 'windows-latest'
run: |
cd ./lua
zip -r ./wasm_nvim_${{matrix.config.os}}.zip ./wasm_nvim.so
cp ./wasm_nvim_${{matrix.config.os}}.zip ../
- name: Zip file Windows
if: matrix.config.os == 'windows-latest'
run: |
cd ./lua
tar -cf ./wasm_nvim_${{matrix.config.os}}.zip ./wasm_nvim.dll
copy wasm_nvim_${{matrix.config.os}}.zip ..\
- uses: "actions/upload-artifact@v2"
id: upload_artifact
with:
path: ./wasm_nvim_${{matrix.config.os}}.zip
name: wasm_nvim_${{matrix.config.os}}.zip
release:
if: contains(github.ref, 'tags/v')
needs: build_and_test
runs-on: ubuntu-latest
steps:
- name: Create Release
id: create_release
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
- name: Store Release url
run: |
echo "${{ steps.create_release.outputs.upload_url }}" > ./upload_url
- uses: actions/upload-artifact@v1
with:
path: ./upload_url
name: upload_url
publish:
needs: release
if: contains(github.ref, 'tags/v')
name: ${{ matrix.config.name }}
runs-on: ubuntu-latest
strategy:
matrix:
config:
- {
name: "Linux Release",
os: ubuntu-latest
}
- {
name: "Microsoft Windows Release",
os: windows-latest
}
- {
name: "MacOs Release",
os: macos-latest
}
steps:
- name: Download artifact
uses: actions/download-artifact@v1
with:
name: wasm_nvim_${{matrix.config.os}}.zip
path: ./
- name: Download URL
uses: actions/download-artifact@v1
with:
name: upload_url
path: ./
- name: Set Upload URL
id: set_upload_url
run: |
upload_url=`cat ./upload_url`
echo ::set-output name=upload_url::$upload_url
- name: Upload to Release
id: upload_to_release
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.set_upload_url.outputs.upload_url }}
asset_path: ./wasm_nvim_${{matrix.config.os}}.zip
asset_name: wasm_nvim_${{matrix.config.os}}.zip
asset_content_type: application/zip