Skip to content

Merge pull request #41 from ciffc-devops/master #42

Merge pull request #41 from ciffc-devops/master

Merge pull request #41 from ciffc-devops/master #42

Workflow file for this run

name: CMake
on:
push:
branches:
- master
env:
BUILD_TYPE: Release
BOOST_VERSION: 1.81.0
PROTO_VERSION: 21.10
jobs:
build:
strategy:
matrix:
os:
- ubuntu-20.04
- ubuntu-22.04
- windows-2019
include:
- os: ubuntu-20.04
os_version: 20.04
build_tool: gcc
- os: ubuntu-22.04
os_version: 22.04
build_tool: gcc
- os: windows-2019
os_version: 2019
build_tool: msvc142
runs-on: ${{ matrix.os }}
permissions:
contents: write
packages: write
outputs:
release_version: ${{ steps.configure-ubuntu.outputs.release_version }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v3
with:
repository: HeartlandSoftware/date
path: open/date
token: ${{ secrets.HSS_PAT }}
- uses: actions/checkout@v3
with:
repository: BertoldVdb/ZoneDetect
path: open/ZoneDetect
token: ${{ secrets.HSS_PAT }}
- name: Download LowLevel include files
uses: robinraju/[email protected]
with:
repository: "HeartlandSoftware/HSS_LowLevel"
latest: true
fileName: "includes.zip"
tarBall: false
zipBall: false
out-file-path: "cxx/HSS_LowLevel"
token: ${{ secrets.HSS_PAT }}
- name: Download ErrorCalc include files
uses: robinraju/[email protected]
with:
repository: "HeartlandSoftware/ErrorCalc2"
latest: true
fileName: "includes.zip"
tarBall: false
zipBall: false
out-file-path: "cxx/ErrorCalc"
token: ${{ secrets.HSS_PAT }}
- name: Download Multithread include files
uses: robinraju/[email protected]
with:
repository: "HeartlandSoftware/HSS_Multithread2"
latest: true
fileName: "includes.zip"
tarBall: false
zipBall: false
out-file-path: "cxx/HSS_Multithread"
token: ${{ secrets.HSS_PAT }}
- name: Download Math include files
uses: robinraju/[email protected]
with:
repository: "HeartlandSoftware/HSS_Math_2"
latest: true
fileName: "includes.zip"
tarBall: false
zipBall: false
out-file-path: "cxx/HSS_Math"
token: ${{ secrets.HSS_PAT }}
- name: Download Geography include files
uses: robinraju/[email protected]
with:
repository: "HeartlandSoftware/HSS_Geography_2"
latest: true
fileName: "includes.zip"
tarBall: false
zipBall: false
out-file-path: "cxx/HSS_Geography"
token: ${{ secrets.HSS_PAT }}
- name: Download Math protobuf files
uses: robinraju/[email protected]
with:
repository: "HeartlandSoftware/HSS_Math_2"
latest: true
fileName: "proto_def.zip"
tarBall: false
zipBall: false
out-file-path: "proto/HSS_Math"
token: ${{ secrets.HSS_PAT }}
- name: Download Geography protobuf files
uses: robinraju/[email protected]
with:
repository: "HeartlandSoftware/HSS_Geography_2"
latest: true
fileName: "proto_def.zip"
tarBall: false
zipBall: false
out-file-path: "proto/HSS_Geography"
token: ${{ secrets.HSS_PAT }}
- name: Download LowLevel lib
uses: robinraju/[email protected]
if: matrix.os == 'windows-2019'
with:
repository: "HeartlandSoftware/HSS_LowLevel"
latest: true
fileName: "windows.zip"
tarBall: false
zipBall: false
out-file-path: "cxx/dlibs/HSS_LowLevel"
token: ${{ secrets.HSS_PAT }}
- name: Download LowLevel lib
uses: robinraju/[email protected]
if: matrix.os == 'ubuntu-20.04'
with:
repository: "HeartlandSoftware/HSS_LowLevel"
latest: true
fileName: "ubuntu20.04.zip"
tarBall: false
zipBall: false
out-file-path: "cxx/dlibs/HSS_LowLevel"
token: ${{ secrets.HSS_PAT }}
- name: Download LowLevel lib
uses: robinraju/[email protected]
if: matrix.os == 'ubuntu-22.04'
with:
repository: "HeartlandSoftware/HSS_LowLevel"
latest: true
fileName: "ubuntu22.04.zip"
tarBall: false
zipBall: false
out-file-path: "cxx/dlibs/HSS_LowLevel"
token: ${{ secrets.HSS_PAT }}
- name: Download ErrorCalc lib
uses: robinraju/[email protected]
if: matrix.os == 'windows-2019'
with:
repository: "HeartlandSoftware/ErrorCalc2"
latest: true
fileName: "windows.zip"
tarBall: false
zipBall: false
out-file-path: "cxx/dlibs/ErrorCalc"
token: ${{ secrets.HSS_PAT }}
- name: Download ErrorCalc lib
uses: robinraju/[email protected]
if: matrix.os == 'ubuntu-20.04'
with:
repository: "HeartlandSoftware/ErrorCalc2"
latest: true
fileName: "ubuntu20.04.zip"
tarBall: false
zipBall: false
out-file-path: "cxx/dlibs/ErrorCalc"
token: ${{ secrets.HSS_PAT }}
- name: Download ErrorCalc lib
uses: robinraju/[email protected]
if: matrix.os == 'ubuntu-22.04'
with:
repository: "HeartlandSoftware/ErrorCalc2"
latest: true
fileName: "ubuntu22.04.zip"
tarBall: false
zipBall: false
out-file-path: "cxx/dlibs/ErrorCalc"
token: ${{ secrets.HSS_PAT }}
- name: Download Multithread lib
uses: robinraju/[email protected]
if: matrix.os == 'windows-2019'
with:
repository: "HeartlandSoftware/HSS_Multithread2"
latest: true
fileName: "lib-Windows-2019.zip"
tarBall: false
zipBall: false
out-file-path: "cxx/dlibs/HSS_Multithread"
token: ${{ secrets.HSS_PAT }}
- name: Download Multithread lib
uses: robinraju/[email protected]
if: matrix.os == 'ubuntu-20.04'
with:
repository: "HeartlandSoftware/HSS_Multithread2"
latest: true
fileName: "lib-Ubuntu-20.04.zip"
tarBall: false
zipBall: false
out-file-path: "cxx/dlibs/HSS_Multithread"
token: ${{ secrets.HSS_PAT }}
- name: Download Multithread lib
uses: robinraju/[email protected]
if: matrix.os == 'ubuntu-22.04'
with:
repository: "HeartlandSoftware/HSS_Multithread2"
latest: true
fileName: "lib-Ubuntu-22.04.zip"
tarBall: false
zipBall: false
out-file-path: "cxx/dlibs/HSS_Multithread"
token: ${{ secrets.HSS_PAT }}
- name: Download Math lib
uses: robinraju/[email protected]
if: matrix.os == 'windows-2019'
with:
repository: "HeartlandSoftware/HSS_Math_2"
latest: true
fileName: "lib-Windows-2019.zip"
tarBall: false
zipBall: false
out-file-path: "cxx/dlibs/HSS_Math"
token: ${{ secrets.HSS_PAT }}
- name: Download Math lib
uses: robinraju/[email protected]
if: matrix.os == 'ubuntu-20.04'
with:
repository: "HeartlandSoftware/HSS_Math_2"
latest: true
fileName: "lib-Ubuntu-20.04.zip"
tarBall: false
zipBall: false
out-file-path: "cxx/dlibs/HSS_Math"
token: ${{ secrets.HSS_PAT }}
- name: Download Math lib
uses: robinraju/[email protected]
if: matrix.os == 'ubuntu-22.04'
with:
repository: "HeartlandSoftware/HSS_Math_2"
latest: true
fileName: "lib-Ubuntu-22.04.zip"
tarBall: false
zipBall: false
out-file-path: "cxx/dlibs/HSS_Math"
token: ${{ secrets.HSS_PAT }}
- name: Download Geography lib
uses: robinraju/[email protected]
if: matrix.os == 'windows-2019'
with:
repository: "HeartlandSoftware/HSS_Geography_2"
latest: true
fileName: "lib-Windows-2019.zip"
tarBall: false
zipBall: false
out-file-path: "cxx/dlibs/HSS_Geography"
token: ${{ secrets.HSS_PAT }}
- name: Download Geography lib
uses: robinraju/[email protected]
if: matrix.os == 'ubuntu-20.04'
with:
repository: "HeartlandSoftware/HSS_Geography_2"
latest: true
fileName: "lib-Ubuntu-20.04.zip"
tarBall: false
zipBall: false
out-file-path: "cxx/dlibs/HSS_Geography"
token: ${{ secrets.HSS_PAT }}
- name: Download Geography lib
uses: robinraju/[email protected]
if: matrix.os == 'ubuntu-22.04'
with:
repository: "HeartlandSoftware/HSS_Geography_2"
latest: true
fileName: "lib-Ubuntu-22.04.zip"
tarBall: false
zipBall: false
out-file-path: "cxx/dlibs/HSS_Geography"
token: ${{ secrets.HSS_PAT }}
- name: Bundle Protobuf Files
if: matrix.os == 'ubuntu-20.04'
shell: pwsh
run: Compress-Archive -Path proto -DestinationPath proto_def.zip
- name: Download prebuilt timezone code
shell: pwsh
run: |
cd cxx
Invoke-WebRequest "https://heartlandsoftwaresolutions.sharepoint.com/:u:/g/HSS_Releases/Ef53CoBK3MFAlzYm4Lw7VOMBZ62KRxLsSGYPz4_XamvvWw?e=b8zdy0&download=1" -OutFile timezones.zip
Expand-Archive timezones.zip -DestinationPath timezones
- name: Unarchive downloaded include files
shell: pwsh
run: |
Expand-Archive proto/HSS_Math/proto_def.zip -DestinationPath . -Force
Expand-Archive proto/HSS_Geography/proto_def.zip -DestinationPath . -Force
cd cxx
Expand-Archive ErrorCalc/includes.zip -DestinationPath ErrorCalc
Expand-Archive HSS_LowLevel/includes.zip -DestinationPath HSS_LowLevel
Expand-Archive HSS_Multithread/includes.zip -DestinationPath HSS_Multithread
Expand-Archive HSS_Math/includes.zip -DestinationPath HSS_Math
Expand-Archive HSS_Geography/includes.zip -DestinationPath HSS_Geography
New-Item include/open/date/include/date -ItemType Directory -ea 0
Copy-Item ../open/date/include/date/*.h include/open/date/include/date
New-Item include/library -ItemType Directory -ea 0
Copy-Item ../open/ZoneDetect/library/zonedetect.h include/library
New-Item src/tz -ItemType Directory -ea 0
Copy-Item ../open/date/src/tz.cpp src/tz
Copy-Item ../open/ZoneDetect/library/zonedetect.c src
New-Item src/open/tzdb-2021e-src -ItemType Directory -ea 0
Copy-Item timezones/country/* src/open/tzdb-2021e-src
New-Item include/open/out_v1 -ItemType Directory -ea 0
Copy-Item timezones/out_v1/*.h include/open/out_v1
New-Item src/open/out_v1 -ItemType Directory -ea 0
Copy-Item timezones/out_v1/*.c src/open/out_v1
- name: Unarchive downloaded Windows libraries
if: matrix.os == 'windows-2019'
shell: pwsh
run: |
cd cxx
Expand-Archive dlibs/HSS_Multithread/lib-Windows-2019.zip -DestinationPath dlibs
Expand-Archive dlibs/ErrorCalc/windows.zip -DestinationPath dlibs
Expand-Archive dlibs/HSS_LowLevel/windows.zip -DestinationPath dlibs
Expand-Archive dlibs/HSS_Math/lib-Windows-2019.zip -DestinationPath dlibs
Expand-Archive dlibs/HSS_Geography/lib-Windows-2019.zip -DestinationPath dlibs
- name: Unarchive downloaded Ubuntu libraries
if: matrix.os == 'ubuntu-20.04'
shell: pwsh
run: |
cd cxx
Expand-Archive dlibs/HSS_Multithread/lib-Ubuntu-20.04.zip -DestinationPath dlibs
Expand-Archive dlibs/ErrorCalc/ubuntu20.04.zip -DestinationPath dlibs
Expand-Archive dlibs/HSS_LowLevel/ubuntu20.04.zip -DestinationPath dlibs
Expand-Archive dlibs/HSS_Math/lib-Ubuntu-20.04.zip -DestinationPath dlibs
Expand-Archive dlibs/HSS_Geography/lib-Ubuntu-20.04.zip -DestinationPath dlibs
- name: Unarchive downloaded Ubuntu libraries
if: matrix.os == 'ubuntu-22.04'
shell: pwsh
run: |
cd cxx
Expand-Archive dlibs/HSS_Multithread/lib-Ubuntu-22.04.zip -DestinationPath dlibs
Expand-Archive dlibs/ErrorCalc/ubuntu22.04.zip -DestinationPath dlibs
Expand-Archive dlibs/HSS_LowLevel/ubuntu22.04.zip -DestinationPath dlibs
Expand-Archive dlibs/HSS_Math/lib-Ubuntu-22.04.zip -DestinationPath dlibs
Expand-Archive dlibs/HSS_Geography/lib-Ubuntu-22.04.zip -DestinationPath dlibs
- name: Set up JDK 8
uses: actions/setup-java@v2
if: matrix.os == 'ubuntu-22.04'
with:
java-version: '8'
distribution: 'temurin'
server-id: github
cache: 'maven'
# Retrieve the cache, uses cache@v3
- name: Cache boost
uses: actions/cache@v3
id: cache-boost
with:
# Set the default path as the path to cache
path: '${{ runner.workspace }}/boost_*.tar.gz'
# Use the version as the key to only cache the correct version
key: boost-${{ env.BOOST_VERSION }}
- name: Install boost
uses: egor-tensin/build-boost@v1
id: install-boost
with:
version: ${{ env.BOOST_VERSION }}
toolset: ${{ matrix.build_tool }}
libraries: system chrono
- name: Setup Ubuntu
if: matrix.os == 'ubuntu-20.04' || matrix.os == 'ubuntu-22.04'
run: |
sudo apt install libgtest-dev libgdal-dev
- name: Build zlib
if: matrix.os == 'windows-2019'
shell: pwsh
run: |
cd cxx
Invoke-WebRequest "https://heartlandsoftwaresolutions.sharepoint.com/:u:/g/HSS_Releases/EUYThUR24ZZHq6GaiJ7fPFsBeilVSYM_agJV1Y8FTlJS0g?e=e3Nrmn&download=1" -OutFile zlib.zip
Expand-Archive zlib.zip -DestinationPath zlib
mv zlib/zlib-1.2.13/* zlib
cd zlib
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=install ../
cmake --build . --config Release
cmake --install .
- name: Download protobuf
shell: pwsh
run: |
cd cxx
Invoke-WebRequest "https://heartlandsoftwaresolutions.sharepoint.com/:u:/g/HSS_Releases/EUZ4knsEFP5FjNHHWR5dHc0BofAFyEPdLKRvzAgaTuDi1w?e=XW0Muc&download=1" -OutFile protobuf.zip
Expand-Archive protobuf.zip -DestinationPath protobuf
mv protobuf/protobuf-3.${{ env.PROTO_VERSION }}/* protobuf
- name: Build protobuf
if: matrix.os == 'windows-2019'
shell: pwsh
run: |
cd cxx
cd protobuf
cd cmake
mkdir build
cd build
$zlibpath = Resolve-Path -path ../../../zlib/build/install
cmake -Dprotobuf_WITH_ZLIB=ON -DZLIB_ROOT="$zlibpath" -Dprotobuf_BUILD_SHARED_LIBS=ON ../
cmake --build . --config Release --target libprotobuf
cmake --build . --config Release --target protoc
Copy-Item $zlibpath/bin/* Release
Copy-Item $zlibpath/lib/* Release
- name: Build protobuf
if: matrix.os == 'ubuntu-20.04' || matrix.os == 'ubuntu-22.04'
shell: pwsh
run: |
cd cxx
cd protobuf
cd cmake
mkdir build
cd build
cmake ../ -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_POSITION_INDEPENDENT_CODE=ON
cmake --build . --target libprotobuf
cmake --build . --target protoc
- name: Build Proto definition files
if: matrix.os == 'ubuntu-20.04' || matrix.os == 'ubuntu-22.04'
shell: pwsh
run: |
./cxx/protobuf/cmake/build/protoc --java_out java/src/main/java --cpp_out=dllexport_decl=TIMES_API:proto --proto_path proto/ --proto_path cxx/protobuf/src wtime.proto
Move-Item proto/*.pb.cc -Destination cxx/src/generated -force
(Get-Content -path proto/wtime.pb.h -Raw) -replace '#include <string>',"#include <string>`n#include `"internal/times_internal.h`"" | Set-Content -Path proto/wtime.pb.h
Move-Item proto/*.pb.h -Destination cxx/include -force
- name: Build Proto definition files
if: matrix.os == 'windows-2019'
shell: pwsh
run: |
./cxx/protobuf/cmake/build/Release/protoc --cpp_out=dllexport_decl=TIMES_API:proto --proto_path proto/ --proto_path cxx/protobuf/src wtime.proto
Move-Item proto/*.pb.cc -Destination cxx/src/generated -force
(Get-Content -path proto/wtime.pb.h -Raw) -replace '#include <string>',"#include <string>`n#include `"internal/times_internal.h`"" | Set-Content -Path proto/wtime.pb.h
Move-Item proto/*.pb.h -Destination cxx/include -force
- name: Bundle Include Files
if: matrix.os == 'ubuntu-20.04'
shell: pwsh
run: |
cd cxx
Compress-Archive -Path include -DestinationPath includes.zip
mv includes.zip ..
- name: Upload Include Bundle
if: matrix.os == 'ubuntu-20.04'
uses: actions/upload-artifact@v3
with:
name: release-libs
path: |
includes.zip
proto_def.zip
retention-days: 1
- name: Configure CMake Ubuntu
id: configure-ubuntu
if: matrix.os == 'ubuntu-20.04' || matrix.os == 'ubuntu-22.04'
run: |
cd cxx
mkdir build
cd build
mkdir ubuntu
cd ubuntu
cmake ../.. -DBOOST_INCLUDE_DIR=${{ steps.install-boost.outputs.root }} -DLOWLEVEL_INCLUDE_DIR=HSS_LowLevel/include -DTHIRD_PARTY_INCLUDE_DIR=HSS_LowLevel/third_party -DMULTITHREAD_INCLUDE_DIR=HSS_Multithread/include -DERROR_CALC_INCLUDE_DIR=ErrorCalc/include -DMATH_INCLUDE_DIR=HSS_Math/include -DGEOGRAPHY_INCLUDE_DIR=HSS_Geography/include -DPROTOBUF_INCLUDE_DIR=protobuf/src -DLOCAL_LIBRARY_DIR=dlibs -DPROTOBUF_LIBRARY_DIR=protobuf/cmake/build -DGDAL_INCLUDE_DIR=/usr/include/gdal -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
APPLICATION_VERSION=$(grep CMAKE_PROJECT_VERSION: CMakeCache.txt | cut -d "=" -f2)
APPLICATION_VERSION_MAJOR=$(grep CMAKE_PROJECT_VERSION_MAJOR: CMakeCache.txt | cut -d "=" -f2)
echo "release_version=$APPLICATION_VERSION" >> $GITHUB_OUTPUT
echo "release_version_major=$APPLICATION_VERSION_MAJOR" >> $GITHUB_OUTPUT
- name: Update Java Version
if: matrix.os == 'ubuntu-22.04'
run: |
cd java
mvn versions:set -DnewVersion=${{ steps.configure-ubuntu.outputs.release_version }}
- name: Build Ubuntu
if: matrix.os == 'ubuntu-20.04' || matrix.os == 'ubuntu-22.04'
run: |
cd cxx/build/ubuntu
cmake --build .
- name: Test Ubuntu
if: matrix.os == 'ubuntu-20.04' || matrix.os == 'ubuntu-22.04'
run: |
cd cxx/build/ubuntu
cp ../../dlibs/*.so.* .
ctest
- name: Setup Windows
id: setup-windows
if: matrix.os == 'windows-2019'
run: |
cd cxx
git clone https://github.com/google/googletest.git googletest
cd googletest
mkdir msvc
cd msvc
cmake ../ -Dgtest_force_shared_crt=ON
cmake --build . --config Release
echo "google_test_include_dir=googletest/googletest/include" >> $env:GITHUB_OUTPUT
echo "google_test_library_dir=googletest/msvc/lib/Release" >> $env:GITHUB_OUTPUT
- name: Download GDAL
if: matrix.os == 'windows-2019'
shell: pwsh
run: |
cd cxx
Invoke-WebRequest "https://heartlandsoftwaresolutions.sharepoint.com/:u:/g/HSS_Releases/EXnrOV_5audDuUmQjHymeDYBC_nMbcSQcOjP5Wi4IcPvkA?e=d8HeAq&download=1" -OutFile gdal.7z
& 7z.exe x gdal.7z -ogdal -y
- name: Configure CMake Windows
if: matrix.os == 'windows-2019'
run: |
cd cxx
mkdir build
cd build
mkdir windows
cd windows
cmake ../../ -DBOOST_INCLUDE_DIR=${{ steps.install-boost.outputs.root }} -DMSVC=1 -DGTEST_INCLUDE_DIR=${{ steps.setup-windows.outputs.google_test_include_dir }} -DGTEST_LIBRARY_DIR=${{ steps.setup-windows.outputs.google_test_library_dir }} -DLOWLEVEL_INCLUDE_DIR=HSS_LowLevel/include -DTHIRD_PARTY_INCLUDE_DIR=HSS_LowLevel/third_party -DMULTITHREAD_INCLUDE_DIR=HSS_Multithread/include -DERROR_CALC_INCLUDE_DIR=ErrorCalc/include -DMATH_INCLUDE_DIR=HSS_Math/include -DGEOGRAPHY_INCLUDE_DIR=HSS_Geography/include -DGDAL_INCLUDE_DIR=gdal/include -DPROTOBUF_INCLUDE_DIR=protobuf/src -DLOCAL_LIBRARY_DIR=dlibs -DPROTOBUF_LIBRARY_DIR=protobuf/cmake/build/Release -DGDAL_LIBRARY_DIR=gdal/lib -DBOOST_LIBRARY_DIR=${{ steps.install-boost.outputs.librarydir }}\..
- name: Build Windows
if: matrix.os == 'windows-2019'
run: |
cd cxx/build/windows
cmake --build . --config ${{env.BUILD_TYPE}}
- name: Archive Ubuntu Library
if: matrix.os == 'ubuntu-20.04'
shell: pwsh
run: |
cd cxx
Compress-Archive -DestinationPath lib-Ubuntu-20.04.zip -Path build\ubuntu\libWTime.so,build\ubuntu\libWTime.so.${{ steps.configure-ubuntu.outputs.release_version_major }},build\ubuntu\libWTime.so.${{ steps.configure-ubuntu.outputs.release_version }}
mv lib-Ubuntu-20.04.zip ..
- name: Upload Ubuntu Library
if: matrix.os == 'ubuntu-20.04'
uses: actions/upload-artifact@v3
with:
name: release-libs
path: lib-Ubuntu-20.04.zip
retention-days: 1
- name: Archive Ubuntu Library
if: matrix.os == 'ubuntu-22.04'
shell: pwsh
run: |
cd cxx
Compress-Archive -DestinationPath lib-Ubuntu-22.04.zip -Path build\ubuntu\libWTime.so,build\ubuntu\libWTime.so.${{ steps.configure-ubuntu.outputs.release_version_major }},build\ubuntu\libWTime.so.${{ steps.configure-ubuntu.outputs.release_version }}
mv lib-Ubuntu-22.04.zip ..
- name: Upload Ubuntu Library
if: matrix.os == 'ubuntu-22.04'
uses: actions/upload-artifact@v3
with:
name: release-libs
path: lib-Ubuntu-22.04.zip
retention-days: 1
- name: Archive Windows Library
if: matrix.os == 'windows-2019'
shell: pwsh
run: |
cd cxx
Compress-Archive -DestinationPath lib-Windows-2019.zip -Path build\windows\Release\WTime.dll,build\windows\Release\WTime.lib
mv lib-Windows-2019.zip ..
- name: Upload Windows Library
if: matrix.os == 'windows-2019'
uses: actions/upload-artifact@v3
with:
name: release-libs
path: lib-Windows-2019.zip
retention-days: 1
- name: Setup the Maven configuration file
uses: whelk-io/maven-settings-xml-action@v21
with:
servers: '[{ "id": "github", "username": "tredpath", "password": "${{ secrets.HSS_PAT }}" }]'
- name: Build Java
if: matrix.os == 'ubuntu-22.04'
run: |
cd java
mvn --batch-mode clean compile package
- name: Upload Java Library
if: matrix.os == 'ubuntu-22.04'
uses: actions/upload-artifact@v3
with:
name: release-libs
path: java/target/WTime.jar
retention-days: 1
- name: Publish package
if: matrix.os == 'ubuntu-22.04'
run: |
cd java
mvn --batch-mode deploy
env:
GITHUB_TOKEN: ${{ secrets.HSS_PAT }}
release:
runs-on: ubuntu-latest
needs: build
permissions:
contents: write
pull-requests: read
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Get Previous Tag
id: previoustag
uses: WyriHaximus/github-action-get-previous-tag@v1
with:
fallback: 'c2.5.0.10'
- name: Tag the repository
run: |
git config user.name github-actions
git config user.email [email protected]
RELEASE_TAG=c${{ needs.build.outputs.release_version }}
git tag -a $RELEASE_TAG -m "C++ release on $(date +'%Y-%m-%d') for commit $(git rev-parse HEAD)"
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}
tags: true
- name: Download Libraries
uses: actions/download-artifact@v3
with:
name: release-libs
- name: Create Release Notes
id: build-notes
uses: mikepenz/[email protected]
with:
toTag: c${{ needs.build.outputs.release_version }}
fromTag: ${{ steps.previoustag.outputs.tag }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create release
uses: softprops/action-gh-release@v1
with:
name: ${{ needs.build.outputs.release_version }}
body: ${{ steps.build-notes.outputs.changelog }}
files: |
lib-Windows-2019.zip
lib-Ubuntu-20.04.zip
lib-Ubuntu-22.04.zip
includes.zip
proto_def.zip
WTime.jar
tag_name: refs/tags/c${{ needs.build.outputs.release_version }}