Improve release process #23
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Release | |
on: | |
push: | |
branches: [ "fix-windows" ] | |
tags: | |
- 'v*' | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
include: | |
- os: ubuntu-22.04 | |
c_compiler: gcc | |
cpp_compiler: g++ | |
- os: ubuntu-20.04 | |
c_compiler: gcc | |
cpp_compiler: g++ | |
- os: windows-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Run build script for Linux | |
if: ${{ !(matrix.os == 'windows-latest') }} | |
run: > | |
./build_samples.sh | |
--no-tests | |
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} | |
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }} | |
- name: Setup vcpkg | |
uses: lukka/run-vcpkg@v11 | |
if: ${{ Contains(matrix.os, 'windows') }} | |
id: runvcpkg | |
with: | |
# The vcpkg.json file, which will be part of cache key computation. | |
vcpkgJsonGlob: '**/samples/cloudfuse_plugin/vcpkg.json' | |
- name: Run build script for Windows | |
shell: powershell | |
if: ${{ Contains(matrix.os, 'windows') }} | |
run: > | |
.\build_samples.bat | |
--no-tests | |
--debug | |
- name: Package Artifacts Linux | |
if: ${{ Contains(matrix.os, 'ubuntu') }} | |
run: | | |
mv ../nx-lyve-cloud-plugin-build/cloudfuse_plugin/*.so cloudfuse_plugin.so | |
- name: Package Artifacts Windows | |
shell: powershell | |
if: ${{ Contains(matrix.os, 'windows') }} | |
run: | | |
mv ..\nx-lyve-cloud-plugin-build\cloudfuse_plugin\Debug\cloudfuse_plugin.dll cloudfuse_plugin.dll | |
- name: Archive production artifacts from Ubuntu | |
if: ${{ Contains(matrix.os, 'ubuntu') }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: build-${{ matrix.os }} | |
path: | | |
cloudfuse_plugin.so | |
setup_fuse_allow_other.sh | |
if-no-files-found: error | |
- name: Archive production artifacts from Windows | |
if: ${{ Contains(matrix.os, 'windows') }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: build-${{ matrix.os }} | |
path: cloudfuse_plugin.dll | |
if-no-files-found: error | |
release: | |
needs: build | |
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: | | |
build-ubuntu-20.04/* | |
build-ubuntu-22.04/* | |
build-windows/* |