-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (68 loc) · 2.33 KB
/
maven-publish.yml
File metadata and controls
80 lines (68 loc) · 2.33 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: Maven Package
on:
workflow_dispatch
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/checkout@v3
with:
repository: WISE-Developers/WISE_Versions
path: versions
token: ${{ secrets.WISE_PAT }}
- name: Set up JDK 8
uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'temurin'
server-id: github
- name: Load values from versions
id: version-numbers
shell: pwsh
run: |
$versions = ConvertFrom-StringData (Get-Content versions/versions.properties -raw)
echo "Updating to version $($versions.wise)"
echo "prometheus_version=$($versions.wise)" >> $env:GITHUB_OUTPUT
- name: Update the version
run: mvn versions:set -DnewVersion=${{ steps.version-numbers.outputs.prometheus_version }}
- name: Build with Maven
run: mvn -B package --file pom.xml
- name: Publish package
run: mvn --batch-mode deploy
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Tag the repositories
id: last-tags
run: |
git config user.name github-actions
git config user.email github-actions@github.com
LAST_TAG=$(git describe --abbrev=0 --tags)
echo "last_tag=$LAST_TAG" >> $GITHUB_OUTPUT
git tag -a ${{ steps.version-numbers.outputs.prometheus_version }} -m "Release on $(date +'%Y-%m-%d') for commit $(git rev-parse HEAD)"
- name: Push changes
uses: ad-m/github-push-action@master
with:
tags: true
- name: Create Release Notes
id: api-notes
uses: mikepenz/release-changelog-builder-action@v3.5.0
with:
owner: WISE-Developers
repo: WISE_Java_API
toTag: ${{ steps.version-numbers.outputs.prometheus_version }}
fromTag: ${{ steps.last-tags.outputs.last_tag }}
env:
GITHUB_TOKEN: ${{ secrets.WISE_PAT }}
- name: Create release
uses: softprops/action-gh-release@v1
with:
name: ${{ steps.version-numbers.outputs.prometheus_version }}
body: ${{ steps.api-notes.outputs.changelog }}
files: target/*.jar
tag_name: refs/tags/${{ steps.version-numbers.outputs.prometheus_version }}