Deploy Pre-release #244
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: | |
| prepare_prerelease_body: | |
| needs: checkout_and_compile | |
| runs-on: ubuntu-latest | |
| name: Prepare Prerelease Body | |
| steps: | |
| - name: checkout repo content | |
| uses: actions/checkout@v3 # checkout the repository content to github runner. | |
| - 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 | |
| - name: save txt | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: prerelease.txt | |
| path: ./staging/ | |
| 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 | |
| - name: save jar | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: towny-${{ env.CURR_VER }}.jar | |
| path: ./Towny/target/ | |
| publish_prerelease: | |
| needs: [checkout_and_compile, prepare_prerelease_body] | |
| runs-on: ubuntu-latest | |
| name: Publish Prerelease | |
| steps: | |
| - name: load towny jar | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: towny-${{ env.CURR_VER }}.jar | |
| path: ./ | |
| - name: load prerelease.txt | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: prerelease.txt | |
| path: ./ | |
| - name: create pre-release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| body_path: ./prerelease.txt | |
| prerelease: true | |
| draft: true | |
| token: ${{ github.token }} | |
| tag_name: ${{ env.CURR_VER }} | |
| name: ${{ env.CURR_VER }}${{ env.SUPPORTED }} | |
| files: | | |
| ./towny-${{ env.CURR_VER }}.jar | |
| env: | |
| GITHUB_REPOSITORY: my_gh_org/my_gh_repo |