-
Notifications
You must be signed in to change notification settings - Fork 16
74 lines (65 loc) · 2.17 KB
/
CI_snapshot.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
name: CI snapshot
on:
push:
branches: [ master ]
workflow_run:
workflows: [ "CI release" ]
branches: [ master ]
types:
- completed
workflow_dispatch:
jobs:
build:
name: Upload Snapshot
runs-on: ubuntu-latest
steps:
# Checkout the source code of the project
- name: Checkout
uses: actions/checkout@v2
# Setup the jdk using version 11 of adoptOpenJDK
- name: Java setup
uses: actions/setup-java@v2
with:
distribution: adopt
java-version: 11
cache: 'maven'
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.GPG_SIGNING_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
# Set up the postgis database
- name: Postigs install
uses: SPalominos/[email protected]
with:
psql_version: '9.6'
pgis_version: '2.5'
docker_image: 'postgis/postgis'
db_password: 'orbisgis'
db_user: 'orbisgis'
db_name: 'orbisgis_db'
# Install the GPG secret key
- name: Install gpg secret key
run: |
cat <(echo -e "${{ secrets.OSSRH_GPG_SECRET_KEY }}") | gpg --batch --import
gpg --list-secret-keys --keyid-format LONG
# Deploy the snapshot
- name: Deploy
run: mvn deploy --no-transfer-progress --batch-mode
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_PASSWORD }}
# Build jar with dependencies
- name: Build jar with dependencies
run: mvn package -pl geoclimate
# Export the last git tag into env.
- name: Export env values
run: echo "VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_ENV
# Upload the jar with dependencies
- name: Archive production artifacts
uses: actions/upload-artifact@v2
with:
name: geoclimate-${{ env.VERSION }}
path: |
geoclimate/target/geoclimate-*.*.*-SNAPSHOT.jar