-
Notifications
You must be signed in to change notification settings - Fork 10
140 lines (120 loc) · 3.79 KB
/
ci.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
133
134
135
136
137
138
139
140
name: CI
on:
pull_request:
branches: ['**']
push:
branches: ['main']
tags: [v*]
# release:
# types: [published]
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
java: [8]
distribution: [temurin]
pdal: [2.6.2]
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash -el {0}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: coursier/cache-action@v6
- uses: actions/setup-java@v3
with:
distribution: ${{ matrix.distribution }}
java-version: ${{ matrix.java }}
- uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: pdal-java
channels: conda-forge
- name: Get Date
id: get-date
run: echo "today=$(/bin/date -u '+%Y%m%d')" >> $GITHUB_OUTPUT
shell: bash
- name: Cache Conda envs
uses: actions/cache@v3
with:
path: /usr/share/miniconda/envs/pdal-java
key:
conda-pdal-java-${{ runner.os }}--${{ runner.arch }}--${{steps.get-date.outputs.today }}-${{ matrix.pdal }}-${{ env.CACHE_NUMBER }}
env:
CACHE_NUMBER: 0
id: conda-cache
- name: Install PDAL
if: steps.conda-cache.outputs.cache-hit != 'true'
run: conda install pdal=${{ matrix.pdal }}
- name: Set LD_LIBRARY_PATH
run: echo "LD_LIBRARY_PATH=$CONDA/envs/pdal-java/lib:/usr/local/lib:$LD_LIBRARY_PATH" >> "$GITHUB_ENV"
- name: Check formatting
run: sbt scalafmtCheckAll
- name: Build project
run: sbt +test
- uses: actions/upload-artifact@v3
if: ${{ startsWith(matrix.os, 'macos') }}
with:
name: macos
path: native/target/native/x86_64-darwin/bin
publish:
strategy:
matrix:
os: [ubuntu-latest]
java: [8]
distribution: [temurin]
pdal: [2.6.2]
runs-on: ${{ matrix.os }}
if: github.event_name != 'pull_request'
needs: [build]
defaults:
run:
shell: bash -el {0}
env:
PDAL_DEPEND_ON_NATIVE: "false"
CI_CLEAN: ""
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: coursier/cache-action@v6
- uses: actions/setup-java@v3
with:
distribution: ${{ matrix.distribution }}
java-version: ${{ matrix.java }}
- uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: pdal-java
channels: conda-forge
- name: Get Date
id: get-date
run: echo "today=$(/bin/date -u '+%Y%m%d')" >> $GITHUB_OUTPUT
shell: bash
- name: Cache Conda envs
uses: actions/cache@v3
with:
path: /usr/share/miniconda/envs/pdal-java
key:
conda-pdal-java-${{ runner.os }}--${{ runner.arch }}--${{steps.get-date.outputs.today }}-${{ matrix.pdal }}-${{ env.CACHE_NUMBER }}
env:
CACHE_NUMBER: 0
id: conda-cache
- name: Install PDAL
if: steps.conda-cache.outputs.cache-hit != 'true'
run: conda install pdal=${{ matrix.pdal }}
- name: Set LD_LIBRARY_PATH
run: echo "LD_LIBRARY_PATH=$CONDA/envs/pdal-java/lib:/usr/local/lib:$LD_LIBRARY_PATH" >> "$GITHUB_ENV"
- uses: actions/download-artifact@v3
with:
name: macos
path: native/target/native/x86_64-darwin/bin
- name: Release
run: sbt ci-release
env:
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
if: ${{ env.SONATYPE_PASSWORD != '' && env.SONATYPE_USERNAME != '' }}