-
Notifications
You must be signed in to change notification settings - Fork 0
171 lines (150 loc) · 6.67 KB
/
release.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
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
name: Build and Release
on:
push:
tags:
- 'v*'
jobs:
build-release:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-24.04
c_compiler: gcc-12
cpp_compiler: g++-12
arm_c_compiler: aarch64-linux-gnu-gcc
arm_cpp_compiler: aarch64-linux-gnu-g++
- os: ubuntu-22.04
c_compiler: gcc
cpp_compiler: g++
arm_c_compiler: aarch64-linux-gnu-gcc
arm_cpp_compiler: aarch64-linux-gnu-g++
- os: ubuntu-20.04
c_compiler: gcc
cpp_compiler: g++
arm_c_compiler: aarch64-linux-gnu-gcc
arm_cpp_compiler: aarch64-linux-gnu-g++
- os: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install cross compiler
if: ${{ Contains(matrix.os, 'ubuntu-22.04') || Contains(matrix.os, 'ubuntu-20.04')}}
run: |
sudo apt-get update
sudo apt-get install -y g++-aarch64-linux-gnu gcc-aarch64-linux-gnu
- name: Install gcc-12
if: ${{ Contains(matrix.os, 'ubuntu-24.04') }}
run: |
sudo apt-get update
sudo apt-get install -y g++-12-aarch64-linux-gnu gcc-12-aarch64-linux-gnu gcc-12 g++-12 g++-aarch64-linux-gnu gcc-aarch64-linux-gnu
- name: Setup vcpkg
uses: lukka/run-vcpkg@v11
id: runvcpkg
with:
# The vcpkg.json file, which will be part of cache key computation.
vcpkgJsonGlob: '**/src/vcpkg.json'
- name: Download cloudfuse for Windows
if: ${{ Contains(matrix.os, 'windows') }}
shell: pwsh
run: |
$download_url = Invoke-RestMethod -Uri "https://api.github.com/repos/Seagate/cloudfuse/releases/latest" | Select-Object -ExpandProperty assets | Where-Object { $_.name -like "*no_gui*" } | Where-Object { $_.name -like "*windows_amd64.exe*" } | Select-Object -ExpandProperty browser_download_url
$file_name = $download_url.Split('/')[-1]
Invoke-WebRequest -Uri $download_url -OutFile $file_name
- name: Download cloudfuse for Linux amd64 (no_gui)
if: ${{ Contains(matrix.os, 'ubuntu') }}
run: |
download_url=$(curl -s https://api.github.com/repos/Seagate/cloudfuse/releases/latest | jq -r '.assets[] | select(.name | (contains("no_gui") and contains("linux_amd64.deb"))) | .browser_download_url')
curl -LO $download_url
- name: Download cloudfuse for Linux arm64 (no_gui)
if: ${{ Contains(matrix.os, 'ubuntu') }}
run: |
download_url=$(curl -s https://api.github.com/repos/Seagate/cloudfuse/releases/latest | jq -r '.assets[] | select(.name | (contains("no_gui") and contains("linux_arm64.deb"))) | .browser_download_url')
curl -LO $download_url
- name: Run build script for Linux x64
if: ${{ Contains(matrix.os, 'ubuntu') }}
run: >
./build_plugin_x64.sh
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }}
- name: Package Artifacts Linux x64
if: ${{ Contains(matrix.os, 'ubuntu') }}
run: |
mkdir nx-lyve-cloud-plugin-${{ matrix.os }}_x64
mv ../nx-lyve-cloud-plugin-build/cloudfuse_plugin/*.so nx-lyve-cloud-plugin-${{ matrix.os }}_x64/cloudfuse_plugin.so
mv ./cloudfuse*_linux_amd64.deb nx-lyve-cloud-plugin-${{ matrix.os }}_x64/
cp ./install_plugin_linux.sh nx-lyve-cloud-plugin-${{ matrix.os }}_x64/
zip -r nx-lyve-cloud-plugin-${{ matrix.os }}_x64.zip nx-lyve-cloud-plugin-${{ matrix.os }}_x64
- name: Cleanup Build
if: ${{ Contains(matrix.os, 'ubuntu') }}
run: >
rm -r ../nx-lyve-cloud-plugin-build/
- name: Run build script for Linux arm64
if: ${{ Contains(matrix.os, 'ubuntu') }}
run: >
./build_plugin_arm64.sh
-DCMAKE_CXX_COMPILER=${{ matrix.arm_cpp_compiler }}
-DCMAKE_C_COMPILER=${{ matrix.arm_c_compiler }}
- name: Package Artifacts Linux arm64
if: ${{ Contains(matrix.os, 'ubuntu') }}
run: |
mkdir nx-lyve-cloud-plugin-${{ matrix.os }}_arm64
mv ../nx-lyve-cloud-plugin-build/cloudfuse_plugin/*.so nx-lyve-cloud-plugin-${{ matrix.os }}_arm64/cloudfuse_plugin.so
mv ./cloudfuse*_linux_arm64.deb nx-lyve-cloud-plugin-${{ matrix.os }}_arm64/
cp ./install_plugin_linux.sh nx-lyve-cloud-plugin-${{ matrix.os }}_arm64/
zip -r nx-lyve-cloud-plugin-${{ matrix.os }}_arm64.zip nx-lyve-cloud-plugin-${{ matrix.os }}_arm64
- name: Run build script for Windows
shell: powershell
if: ${{ Contains(matrix.os, 'windows') }}
run: >
.\build_plugin.bat
--no-tests
- name: Package Artifacts Windows
shell: powershell
if: ${{ Contains(matrix.os, 'windows') }}
run: |
mkdir nx-lyve-cloud-plugin-windows
mv ..\nx-lyve-cloud-plugin-build\cloudfuse_plugin\Release\cloudfuse_plugin.dll nx-lyve-cloud-plugin-windows\cloudfuse_plugin.dll
mv .\install_plugin_windows.bat nx-lyve-cloud-plugin-windows\
mv .\cloudfuse*_windows_amd64.exe nx-lyve-cloud-plugin-windows\
Compress-Archive nx-lyve-cloud-plugin-windows nx-lyve-cloud-plugin-windows.zip
- name: Archive production artifacts from Ubuntu x64
if: ${{ Contains(matrix.os, 'ubuntu') }}
uses: actions/upload-artifact@v4
with:
name: nx-lyve-cloud-plugin-${{ matrix.os }}_x64
path: nx-lyve-cloud-plugin-${{ matrix.os }}_x64.zip
if-no-files-found: error
- name: Archive production artifacts from Ubuntu arm64
if: ${{ Contains(matrix.os, 'ubuntu') }}
uses: actions/upload-artifact@v4
with:
name: nx-lyve-cloud-plugin-${{ matrix.os }}_arm64
path: nx-lyve-cloud-plugin-${{ matrix.os }}_arm64.zip
if-no-files-found: error
- name: Archive production artifacts from Windows
if: ${{ Contains(matrix.os, 'windows') }}
uses: actions/upload-artifact@v4
with:
name: nx-lyve-cloud-plugin-windows
path: nx-lyve-cloud-plugin-windows.zip
if-no-files-found: error
release:
needs: build-release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Download all workflow run artifacts
uses: actions/download-artifact@v4
- name: Release
uses: softprops/action-gh-release@v2
with:
files: |
nx-lyve-cloud-plugin-ubuntu-24.04_x64/*
nx-lyve-cloud-plugin-ubuntu-22.04_x64/*
nx-lyve-cloud-plugin-ubuntu-20.04_x64/*
nx-lyve-cloud-plugin-ubuntu-24.04_arm64/*
nx-lyve-cloud-plugin-ubuntu-22.04_arm64/*
nx-lyve-cloud-plugin-ubuntu-20.04_arm64/*
nx-lyve-cloud-plugin-windows/*