forked from Slimefun/Slimefun4
-
-
Notifications
You must be signed in to change notification settings - Fork 61
45 lines (42 loc) · 1.39 KB
/
dev-ci.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
# 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: Slimefun DEV
on:
push:
branches:
- dev
paths:
- 'src/**'
- 'pom.xml'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 17
java-package: jdk
architecture: x64
cache: maven
- name: Codestyle check
run: mvn -B spotless:check --errors
- name: Build Slimefun
run: mvn -B package --errors
- name: Mask Output
run: |
echo "::add-mask::$CF_API_TOKEN"
env:
CF_API_TOKEN: ${{ secrets.CF_API_TOKEN }}
- name: Get build artifact filename
run: |
cd target && FILENAME=$(find . -maxdepth 1 -mindepth 1 -name "Slimefun-*" | cut -d'/' -f 2)
echo "slimefun-artifact-name=$FILENAME" >> "$GITHUB_ENV"
cd ..
- name: Upload Build to R2
uses: cloudflare/[email protected]
with:
apiToken: ${{ secrets.CF_API_TOKEN }}
command: "r2 object put slimefun-dev/${{ env.slimefun-artifact-name }} --file=./target/${{ env.slimefun-artifact-name }} --content-type=application/java-archive"