-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (40 loc) · 1.46 KB
/
maven.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
# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
name: Run Maven and publish
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Pull source
uses: actions/checkout@v1
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
server-id: io.github.gk0wk.railexpress # Value of the distributionManagement/repository/id field of the pom.xml
settings-path: ${{ github.workspace }} # location for the settings.xml file
- name: Restore Maven cache
uses: skjolber/maven-cache-github-action@v1
with:
step: restore
- name: Build with Maven
run: mvn clean && mvn -B package --file pom.xml
- name: Set Release version env variable
run: echo "RELEASE_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_ENV
- name: Save Maven cache
uses: skjolber/maven-cache-github-action@v1
with:
step: save
- name: Upload to Release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: target/RailExpress-*.jar
tag: ${{ env.RELEASE_VERSION }}
overwrite: true
file_glob: true