-
Notifications
You must be signed in to change notification settings - Fork 54
144 lines (139 loc) · 5.05 KB
/
ci.yml
File metadata and controls
144 lines (139 loc) · 5.05 KB
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
141
142
143
144
#
# CI build that assembles artifacts and runs tests.
# If validation is successful this workflow releases from the main dev branch.
#
# - skipping CI: add [skip ci] to the commit message
# - skipping release: add [skip release] to the commit message
#
name: CI
on:
push:
branches: ['master']
tags-ignore: [v*] # release tags are autogenerated after a successful CI, no need to run CI against them
pull_request:
branches: ['**']
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- scala-version: 2.12.19
spark-version: 2.4.3
java-version: '8'
- scala-version: 2.12.19
spark-version: 3.0.3
java-version: '8'
- scala-version: 2.12.19
spark-version: 3.1.3
java-version: '8'
- scala-version: 2.12.19
spark-version: 3.2.4
java-version: '8'
- scala-version: 2.13.14
spark-version: 3.2.4
java-version: '8'
- scala-version: 2.12.19
spark-version: 3.3.4
java-version: '8'
- scala-version: 2.13.14
spark-version: 3.3.4
java-version: '8'
- scala-version: 2.12.19
spark-version: 3.4.3
java-version: '8'
- scala-version: 2.13.14
spark-version: 3.4.3
java-version: '8'
- scala-version: 2.12.19
spark-version: 3.5.5
java-version: '8'
- scala-version: 2.13.14
spark-version: 3.5.5
java-version: '8'
- scala-version: 2.13.14
spark-version: 4.0.1
java-version: '17'
- scala-version: 2.13.14
spark-version: 4.1.1
java-version: '17'
if: "! contains(toJSON(github.event.commits.*.message), '[skip ci]')"
steps:
- name: Check out code
uses: actions/checkout@v6 # https://github.com/actions/checkout
with:
fetch-depth: '0' # https://github.com/shipkit/shipkit-changelog#fetch-depth-on-ci
- name: Set up Java
uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: ${{ matrix.java-version }}
- name: Perform build
env:
SCALA_VERSION: ${{ matrix.scala-version }}
SPARK_VERSION: ${{ matrix.spark-version }}
run: ./gradlew build publishToMavenLocal -PscalaVersion=$SCALA_VERSION -PsparkVersion=$SPARK_VERSION
- name: Release to Maven Central
# Release job, only for pushes to the main development branch
if: github.event_name == 'push'
&& github.ref == 'refs/heads/master'
&& github.repository == 'linkedin/isolation-forest'
&& !contains(toJSON(github.event.commits.*.message), '[skip release]')
run: ./gradlew publishToSonatype closeAndReleaseStagingRepository -i -PscalaVersion=$SCALA_VERSION -PsparkVersion=$SPARK_VERSION
env:
SCALA_VERSION: ${{ matrix.scala-version }}
SPARK_VERSION: ${{ matrix.spark-version }}
SONATYPE_PORTAL_TOKEN_USER: ${{ secrets.SONATYPE_PORTAL_TOKEN_USER }}
SONATYPE_PORTAL_TOKEN_PWD: ${{ secrets.SONATYPE_PORTAL_TOKEN_PWD }}
PGP_KEY: ${{ secrets.PGP_KEY }}
PGP_PWD: ${{ secrets.PGP_PWD }}
pypi-publish:
runs-on: ubuntu-latest
needs: build
# Release job, only for pushes to the main development branch
if: github.event_name == 'push'
&& github.ref == 'refs/heads/master'
&& github.repository == 'linkedin/isolation-forest'
&& !contains(toJSON(github.event.commits.*.message), '[skip release]')
steps:
- name: Check out code
uses: actions/checkout@v6 # https://github.com/actions/checkout
with:
fetch-depth: '0'
- name: Setup Java
uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: 8
- name: Setup Python
uses: actions/setup-python@v6 # https://github.com/actions/setup-python
with:
python-version: '3.9'
- name: Publish to PyPI
run: ./gradlew publishPythonPackage
env:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
github-release:
runs-on: ubuntu-latest
needs: ['build', 'pypi-publish']
# Release job, only for pushes to the main development branch
if: github.event_name == 'push'
&& github.ref == 'refs/heads/master'
&& github.repository == 'linkedin/isolation-forest'
&& !contains(toJSON(github.event.commits.*.message), '[skip release]')
steps:
- name: Check out code
# https://github.com/actions/checkout
uses: actions/checkout@v6
with:
# Needed to get all tags. Refer https://github.com/shipkit/shipkit-changelog#fetch-depth-on-ci
fetch-depth: '0'
- name: Setup Java
uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: 8
- name: Release to GitHub
run: ./gradlew githubRelease
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}