-
Notifications
You must be signed in to change notification settings - Fork 72
134 lines (117 loc) · 3.7 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
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-*