Repository navigation
83 lines (78 loc) · 3.18 KB
/
Copy pathbuild_pullrequest.yml
File metadata and controls
83 lines (78 loc) · 3.18 KB
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
# PaperSand Auto compile
#
name: Build/Test Paper
on: [pull_request]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
java: [16]
fail-fast: true
steps:
- uses: actions/checkout@v2.3.5
- name: JDK ${{ matrix.java }}
uses: actions/setup-java@v2.3.1
with:
java-version: ${{ matrix.java }}
cache: 'gradle'
distribution: 'temurin'
- name: Set up Python 3.7
uses: actions/setup-python@v1
with:
python-version: "3.7"
- name: Patch and Build
run: |
git config --global user.email "no-reply@github.com"
git config --global user.name "Github Actions"
./gradlew applyPatches --stacktrace
./gradlew build --stacktrace
- name: Compile Jar Files
run: |
./gradlew createReobfPaperclipJar --stacktrace
- name: Create Artifact Folder
run: mkdir artifact
- name: Fetch Jar File
id: pl
uses: Rishabh510/Path-lister-action@master
with:
path: "build/libs/"
type: ".jar"
- name: Results
id: vars
run: |
for i in ${{ steps.pl.outputs.paths }}; do
if [[ $i == *"paper-paperclip"* ]]
then
echo "::set-output name=destinationFileName::$i"
fi
done
- name: Format Filename Part 1
uses: mad9000/actions-find-and-replace-string@1
id: findandreplace
with:
source: ${{ steps.vars.outputs.destinationFileName }}
find: 'build/libs//paper-paperclip-'
replace: ''
- name: Format Filename Part 2
uses: mad9000/actions-find-and-replace-string@1
id: findandreplace2
with:
source: ${{ steps.findandreplace.outputs.value }}
find: '-R0.1-SNAPSHOT-reobf.jar'
replace: ''
- name: Results after Replace
id: vars2
run: |
echo "The replaced value is ${{ steps.findandreplace2.outputs.value }}"
echo "::set-output name=destinationFileNameVersion::${{ steps.findandreplace2.outputs.value }}"
- name: Copy Jar File to Artifact Folder
uses: canastro/copy-file-action@master
with:
source: "build/libs/paper-paperclip-${{ steps.vars2.outputs.destinationFileNameVersion }}-R0.1-SNAPSHOT-reobf.jar"
target: "artifact/PaperSandServer-${{ steps.vars2.outputs.destinationFileNameVersion }}-v${{ github.run_number }}.jar"
- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
name: PaperSand-${{ steps.vars2.outputs.destinationFileNameVersion }}-v${{ github.run_number }}
path: artifact