-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (50 loc) · 1.58 KB
/
Copy pathrelease.yml
File metadata and controls
59 lines (50 loc) · 1.58 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
name: Release
on:
push:
tags:
- "v*"
workflow_dispatch:
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Read package version
id: meta
run: |
VERSION=$(mvn -q -DforceStdout help:evaluate -Dexpression=project.version)
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
echo "tag=v$VERSION" >> "$GITHUB_OUTPUT"
echo "archive=reloop-java-$VERSION-source.zip" >> "$GITHUB_OUTPUT"
- name: Verify tag matches pom.xml
if: github.ref_type == 'tag'
run: |
TAG_VERSION="${GITHUB_REF_NAME#v}"
PKG_VERSION="${{ steps.meta.outputs.version }}"
if [ "$TAG_VERSION" != "$PKG_VERSION" ]; then
echo "Tag v$TAG_VERSION does not match pom.xml version $PKG_VERSION"
exit 1
fi
- uses: actions/setup-java@v4
with:
java-version: "17"
distribution: "temurin"
- name: Build and test
run: mvn -B verify
- name: Create source archive
run: |
zip -r "${{ steps.meta.outputs.archive }}" . \
-x '*.git*' 'target/*' '.github/*'
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.meta.outputs.tag }}
name: Reloop Java SDK ${{ steps.meta.outputs.tag }}
generate_release_notes: true
files: |
${{ steps.meta.outputs.archive }}
target/*.jar
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}