-
Notifications
You must be signed in to change notification settings - Fork 4
77 lines (69 loc) · 2.13 KB
/
montecristo-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
name: Montecristo CI
on:
push:
paths:
- '**'
- "!untagged-.**"
- "!master-snapshot.**"
release:
types:
- published
jobs:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Setup Maven Cache
uses: actions/cache@v1
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/build.gradle') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Setup Java
uses: actions/setup-java@v1
with:
java-version: '8.0.192'
java-package: jdk
architecture: x64
- name: Get tag name
id: get_tag_name
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
- name: Build Montecristo
env:
VERSION: ${{ steps.get_tag_name.outputs.VERSION }}
run: |
echo "Building version $VERSION"
pushd montecristo/src/main/resources
./mkhugozip.sh
popd
pushd montecristo/
./gradlew build install
popd
- name: Packaging
env:
VERSION: ${{ steps.get_tag_name.outputs.VERSION }}
if: github.event_name == 'release' && github.event.action == 'published'
run: |
mkdir -p tlp-tools/disvery/montecristo/build/install
mkdir -p tlp-tools/montecristo/src/main/resources
cp -R docs tlp-tools/
cp -R ds-collector tlp-tools/
cp Makefile tlp-tools/
cp -R decrypt tlp-tools/
cp -R list tlp-tools/
cp montecristo/{docker-entrypoint.sh,Dockerfile,LICENSE,mksql.sh} tlp-tools/montecristo
cp -R montecristo/build/install tlp-tools/montecristo/build/
cp docker-compose.yml tlp-tools/
cp -R pull tlp-tools/
cp run.sh tlp-tools/
cp -R run.sh tlp-tools/
tar czf tlp-tools-${VERSION}.tar.gz tlp-tools
mkdir package
mv tlp-tools-* package
- name: Upload artifacts to GitHub Release
uses: fnkr/github-action-ghr@v1
if: github.event_name == 'release' && github.event.action == 'published'
env:
GHR_PATH: package
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}