-
Notifications
You must be signed in to change notification settings - Fork 10
123 lines (104 loc) · 3.03 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
name: CI
on:
pull_request:
branches: ['**']
push:
branches: ['main']
tags: [v*]
# release:
# types: [published]
jobs:
linux:
strategy:
matrix:
os: [ubuntu-latest]
image: ['daunnc/pdal-ubuntu:2.5.1']
runs-on: ${{ matrix.os }}
container:
image: ${{ matrix.image }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
# https://github.com/actions/runner/issues/2033
- name: Set ownership
run: |
# this is to fix GIT not liking owner of the checkout dir
chown -R $(id -u):$(id -g) $PWD
- uses: coursier/cache-action@v6
- name: Check formatting
run: ./sbt scalafmtCheckAll
- name: Build project
run: ./sbt +test
macos:
strategy:
matrix:
os: [macos-latest]
java: [8]
distribution: [temurin]
pdal: [2.5.0]
runs-on: ${{ matrix.os }}
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 }}
- name: Cache Homebrew
uses: actions/cache@v2
with:
path: ~/Library/Caches/Homebrew
key: ${{ runner.os }}-homebrew
- name: Homebrew update & tap PDAL ${{ matrix.pdal }}
run: |
brew update && \
brew tap-new $USER/local-pdal && \
brew extract --version=${{ matrix.pdal }} pdal $USER/local-pdal
- name: Install PDAL
run: brew install pdal@${{ matrix.pdal }} || true
- name: Check formatting
run: sbt scalafmtCheckAll
- name: Build project
run: sbt +test
- uses: actions/upload-artifact@v3
with:
name: macos
path: native/target/native/x86_64-darwin/bin
publish:
strategy:
matrix:
os: [ubuntu-latest]
image: ['daunnc/pdal-ubuntu:2.5.1']
runs-on: ${{ matrix.os }}
needs: [linux, macos]
container:
image: ${{ matrix.image }}
if: github.event_name != 'pull_request'
env:
PDAL_DEPEND_ON_NATIVE: "false"
CI_CLEAN: ""
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
# https://github.com/actions/runner/issues/2033
- name: Set ownership
run: |
# this is to fix GIT not liking owner of the checkout dir
chown -R $(id -u):$(id -g) $PWD
- uses: coursier/cache-action@v6
- 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 != '' }}