-
Notifications
You must be signed in to change notification settings - Fork 5
54 lines (51 loc) · 1.74 KB
/
Copy pathrelease.yml
File metadata and controls
54 lines (51 loc) · 1.74 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
name: CI
on:
push:
branches:
- main
jobs:
build:
name: Build and release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
java-version: 17
distribution: 'adopt'
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
settings-path: ${{ github.workspace }} # location for the settings.xml file
- name: Build and test project
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
export MVN_PROJECT_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
echo "MVN_PROJECT_VERSION=$MVN_PROJECT_VERSION" >> $GITHUB_ENV
mvn -DskipTests=true --no-transfer-progress -s $GITHUB_WORKSPACE/settings.xml clean package
- name: Create Release
id: create_release
uses: actions/create-release@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ env.MVN_PROJECT_VERSION }}
release_name: Release v${{ env.MVN_PROJECT_VERSION }}
draft: false
prerelease: false
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: appcontainerapp/target/AppContainer.war
asset_name: AppContainer.war
asset_content_type: application/war