-
-
Notifications
You must be signed in to change notification settings - Fork 76
68 lines (57 loc) · 2.53 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
name: Java CI with Maven
on:
push:
pull_request:
types:
- closed
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: maven
# configure git
- name: setup git config
run: |
git config user.name ${{ github.actor }}
git config user.email "<>"
- name: Build with Maven
run: mvn -Pzip install
- name: change tag 'snapshot' to current commit
if: ${{ github.event.pull_request.base.ref == 'main' && github.event.action == 'closed' && github.event.pull_request.merged == true}} # only make snapshot release if it is a push to main
run: |
git tag -f snapshot
git push -f origin --tags
# Read version changelog
- id: get-changelog
name: Get version changelog
if: ${{ github.event.pull_request.base.ref == 'main' && github.event.action == 'closed' && github.event.pull_request.merged == true}} # only make snapshot release if it is a push to main
uses: superfaceai/release-changelog-action@v1
with:
path-to-changelog: CHANGELOG.md
version: ${{ inputs.release_version }}
operation: read
- name: Make Release Body
if: ${{ github.event.pull_request.base.ref == 'main' && github.event.action == 'closed' && github.event.pull_request.merged == true}} # only make snapshot release if it is a push to main
run: |
cat src/build/snapshot-release/release-body-header.md > target/release-body.md
echo "# Changes" >> target/release-body.md
echo "${{ steps.get-changelog.outputs.changelog }}" >> target/release-body.md
cat src/build/snapshot-release/release-body-footer.md >> target/release-body.md
# Make github release
- name: Release
uses: softprops/action-gh-release@v2
if: ${{ github.event.pull_request.base.ref == 'main' && github.event.action == 'closed' && github.event.pull_request.merged == true}} # only make snapshot release if it is a push to main
with:
name: Latest snapshot release
tag_name: snapshot
body_path: target/release-body.md
files: target/qudt-public-repo-*.zip