|
1 | 1 | name: Make Release
|
| 2 | + |
2 | 3 | on:
|
3 | 4 | workflow_dispatch:
|
4 | 5 | inputs:
|
5 | 6 | version_number:
|
6 |
| - description: 'Version Number' |
| 7 | + description: 'Version Number' |
7 | 8 | required: true
|
8 | 9 | type: string
|
9 | 10 | info:
|
10 | 11 | description: 'Description of this Release'
|
11 | 12 | required: true
|
12 | 13 | type: string
|
13 | 14 |
|
| 15 | +permissions: |
| 16 | + contents: write |
| 17 | + |
14 | 18 | jobs:
|
15 | 19 | build_jar:
|
16 | 20 | name: Build Jar
|
17 | 21 | runs-on: ubuntu-latest
|
18 | 22 | steps:
|
19 | 23 | - name: Checkout
|
20 |
| - uses: actions/checkout@v5 |
| 24 | + uses: actions/checkout@v4 |
| 25 | + |
21 | 26 | - name: Set up JDK 11
|
22 |
| - uses: actions/setup-java@v5 |
| 27 | + uses: actions/setup-java@v4 |
23 | 28 | with:
|
| 29 | + distribution: temurin |
24 | 30 | java-version: '11'
|
25 |
| - distribution: 'adopt' |
26 | 31 | 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 | + |
32 | 36 | - 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 | +
|
34 | 45 | - 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 | + |
36 | 48 | - name: Upload jar
|
37 |
| - uses: actions/upload-artifact@v3 |
| 49 | + uses: actions/upload-artifact@v4 |
38 | 50 | with:
|
39 | 51 | name: jar
|
40 | 52 | path: JMusicBot-${{ github.event.inputs.version_number }}.jar
|
41 | 53 | if-no-files-found: error
|
| 54 | + |
42 | 55 | create_release:
|
43 | 56 | name: Create Release
|
44 | 57 | runs-on: ubuntu-latest
|
45 | 58 | needs: build_jar
|
46 | 59 | steps:
|
47 |
| - - name: Download a Build Artifact |
48 |
| - uses: actions/download-artifact@v5 |
| 60 | + - name: Download artifact |
| 61 | + uses: actions/download-artifact@v4 |
49 | 62 | with:
|
50 | 63 | name: jar
|
51 | 64 | 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) |
55 | 70 | uses: ncipollo/release-action@v1
|
56 | 71 | with:
|
57 | 72 | token: ${{ secrets.GITHUB_TOKEN }}
|
58 | 73 | tag: ${{ github.event.inputs.version_number }}
|
59 | 74 | name: Version ${{ github.event.inputs.version_number }}
|
60 | 75 | draft: true
|
61 | 76 | prerelease: false
|
62 |
| - artifacts: "*.jar" |
| 77 | + artifacts: "JMusicBot-${{ github.event.inputs.version_number }}.jar" |
63 | 78 | body: |
|
| 79 | + **Important:** This repository is a fork (not the original). Please report issues upstream: https://github.com/jagrosh/MusicBot |
| 80 | +
|
64 | 81 | ${{ github.event.inputs.info }}
|
65 |
| - |
| 82 | +
|
66 | 83 | ---
|
67 | 84 | ### 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