-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CMake modernization, automate release generation from tags and refact…
…or CI (#115) * CMake: Bumps the minimum CMake version to 3.13 * CMake: Add BUILD_SHARED_LIBS matrix for ON and OFF using similar config for macos-latest, windows-latest, and ubuntu-latest * CMake: Modernize CMake configuration to prevent flag/feature leaking * CMake: Adds CPack configuration so `package_source` target is available for dist generation * CMake: Updates FindPROJ.cmake with GDAL's recent version * CMake: add BUILD_MAN and BUILD_DOC options * CMake: Windows PDB install with BUILD_SHARED_LIBS * CMake: Remove FindGeoTIFF.cmake * Removes 16 year old dead `makefile.mpw` * Removes 6 year old dead `makefile.vc` * CI: Generates release artifacts and attaches them to every build * CI: Creates a release and attaches release artifacts for every tag of the OSGeo/libgeotiff repository * CI: [Attests](https://github.com/actions/attest-build-provenance) the release artifacts if the `github.repository_owner == OSGeo` * CI: Remove Appveyor config
- Loading branch information
Showing
13 changed files
with
423 additions
and
622 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: build | ||
channels: | ||
- conda-forge | ||
dependencies: | ||
- conda | ||
- mamba | ||
- compilers | ||
- ninja | ||
- cmake | ||
- proj | ||
- ccache | ||
- libtiff | ||
- zlib | ||
- libjpeg-turbo | ||
|
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,134 @@ | ||
|
||
name: Build | ||
on: [push, pull_request] | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build: | ||
name: ${{ matrix.os }} with BUILD_SHARED_LIBS=${{matrix.shared}} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [macos-latest, windows-latest, ubuntu-latest] | ||
shared: [ON, OFF] | ||
permissions: | ||
contents: write | ||
attestations: write | ||
id-token: write | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: ilammy/msvc-dev-cmd@v1 | ||
if: matrix.os == 'windows-latest' | ||
- name: Support longpaths | ||
run: git config --system core.longpaths true | ||
if: matrix.os == 'windows-latest' | ||
- uses: mamba-org/setup-micromamba@v1 | ||
with: | ||
init-shell: bash | ||
environment-file: ./.github/environment.yml | ||
environment-name: "build" | ||
cache-environment: true | ||
cache-downloads: true | ||
|
||
- name: Setup | ||
shell: bash -l {0} | ||
run: | | ||
mkdir build | ||
working-directory: ./libgeotiff | ||
|
||
- name: CMake | ||
shell: bash -l {0} | ||
env: | ||
BUILD_SHARED_LIBS: ${{ matrix.shared }} | ||
|
||
run: | | ||
if [ "$RUNNER_OS" == "Windows" ]; then | ||
export CC=cl.exe | ||
export CXX=cl.exe | ||
fi | ||
cmake -G "Ninja" \ | ||
-DCMAKE_BUILD_TYPE=RelWithDebInfo \ | ||
-DBUILD_SHARED_LIBS=$BUILD_SHARED_LIBS \ | ||
-DBUILD_TESTING=ON \ | ||
-DCMAKE_INSTALL_PREFIX=${CONDA_PREFIX} \ | ||
-DWITH_ZLIB=ON \ | ||
-DWITH_JPEG=ON \ | ||
-DWITH_TIFF=ON \ | ||
-DTIFF_NAMES=tiff \ | ||
-DPROJ_NAMES=proj \ | ||
-DJPEG_NAMES=libjpeg \ | ||
.. | ||
working-directory: ./libgeotiff/build | ||
|
||
- name: Compile | ||
shell: bash -l {0} | ||
run: | | ||
ninja | ||
working-directory: ./libgeotiff/build | ||
|
||
- name: Generate source distribution | ||
shell: bash -l {0} | ||
if: matrix.os == 'ubuntu-latest' | ||
run: | | ||
cmake --build . --config Release --target package_source | ||
extensions=".tar.gz .tar.bz2" | ||
for ext in $extensions | ||
do | ||
for filename in $(ls *$ext) | ||
do | ||
`md5sum $filename > $filename.md5` | ||
`sha256sum $filename > $filename.sha256sum` | ||
`sha512sum $filename > $filename.sha512sum` | ||
done | ||
done | ||
working-directory: ./libgeotiff/build | ||
- name: Attest | ||
uses: actions/attest-build-provenance@v1 | ||
if: matrix.os == 'ubuntu-latest' && matrix.shared == 'ON' && startsWith(github.ref, 'refs/tags/') && github.repository_owner == 'OSGeo' | ||
with: | ||
subject-path: './libgeotiff/build/libgeotiff-*' | ||
- uses: actions/upload-artifact@v4 | ||
if: matrix.os == 'ubuntu-latest' && matrix.shared == 'ON' | ||
name: Gather source distribution artifact | ||
with: | ||
name: source-package-${{matrix.os}} | ||
if-no-files-found: error | ||
path: | | ||
./libgeotiff/build/libgeotiff-* | ||
release: | ||
name: Gather and attach release | ||
runs-on: ubuntu-latest | ||
needs: build | ||
permissions: | ||
contents: write | ||
id-token: write | ||
attestations: write | ||
steps: | ||
- uses: actions/download-artifact@v4 | ||
name: Download release artifact | ||
with: | ||
name: source-package-ubuntu-latest | ||
path: release | ||
|
||
- uses: softprops/action-gh-release@v2 | ||
if: startsWith(github.ref, 'refs/tags/') | ||
name: Publish release as draft | ||
with: | ||
make_latest: false | ||
fail_on_unmatched_files: true | ||
prerelease: true | ||
generate_release_notes: true | ||
draft: true | ||
files: | | ||
release/libgeotiff-* | ||
Oops, something went wrong.