Skip to content

Commit c95c55a

Browse files
authored
Update make-release.yml
1 parent 0e7a9e2 commit c95c55a

File tree

1 file changed

+40
-22
lines changed

1 file changed

+40
-22
lines changed

.github/workflows/make-release.yml

Lines changed: 40 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,88 @@
11
name: Make Release
2+
23
on:
34
workflow_dispatch:
45
inputs:
56
version_number:
6-
description: 'Version Number'
7+
description: 'Version Number'
78
required: true
89
type: string
910
info:
1011
description: 'Description of this Release'
1112
required: true
1213
type: string
1314

15+
permissions:
16+
contents: write
17+
1418
jobs:
1519
build_jar:
1620
name: Build Jar
1721
runs-on: ubuntu-latest
1822
steps:
1923
- name: Checkout
20-
uses: actions/checkout@v5
24+
uses: actions/checkout@v4
25+
2126
- name: Set up JDK 11
22-
uses: actions/setup-java@v5
27+
uses: actions/setup-java@v4
2328
with:
29+
distribution: temurin
2430
java-version: '11'
25-
distribution: 'adopt'
2631
cache: maven
27-
- name: Set Version
28-
uses: datamonsters/replace-action@v2
29-
with:
30-
files: 'pom.xml'
31-
replacements: 'Snapshot=${{ github.event.inputs.version_number }}'
32+
33+
- name: Set version in POM
34+
run: mvn -B -ntp versions:set -DnewVersion="${{ github.event.inputs.version_number }}" -DgenerateBackupPoms=false
35+
3236
- name: Build with Maven
33-
run: mvn --batch-mode --update-snapshots verify
37+
run: mvn -B -ntp --update-snapshots package
38+
39+
- name: Find built jar
40+
run: |
41+
set -e
42+
JAR="$(ls target/*-All.jar 2>/dev/null || ls target/*.jar | head -n1)"
43+
echo "JAR=$JAR" >> "$GITHUB_ENV"
44+
3445
- name: Rename jar
35-
run: mv target/*-All.jar JMusicBot-${{ github.event.inputs.version_number }}.jar
46+
run: mv "$JAR" "JMusicBot-${{ github.event.inputs.version_number }}.jar"
47+
3648
- name: Upload jar
37-
uses: actions/upload-artifact@v3
49+
uses: actions/upload-artifact@v4
3850
with:
3951
name: jar
4052
path: JMusicBot-${{ github.event.inputs.version_number }}.jar
4153
if-no-files-found: error
54+
4255
create_release:
4356
name: Create Release
4457
runs-on: ubuntu-latest
4558
needs: build_jar
4659
steps:
47-
- name: Download a Build Artifact
48-
uses: actions/download-artifact@v5
60+
- name: Download artifact
61+
uses: actions/download-artifact@v4
4962
with:
5063
name: jar
5164
path: .
52-
- name: Show Artifacts
53-
run: ls -R
54-
- name: Create Release
65+
66+
- name: Show artifacts
67+
run: ls -lah
68+
69+
- name: Create GitHub release (draft)
5570
uses: ncipollo/release-action@v1
5671
with:
5772
token: ${{ secrets.GITHUB_TOKEN }}
5873
tag: ${{ github.event.inputs.version_number }}
5974
name: Version ${{ github.event.inputs.version_number }}
6075
draft: true
6176
prerelease: false
62-
artifacts: "*.jar"
77+
artifacts: "JMusicBot-${{ github.event.inputs.version_number }}.jar"
6378
body: |
79+
**Important:** This repository is a fork (not the original). Please report issues upstream: https://github.com/jagrosh/MusicBot
80+
6481
${{ github.event.inputs.info }}
65-
82+
6683
---
6784
### Setup
68-
https://jmusicbot.com/setup
69-
https://jmusicbot.com/config
70-
# Download: [JMusicBot-${{ github.event.inputs.version_number }}.jar](https://github.com/jagrosh/MusicBot/releases/download/${{ github.event.inputs.version_number }}/JMusicBot-${{ github.event.inputs.version_number }}.jar)
85+
https://jmusicbot.com/setup
86+
https://jmusicbot.com/config
87+
88+
**Download:** JMusicBot-${{ github.event.inputs.version_number }}.jar

0 commit comments

Comments
 (0)