-
Notifications
You must be signed in to change notification settings - Fork 1
41 lines (38 loc) · 1.25 KB
/
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
# Builds, tests and publishes to maven when a commit is pushed
name: CI Tests & Publish
on:
push:
branches: [ 'master' ]
paths-ignore:
- 'workflows/**'
- 'README.md'
permissions:
contents: read
checks: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: 'Checkout for CI 🛎️'
uses: actions/checkout@v4
- name: 'Set up JDK 21 📦'
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
- name: 'Build with Gradle 🏗️'
run: ./gradlew build publish
env:
SNAPSHOTS_MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
SNAPSHOTS_MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
- name: Set short SHA
run: echo "SHORT_SHA=$(echo $GITHUB_SHA | cut -c 1-7)" >> $GITHUB_ENV
- name: Find first built VelocityScoreboardAPI jar
run: |
FIRST_BUILT_FILE=$(ls target/VelocityScoreboardAPI-*-${{ env.SHORT_SHA }}.jar | sort | head -n 1)
echo "FIRST_BUILT_FILE=$FIRST_BUILT_FILE" >> $GITHUB_ENV
- name: Upload first built VelocityScoreboardAPI jar
uses: actions/upload-artifact@v4
with:
name: VelocityScoreboardAPI
path: ${{ env.FIRST_BUILT_FILE }}