Release LipidSpace #28
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
# create a release workflow from the main branch | |
name: Release LipidSpace | |
on: | |
release: | |
types: [ created ] | |
workflow_dispatch: | |
jobs: | |
build-linux: | |
runs-on: "ubuntu-latest" | |
env: | |
BUILD_DATE: ${{ github.run_id }}.${{ github.run_attempt }} | |
RELEASE_VERSION: ${{ github.ref_name }} | |
OS: "Linux" | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
lfs: 'true' | |
- name: Set Git user | |
run: | | |
git config --global committer.email "[email protected]" | |
git config --global committer.name "GitHub" | |
git config --global author.email "${GITHUB_ACTOR}@users.noreply.github.com" | |
git config --global author.name "${GITHUB_ACTOR}" | |
- name: Install dependencies | |
run: | | |
DEBIAN_FRONTEND=noninteractive sudo apt update | |
sudo apt install -y --no-install-recommends \ | |
build-essential \ | |
libfontconfig1 \ | |
qt6-base-dev \ | |
qt6-base-dev-tools \ | |
libqt6svg6-dev \ | |
libqt6svgwidgets6 \ | |
libopenblas-base \ | |
libopenblas-dev \ | |
libomp-dev \ | |
mesa-common-dev \ | |
libglu1-mesa-dev \ | |
libc6 \ | |
libstdc++6 | |
- name: Build LipidSpace | |
run: | | |
qmake6 LipidSpace.pro | |
make clean | |
make build | |
- name: Attach Binaries to Build | |
uses: actions/upload-artifact@v4 | |
# action zips automatically | |
with: | |
name: "LipidSpace-${{ env.RELEASE_VERSION }}-${{ env.OS }}" | |
path: "Build/LipidSpace" | |
- name: Upload binaries to release | |
uses: svenstaro/upload-release-action@v2 | |
# only upload binaries on release creation, not on manual trigger | |
if: github.event_name != 'workflow_dispatch' | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: Build/LipidSpace-${{ env.RELEASE_VERSION }}-${{ env.OS }}.zip | |
asset_name: LipidSpace-${{ env.RELEASE_VERSION }}-${{ env.OS }} | |
tag: ${{ github.ref }} | |
overwrite: true | |
file_glob: true | |
build-windows: | |
runs-on: "windows-2019" | |
env: | |
BUILD_DATE: ${{ github.run_id }}.${{ github.run_attempt }} | |
RELEASE_VERSION: ${{ github.ref_name }} | |
OS: "Windows" | |
QT_VERSION: "6.2.4" | |
QT_ARCH: "win64_mingw" | |
steps: | |
- name: Set up MinGW | |
uses: egor-tensin/[email protected] | |
with: | |
platform: x64 | |
version: 12.2.0 | |
- name: Install Qt | |
uses: jurplel/install-qt-action@v3 | |
with: | |
aqtversion: '==3.1.*' | |
version: ${{ env.QT_VERSION }} | |
target: "desktop" | |
host: "windows" | |
arch: ${{ env.QT_ARCH }} | |
cache: "true" | |
cache-key-prefix: "install-qt" | |
set-env: "true" | |
- name: Attach QT directory to Build | |
uses: actions/upload-artifact@v4 | |
# action zips automatically | |
with: | |
name: "Qt-${{ env.QT_VERSION }}" | |
path: "${{ github.workspace }}/../Qt" | |
- uses: actions/checkout@v3 | |
with: | |
lfs: 'true' | |
- name: Set Git user | |
run: | | |
git.exe config --global committer.email "[email protected]" | |
git.exe config --global committer.name "GitHub" | |
git.exe config --global author.email "${GITHUB_ACTOR}@users.noreply.github.com" | |
git.exe config --global author.name "${GITHUB_ACTOR}" | |
shell: cmd | |
- name: Prepare QT Project makefiles | |
run: | | |
qmake LipidSpace.pro | |
shell: cmd | |
- name: Clean LipidSpace | |
run: | | |
win-clean.bat | |
shell: cmd | |
- name: Build LipidSpace | |
run: | | |
make | |
if not exist "Build" mkdir "Build" | |
if not exist "Build/LipidSpace" mkdir "Build/LipidSpace" | |
if not exist "Build/LipidSpace/data" mkdir "Build/LipidSpace/data" | |
if not exist "Build/LipidSpace/examples" mkdir "Build/LipidSpace/examples" | |
copy "libraries/cppgoslin/bin/win64"\* "Build/LipidSpace" | |
copy "libraries/OpenBLAS/bin/win64"\* "Build/LipidSpace" | |
copy "libraries/OpenXLSX/bin/win64"\* "Build/LipidSpace" | |
copy .\data\classes-matrix.csv "Build/LipidSpace/data" | |
powershell Copy-Item "data/images" -Destination "Build/LipidSpace/data" -Recurse -force | |
copy .\examples\Example-Dataset.xlsx "Build/LipidSpace/examples" | |
copy .\examples\ThreeStudies.xlsx "Build/LipidSpace/examples" | |
copy LICENSE* "Build/LipidSpace" | |
copy .\release\LipidSpace.exe "Build/LipidSpace" | |
ls "${{ github.workspace }}/Qt/" | |
powershell Copy-Item "${{ github.workspace }}/../Qt/${{ env.QT_VERSION }}/${{ env.QT_ARCH }}"\* -Destination "Build/LipidSpace" -Recurse -force | |
powershell Compress-Archive "Build/LipidSpace" "Build/LipidSpace-${{ env.RELEASE_VERSION }}-${{ env.OS }}.zip" -force | |
shell: cmd | |
- name: Attach Binaries to Build | |
uses: actions/upload-artifact@v4 | |
# action zips automatically | |
with: | |
name: "LipidSpace-${{ env.RELEASE_VERSION }}-${{ env.OS }}" | |
path: "Build/LipidSpace" | |
- name: Upload binaries to release | |
uses: svenstaro/upload-release-action@v2 | |
# only upload binaries on release creation, not on manual trigger | |
if: github.event_name != 'workflow_dispatch' | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: Build/LipidSpace-${{ env.RELEASE_VERSION }}-${{ env.OS }}.zip | |
asset_name: LipidSpace-${{ env.RELEASE_VERSION }}-${{ env.OS }} | |
tag: ${{ github.ref }} | |
overwrite: true | |
file_glob: true | |