Deploy Pre-release #240
Workflow file for this run
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: Deploy Pre-release | |
| on: | |
| workflow_dispatch: | |
| env: | |
| CURR_VER: 0.0.0.0 | |
| SUPPORTED: " for MC 1.19.* & 1.20.* & 1.21.*" | |
| jobs: | |
| checkout_and_compile: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| java: ['21'] | |
| name: Checkout and Compile Towny | |
| 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 towny with maven | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: mvn -B clean package -DskipTests=false | |
| prepare_prerelease_body: | |
| needs: checkout_and_compile | |
| runs-on: ubuntu-latest | |
| name: Prepare Prerelease Body | |
| steps: | |
| - name: setup python | |
| uses: actions/setup-python@v3 | |
| with: | |
| python-version: 3.8 #install the python needed | |
| - name: create sponsors.txt | |
| run: python ./.github/workflows/prerelease/get_sponsors.py | |
| - name: create staging dir | |
| run: mkdir staging && cp sponsors.txt staging | |
| - name: execute sponsortable.py | |
| run: python ./.github/workflows/prerelease/sponsortable.py | |
| - name: execute preRelease.py | |
| id: prerelease_py | |
| run: python ./.github/workflows/prerelease/prerelease.py | |
| publish_prerelease: | |
| needs: [checkout_and_compile, prepare_prerelease_body] | |
| runs-on: ubuntu-latest | |
| name: Publish Prerelease | |
| steps: | |
| - name: create pre-release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| body_path: ./staging/prerelease.txt | |
| prerelease: true | |
| draft: true | |
| token: ${{ github.token }} | |
| tag_name: ${{ env.CURR_VER }} | |
| name: ${{ env.CURR_VER }}${{ env.SUPPORTED }} | |
| files: | | |
| ./Towny/target/towny-${{ env.CURR_VER }}.jar | |
| env: | |
| GITHUB_REPOSITORY: my_gh_org/my_gh_repo |