-
Notifications
You must be signed in to change notification settings - Fork 5
87 lines (82 loc) · 3.06 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
name: Java CI with Maven
on: [pull_request, push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
# - name: Get previous tag
# id: get-previous-tag
# uses: actions-ecosystem/action-get-latest-tag@v1
# - name: Get Plugin Version from plugin.yml
# id: lookupPluginVersion
# uses: mikefarah/yq@master
# with:
# cmd: yq eval -p xml '.project.properties | .["minecraft.plugin.version"]' pom.xml
# - name: Bump version and push tag
# id: tag_version
# uses: mathieudutour/github-tag-action@v5.5
# with:
# github_token: ${{ secrets.GITHUB_TOKEN }}
# tag_prefix: ''
# custom_tag: ${{ steps.lookupPluginVersion.outputs.result }}
- name: Set up JDK 17
uses: actions/setup-java@v1
with:
java-version: 17
java-package: jdk
architecture: x86
- name: Cache Maven packages
uses: actions/cache@v1
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Build with Maven
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
#SNW_VERSION: ${{ steps.lookupPluginVersion.outputs.result }}
run: mvn clean package #mvn -Drevision=${SNW_VERSION} clean package
- run: mkdir staging && cp target/debuginfo-be.jar staging
- uses: actions/upload-artifact@v2
with:
name: DebugInfo-Be-Plugin-Latest
path: staging/debuginfo-be.jar
# - name: Generate release diff
# env:
# BEGIN_COMMIT: ${{ steps.get-previous-tag.outputs.tag }}
# END_COMMIT: ${{ steps.lookupPluginVersion.outputs.result }}
# run: git fetch --tags --force && git log --pretty=format:"* %s (%h)" ${BEGIN_COMMIT}..${END_COMMIT} > release_notes.md
- name: Create release
uses: ncipollo/release-action@v1
with:
artifacts: staging/debuginfo-be.jar
allowUpdates: true
bodyFile: "README.md"#"release_notes.md"
draft: false
prerelease: false
tag: "release" #${{steps.lookupPluginVersion.outputs.result}}
token: ${{ secrets.GITHUB_TOKEN }}
# - name: Upload jar to server
# env:
# PTERODACTYL_TOKEN: ${{ secrets.PTERODACTYL_TOKEN }}
# run: |
# cp staging/ParadisuPlugin.jar ParadisuPlugin.jar
# upload_plugin () {
# local upload_url=$(curl "https://panel.paradisu.net/api/client/servers/${1}/files/upload" -H "Authorization: Bearer ${PTERODACTYL_TOKEN}" -X GET -s | jq -r .attributes.url)
# curl -F files=@ParadisuPlugin.jar "${upload_url}&directory=/plugins"
# }
# server_ids=(
# "978fd706"
# "1b063a16"
# "a0638f52"
# "517d0585"
# )
# for id in ${server_ids[@]}
# do
# upload_plugin ${id}
# done