-
Notifications
You must be signed in to change notification settings - Fork 54
67 lines (67 loc) · 2.46 KB
/
run-release.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
name: Push release to AKSW maven and create GitHub release
on:
push:
tags:
- '*.*.*'
jobs:
build:
runs-on: ubuntu-latest
name: Build and Release
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'
server-id: 'maven.aksw.internal' # Value of the distributionManagement/repository/id field of the pom.xml
server-username: 'MAVEN_USERNAME' # env variable for username in deploy
server-password: 'MAVEN_TOKEN' # env variable for token in deploy
- name: Preserve Settings
run: cp ~/.m2/settings.xml ~/.m2_settings.xml
- name: Cache Maven packages
uses: actions/cache@v2
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Preserve Settings 2
run: mv ~/.m2_settings.xml ~/.m2/settings.xml
- name: Publish to AKSW Maven
run: mvn -B deploy
env:
MAVEN_USERNAME: ${{ secrets.MAVEN_USER }}
MAVEN_TOKEN: ${{ secrets.MAVEN_TOKEN }}
- name: Prepare shaded JAR
run: mvn -B package shade:shade -Dmaven.test.skip=true
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::$(echo $GITHUB_REF | cut -d / -f 3)
- name: Copy JAR
run: cp -p limes-core/target/limes-core-${{ steps.get_version.outputs.VERSION }}.jar limes.jar
- name: Release on GitHub
uses: softprops/action-gh-release@v1
with:
name: LIMES ${{ steps.get_version.outputs.VERSION }}
body: Released LIMES ${{ steps.get_version.outputs.VERSION }}
#bodyPath: @todo automatically extract changes from changelog
files: |
LICENSE
limes.jar
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
file: .github/Dockerfile
context: .
push: true
tags: dicegroup/limes:latest,dicegroup/limes:${{ steps.get_version.outputs.VERSION }}