forked from kekru/struktogrammeditor
-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (53 loc) · 1.78 KB
/
Copy pathrelease-assets.yml
File metadata and controls
62 lines (53 loc) · 1.78 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
# When you publish a new GitHub Release, this workflow builds the JAR and uploads it to that release.
name: Release — build JAR and attach
on:
release:
types: [published]
permissions:
contents: write
jobs:
attach-jar:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set release body from release-notes (if file exists for tag)
env:
RELEASE_URL: ${{ github.event.release.url }}
TAG_NAME: ${{ github.event.release.tag_name }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -euo pipefail
FILE="release-notes/${TAG_NAME}.md"
if [[ ! -f "$FILE" ]]; then
echo "No $FILE — leaving release description unchanged."
exit 0
fi
BODY=$(jq -n --rawfile body "$FILE" '{body: $body}')
curl -sS -f -X PATCH \
-H "Authorization: Bearer $GH_TOKEN" \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
"$RELEASE_URL" \
-d "$BODY"
echo "Release description set from $FILE."
- name: Make mvnw executable
run: chmod +x mvnw
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: "17"
distribution: temurin
cache: maven
- name: Build JAR
run: ./mvnw -B clean package -DskipTests
- name: Copy stable filename (for “latest” download link)
run: |
set -e
jar=$(ls target/visustruct-*.jar | head -1)
cp "$jar" visustruct.jar
- name: Upload assets to published release
uses: softprops/action-gh-release@v2
with:
files: |
target/visustruct-*.jar
visustruct.jar