|
1 | 1 | on: |
2 | | - push: |
3 | | - tags: |
4 | | - - "v*.*.*" |
| 2 | + push: |
| 3 | + tags: |
| 4 | + - "v*.*.*" |
5 | 5 |
|
6 | 6 | permissions: |
7 | | - contents: write |
| 7 | + contents: write |
8 | 8 |
|
9 | 9 | jobs: |
10 | | - publish: |
11 | | - runs-on: ubuntu-latest |
12 | | - steps: |
13 | | - - uses: actions/checkout@v4 |
14 | | - - run: git fetch --prune --unshallow |
| 10 | + publish: |
| 11 | + runs-on: ubuntu-latest |
| 12 | + steps: |
| 13 | + - uses: actions/checkout@v4 |
| 14 | + - run: git fetch --prune --unshallow |
15 | 15 |
|
16 | | - - name: Set up JDK |
17 | | - uses: actions/setup-java@v4 |
18 | | - with: |
19 | | - java-version: "21" |
20 | | - distribution: "temurin" |
21 | | - architecture: x64 |
| 16 | + - name: Set up JDK |
| 17 | + uses: actions/setup-java@v4 |
| 18 | + with: |
| 19 | + java-version: "21" |
| 20 | + distribution: "temurin" |
| 21 | + architecture: x64 |
22 | 22 |
|
23 | | - - name: Obtain version variables |
24 | | - run: | |
25 | | - echo "PREV_VERSION=$(git describe --tags --abbrev=0 `git rev-list --tags --skip=1 --max-count=1` | cut -c2-)" >> $GITHUB_ENV |
26 | | - echo "VERSION=$(git describe --tags --abbrev=0 | cut -c2-)" >> $GITHUB_ENV |
27 | | - - name: Replace version in plugin.yml |
28 | | - run: | |
29 | | - sed -i "s/^version: <dev>/version: ${VERSION}/" src/main/resources/plugin.yml |
30 | | - - name: Generate changelog |
31 | | - run: | |
32 | | - echo -e "**Changes** since v${PREV_VERSION}\n" > changelog.md |
33 | | - git log --no-merges --pretty=format:"- %s" v${PREV_VERSION}..v${VERSION} | grep "\[change\]" | sed "s/\s*\[[^]]*\]//g" | tac >> changelog.md |
34 | | - echo -e "\nView on GitHub: https://github.com/tizu69/plugin-headmate/compare/v${PREV_VERSION}...v${VERSION}" >> changelog.md |
35 | | - echo "CHANGELOG<<EOF" >> "$GITHUB_ENV" |
36 | | - cat changelog.md >> "$GITHUB_ENV" |
37 | | - echo "EOF" >> "$GITHUB_ENV" |
38 | | - echo "$(cat changelog.md)" >> $GITHUB_STEP_SUMMARY |
| 23 | + - name: Obtain version variables |
| 24 | + run: | |
| 25 | + echo "PREV_VERSION=$(git describe --tags --abbrev=0 `git rev-list --tags --skip=1 --max-count=1` | cut -c2-)" >> $GITHUB_ENV |
| 26 | + echo "VERSION=$(git describe --tags --abbrev=0 | cut -c2-)" >> $GITHUB_ENV |
| 27 | + - name: Replace version in plugin.yml |
| 28 | + run: | |
| 29 | + sed -i "s/^version: <dev>/version: ${VERSION}/" src/main/resources/plugin.yml |
| 30 | + - name: Generate changelog |
| 31 | + run: | |
| 32 | + echo -e "**Changes** since v${PREV_VERSION}\n" > changelog.md |
| 33 | + git log --no-merges --pretty=format:"- %s" v${PREV_VERSION}..v${VERSION} | grep "\[change\]" | sed "s/\s*\[[^]]*\]//g" | tac >> changelog.md |
| 34 | + echo -e "\nView on GitHub: https://github.com/tizu69/plugin-headmate/compare/v${PREV_VERSION}...v${VERSION}" >> changelog.md |
| 35 | + echo "CHANGELOG<<EOF" >> "$GITHUB_ENV" |
| 36 | + cat changelog.md >> "$GITHUB_ENV" |
| 37 | + echo "EOF" >> "$GITHUB_ENV" |
| 38 | + echo "$(cat changelog.md)" >> $GITHUB_STEP_SUMMARY |
39 | 39 |
|
40 | | - - name: Grant execute permission for gradlew |
41 | | - run: chmod +x gradlew |
42 | | - - name: Build with Gradle |
43 | | - run: ./gradlew jar |
| 40 | + - name: Grant execute permission for gradlew |
| 41 | + run: chmod +x gradlew |
| 42 | + - name: Build with Gradle |
| 43 | + run: ./gradlew jar |
44 | 44 |
|
45 | | - - name: Create GitHub Release |
46 | | - uses: softprops/action-gh-release@v2 |
47 | | - env: |
48 | | - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
49 | | - with: |
50 | | - tag_name: v${{ env.VERSION }} |
51 | | - name: v${{ env.VERSION }} |
52 | | - body_path: changelog.md |
53 | | - files: build/libs/headmate.jar |
54 | | - - name: Publish to CurseForge |
55 | | - uses: itsmeow/curseforge-upload@v1 |
56 | | - with: |
57 | | - token: ${{ secrets.CURSEFORGE_API_TOKEN }} |
58 | | - project_id: 1286566 |
59 | | - game_endpoint: bukkit |
60 | | - game_versions: "12988" |
61 | | - file_path: build/libs/headmate.jar |
62 | | - changelog: ${{ env.CHANGELOG }} |
63 | | - release_type: release |
64 | | - - name: Publish to Modrinth |
65 | | - uses: RubixDev/modrinth-upload@v1 |
66 | | - with: |
67 | | - token: ${{ secrets.MODRINTH_TOKEN }} |
68 | | - project_id: AhwqWlyK |
69 | | - file_path: build/libs/headmate.jar |
70 | | - name: headmate ${{ env.VERSION }} |
71 | | - version: ${{ env.VERSION }} |
72 | | - changelog: ${{ env.CHANGELOG }} |
73 | | - game_versions: 1.21.5 |
74 | | - loaders: paper,purpur |
75 | | - featured: true |
76 | | - release_type: release |
77 | | - - name: Publish to Hangar |
78 | | - uses: benwoo1110/hangar-upload-action@v1 |
79 | | - with: |
80 | | - api_token: ${{ secrets.HANGAR_TOKEN }} |
81 | | - slug: "headmate" |
82 | | - version: ${{ env.VERSION }} |
83 | | - channel: release |
84 | | - files: | |
85 | | - [{ "path": "build/libs/headmate.jar", "platforms": ["PAPER"] }] |
86 | | - platform_dependencies: | |
87 | | - { "PAPER": ["1.21"] } |
| 45 | + - name: Create GitHub Release |
| 46 | + uses: softprops/action-gh-release@v2 |
| 47 | + env: |
| 48 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 49 | + with: |
| 50 | + tag_name: v${{ env.VERSION }} |
| 51 | + name: v${{ env.VERSION }} |
| 52 | + body_path: changelog.md |
| 53 | + files: build/libs/headmate.jar |
| 54 | + - name: Publish to CurseForge |
| 55 | + uses: itsmeow/curseforge-upload@v1 |
| 56 | + with: |
| 57 | + token: ${{ secrets.CURSEFORGE_API_TOKEN }} |
| 58 | + project_id: 1286566 |
| 59 | + game_endpoint: bukkit |
| 60 | + game_versions: "12988" |
| 61 | + file_path: build/libs/headmate.jar |
| 62 | + changelog: ${{ env.CHANGELOG }} |
| 63 | + release_type: release |
| 64 | + - name: Publish to Modrinth |
| 65 | + uses: RubixDev/modrinth-upload@v1 |
| 66 | + with: |
| 67 | + token: ${{ secrets.MODRINTH_TOKEN }} |
| 68 | + project_id: AhwqWlyK |
| 69 | + file_path: build/libs/headmate.jar |
| 70 | + name: headmate ${{ env.VERSION }} |
| 71 | + version: ${{ env.VERSION }} |
| 72 | + changelog: ${{ env.CHANGELOG }} |
| 73 | + game_versions: 1.21.5 |
| 74 | + loaders: paper,purpur |
| 75 | + featured: true |
| 76 | + release_type: release |
| 77 | + - name: Publish to Hangar |
| 78 | + uses: benwoo1110/hangar-upload-action@v1 |
| 79 | + with: |
| 80 | + api_token: ${{ secrets.HANGAR_TOKEN }} |
| 81 | + slug: "headmate" |
| 82 | + version: ${{ env.VERSION }} |
| 83 | + channel: release |
| 84 | + files: | |
| 85 | + [{ "path": "build/libs/headmate.jar", "platforms": ["PAPER"] }] |
| 86 | + platform_dependencies: | |
| 87 | + { "PAPER": ["1.21"] } |
0 commit comments