Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automate release generation from tags and refactor CI #115

Merged
merged 21 commits into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 0 additions & 69 deletions .appveyor.yml

This file was deleted.

15 changes: 15 additions & 0 deletions .github/environment.yml
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

78 changes: 0 additions & 78 deletions .github/workflows/ci-windows.yml

This file was deleted.

134 changes: 134 additions & 0 deletions .github/workflows/test.yml
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-*


Loading