Make Release #2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Make Release | |
on: | |
workflow_dispatch: | |
inputs: | |
version_number: | |
description: 'Version Number' | |
required: true | |
type: string | |
info: | |
description: 'Description of this Release' | |
required: true | |
type: string | |
permissions: | |
contents: write | |
jobs: | |
build_jar: | |
name: Build Jar | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: temurin | |
java-version: '11' | |
cache: maven | |
- name: Set version in POM | |
run: mvn -B -ntp versions:set -DnewVersion="${{ github.event.inputs.version_number }}" -DgenerateBackupPoms=false | |
- name: Build with Maven | |
run: mvn -B -ntp --update-snapshots package | |
- name: Find built jar | |
run: | | |
set -e | |
JAR="$(ls target/*-All.jar 2>/dev/null || ls target/*.jar | head -n1)" | |
echo "JAR=$JAR" >> "$GITHUB_ENV" | |
- name: Rename jar | |
run: mv "$JAR" "JMusicBot-${{ github.event.inputs.version_number }}.jar" | |
- name: Upload jar | |
uses: actions/upload-artifact@v4 | |
with: | |
name: jar | |
path: JMusicBot-${{ github.event.inputs.version_number }}.jar | |
if-no-files-found: error | |
create_release: | |
name: Create Release | |
runs-on: ubuntu-latest | |
needs: build_jar | |
steps: | |
- name: Download artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: jar | |
path: . | |
- name: Show artifacts | |
run: ls -lah | |
- name: Create GitHub release (draft) | |
uses: ncipollo/release-action@v1 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
tag: ${{ github.event.inputs.version_number }} | |
name: Version ${{ github.event.inputs.version_number }} | |
draft: true | |
prerelease: false | |
artifacts: "JMusicBot-${{ github.event.inputs.version_number }}.jar" | |
body: | | |
**Important:** This repository is a fork (not the original). Please report issues upstream: https://github.com/jagrosh/MusicBot | |
${{ github.event.inputs.info }} | |
--- | |
### Setup | |
https://jmusicbot.com/setup | |
https://jmusicbot.com/config | |
**Download:** JMusicBot-${{ github.event.inputs.version_number }}.jar |