|
| 1 | +name: Publish Release |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + inputs: |
| 6 | + version: |
| 7 | + description: 'Version to release' |
| 8 | + required: true |
| 9 | + after-version: |
| 10 | + description: 'Snapshot version after release' |
| 11 | + required: true |
| 12 | + |
| 13 | +jobs: |
| 14 | + set-release-version: |
| 15 | + uses: AlexProgrammerDE/PistonQueue/.github/workflows/set-version.yml@main |
| 16 | + with: |
| 17 | + version: ${{ inputs.version }} |
| 18 | + secrets: inherit |
| 19 | + |
| 20 | + build: |
| 21 | + needs: set-release-version |
| 22 | + runs-on: ubuntu-latest |
| 23 | + permissions: |
| 24 | + contents: write |
| 25 | + steps: |
| 26 | + - name: Checkout repository |
| 27 | + uses: actions/checkout@v4 |
| 28 | + with: |
| 29 | + ref: ${{ github.ref }} |
| 30 | + - name: Validate Gradle wrapper |
| 31 | + uses: gradle/actions/wrapper-validation@v4 |
| 32 | + - name: Set up JDK 21 |
| 33 | + uses: actions/setup-java@v4 |
| 34 | + with: |
| 35 | + java-version: '21' |
| 36 | + distribution: 'temurin' |
| 37 | + - name: Setup Gradle |
| 38 | + uses: gradle/actions/setup-gradle@v4 |
| 39 | + - name: Build with Gradle |
| 40 | + run: ./gradlew build test --stacktrace --scan |
| 41 | + |
| 42 | + - name: Build Changelog |
| 43 | + id: github_release |
| 44 | + uses: mikepenz/release-changelog-builder-action@v5 |
| 45 | + with: |
| 46 | + mode: COMMIT |
| 47 | + toTag: ${{ github.ref }} |
| 48 | + configurationJson: | |
| 49 | + { |
| 50 | + "template": "#{{CHANGELOG}}", |
| 51 | + "categories": [ |
| 52 | + { |
| 53 | + "title": "## Feature", |
| 54 | + "labels": ["feat", "feature"] |
| 55 | + }, |
| 56 | + { |
| 57 | + "title": "## Fix", |
| 58 | + "labels": ["fix", "bug"] |
| 59 | + }, |
| 60 | + { |
| 61 | + "title": "## Performance", |
| 62 | + "labels": ["perf"] |
| 63 | + }, |
| 64 | + { |
| 65 | + "title": "## Refactor", |
| 66 | + "labels": ["refactor"] |
| 67 | + }, |
| 68 | + { |
| 69 | + "title": "## Documentation", |
| 70 | + "labels": ["docs"] |
| 71 | + }, |
| 72 | + { |
| 73 | + "title": "## Build", |
| 74 | + "labels": ["build", "chore", "ci"] |
| 75 | + }, |
| 76 | + { |
| 77 | + "title": "## Style", |
| 78 | + "labels": ["style"] |
| 79 | + }, |
| 80 | + { |
| 81 | + "title": "## Test", |
| 82 | + "labels": ["test"] |
| 83 | + }, |
| 84 | + { |
| 85 | + "title": "## Other", |
| 86 | + "labels": [] |
| 87 | + } |
| 88 | + ], |
| 89 | + "label_extractor": [ |
| 90 | + { |
| 91 | + "pattern": "^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test){1}(\\([\\w\\-\\.]+\\))?(!)?: ([\\w ])+([\\s\\S]*)", |
| 92 | + "on_property": "title", |
| 93 | + "target": "$1" |
| 94 | + } |
| 95 | + ] |
| 96 | + } |
| 97 | + env: |
| 98 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 99 | + |
| 100 | + - uses: Kir-Antipov/mc-publish@v3.3 |
| 101 | + with: |
| 102 | + modrinth-id: pistonqueue |
| 103 | + modrinth-featured: true |
| 104 | + modrinth-unfeature-mode: subset |
| 105 | + modrinth-token: ${{ secrets.MODRINTH_TOKEN }} |
| 106 | + |
| 107 | + github-tag: ${{ inputs.version }} |
| 108 | + github-generate-changelog: false |
| 109 | + github-draft: false |
| 110 | + github-prerelease: false |
| 111 | + github-commitish: main |
| 112 | + github-token: ${{ secrets.GITHUB_TOKEN }} |
| 113 | + |
| 114 | + files: | |
| 115 | + build/libs/PistonQueue-${{ inputs.version }}-Velocity.jar |
| 116 | + build/libs/PistonQueue-${{ inputs.version }}-Bukkit.jar |
| 117 | + build/libs/PistonQueue-${{ inputs.version }}-Bungee.jar |
| 118 | + build/libs/PistonQueue-${{ inputs.version }}-Placeholder.jar |
| 119 | +
|
| 120 | + name: PistonQueue ${{ inputs.version }} |
| 121 | + version: ${{ inputs.version }} |
| 122 | + version-type: release |
| 123 | + changelog: ${{ steps.github_release.outputs.changelog }} |
| 124 | + |
| 125 | + loaders: | |
| 126 | + bukkit |
| 127 | + bungeecord |
| 128 | + folia |
| 129 | + paper |
| 130 | + purpur |
| 131 | + spigot |
| 132 | + velocity |
| 133 | + waterfall |
| 134 | + game-versions: | |
| 135 | + >=1.8.0 |
| 136 | + game-version-filter: releases |
| 137 | + java: | |
| 138 | + 21 |
| 139 | +
|
| 140 | + retry-attempts: 2 |
| 141 | + retry-delay: 10000 |
| 142 | + fail-mode: fail |
| 143 | + |
| 144 | + - name: Discord Webhook Action |
| 145 | + uses: tsickert/discord-webhook@v7.0.0 |
| 146 | + with: |
| 147 | + webhook-url: ${{ secrets.WEBHOOK_URL }} |
| 148 | + content: <@&850705047938793503> New PistonQueue version released! |
| 149 | + embed-title: PistonQueue ${{ inputs.version }} |
| 150 | + embed-description: PistonQueue ${{ inputs.version }} has been released! Changelog and download can be found at https://modrinth.com/plugin/pistonqueue/version/${{ inputs.version }} |
| 151 | + embed-color: 16641028 |
| 152 | + embed-thumbnail-url: https://raw.githubusercontent.com/AlexProgrammerDE/PistonQueue/refs/heads/main/images/logo.png |
| 153 | + |
| 154 | + set-after-version: |
| 155 | + needs: build |
| 156 | + uses: AlexProgrammerDE/PistonQueue/.github/workflows/set-version.yml@main |
| 157 | + with: |
| 158 | + version: ${{ inputs.after-version }} |
| 159 | + secrets: inherit |
0 commit comments