Fix syntax #13
This file contains 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: | |
push: | |
branches: | |
- jda5 # Adjust the branch name as needed | |
jobs: | |
build_jar: | |
name: Build Jar | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
ref: 'jda5' | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v2 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
cache: maven | |
- name: Set Version | |
uses: datamonsters/replace-action@v2 | |
with: | |
files: 'pom.xml' | |
replacements: 'Snapshot=${{ github.sha }}' | |
- name: Build with Maven | |
run: mvn --batch-mode --update-snapshots verify | |
- name: Add SHORT_SHA env property with commit short sha | |
run: echo "SHORT_SHA=`echo ${github.sha} | cut -c1-8`" >> $GITHUB_ENV | |
- name: Rename jar | |
run: mv target/*-All.jar JMusicBot-${ SHORT_SHA }.jar | |
- name: Upload jar | |
uses: actions/upload-artifact@v3 | |
with: | |
name: jar | |
path: JMusicBot-${ SHORT_SHA }.jar | |
if-no-files-found: error | |
create_release: | |
name: Create Release | |
runs-on: ubuntu-latest | |
needs: build_jar | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
ref: 'jda5' | |
fetch-depth: '0' | |
- name: Add SHORT_SHA env property with commit short sha | |
run: echo "SHORT_SHA=`echo ${{github.sha}} | cut -c1-8`" >> $GITHUB_ENV | |
- name: Download a Build Artifact | |
uses: actions/download-artifact@v3.0.0 | |
with: | |
name: jar | |
path: . | |
- name: Show Artifacts | |
run: ls -R | |
- name: Get Pushed Commits | |
id: get_pushed_commits | |
run: | | |
commit_range="${{ github.event.before }}..${{ github.sha }}" | |
commits=$(git log --pretty=format:'%h: %s' $commit_range) | |
echo "commits=$commits" >> $GITHUB_ENV | |
- name: Create Release | |
uses: ncipollo/release-action@v1 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
tag: ${ SHORT_SHA } | |
name: Version ${ SHORT_SHA } | |
draft: true | |
prerelease: false | |
artifacts: "*.jar" | |
body: | | |
Commits: | |
${{ env.commits }} | |
--- | |
### Setup | |
https://jmusicbot.com/setup | |
https://jmusicbot.com/config | |
# Download: [JMusicBot-${ SHORT_SHA }.jar](https://github.com/ErdbeerbaerLP/MusicBot/releases/download/${ SHORT_SHA }/JMusicBot-${ SHORT_SHA }.jar) |