Skip to content

Deploy Release As Draft #63

Deploy Release As Draft

Deploy Release As Draft #63

# This file will result in a new SiegeWar release version being deployed as a draft.
# After the draft is made, the Whats Changed section that is automatically generated
# manually moved into the table, and the release can be published.
name: Deploy Release As Draft
on:
workflow_dispatch:
env:
CURR_VER: 0.0.0
SUPPORTED: " for Towny "
TOWNY_VER: 0.0.0.0
jobs:
deploy_release_as_draft:
runs-on: ubuntu-latest
strategy:
matrix:
java: ['17']
name: Drafting SiegeWar Release
steps:
- name: checkout repo content
uses: actions/checkout@v3 # checkout the repository content to github runner.
- name: set up eclipse temurin
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: ${{ matrix.java }}
java-package: jdk
cache: 'maven'
- name: compile siegewar with maven
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: mvn -B clean package
- name: find current version
run: |
export POM_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
echo "CURR_VER=$POM_VERSION" >> $GITHUB_ENV
- name: find towny dependency version
run: |
export DEP_VERSION=$(mvn help:evaluate -Dexpression=towny.version -q -DforceStdout)
echo "TOWNY_VER=$DEP_VERSION" >> $GITHUB_ENV
- name: create release
uses: softprops/action-gh-release@v1
with:
body: |
<table align=center width=50%><br>
<th colspan=2><br>
<h1>SiegeWar ${{ env.CURR_VER }} is a release of SiegeWar<br>
<tr><br>
<td colspan=2><br>
<!-- paste Whats Changed and Changelog here -->
## Update Guide:<br>
1. Ensure you have *Towny* ${{ env.TOWNY_VER }} or newer.<br>
2. Download SiegeWar-${{ env.CURR_VER }}.jar from the assets section below⏬, and drop it into your plugins folder.<br>
3. Restart your server.<br>
<tr>
<td align=center width=50%><h3><a href="https://github.com/TownyAdvanced/SiegeWar/wiki/Siege-War-Installation">Installation Guide</a></td>
<td align=center width=50%><h3><a href="https://github.com/TownyAdvanced/SiegeWar/wiki">Wiki</a></td></tr>
<tr><td colspan=2 align=center><h3>⏬ Download available as a .jar file in the Assets section below:</td></tr>
</table>
generate_release_notes: true
append_body: true
draft: true
prerelease: false
token: ${{ github.token }}
tag_name: ${{ env.CURR_VER }}
name: ${{ env.CURR_VER }}${{ env.SUPPORTED }}${{ env.TOWNY_VER }}+
files: |
./target/SiegeWar-${{ env.CURR_VER }}.jar
env:
GITHUB_REPOSITORY: my_gh_org/my_gh_repo