-
Notifications
You must be signed in to change notification settings - Fork 0
36 lines (34 loc) · 1.22 KB
/
devbuild.yml
File metadata and controls
36 lines (34 loc) · 1.22 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
name: Development Build
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
development_build:
name: Build dev jars
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: create a custom version using run number offset by 1000 (run_number + 1000)
run: |
echo "VERSION_NUMBER_WITH_OFFSET=$((300+GITHUB_RUN_NUMBER))" >> $GITHUB_ENV
- name: Setup JDK
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: '21'
- name: Build with Maven
run: mvn -B package --file pom.xml
- name: Extract Version from pom.xml
id: extract_version
run: |
version=$(grep -m 1 "<version>" pom.xml | sed -E 's/.*>(.*)<.*/\1/')
echo "version=$version" >> $GITHUB_ENV
echo "::set-output name=version::$version"
echo "artifactPath=$(pwd)/target" >> $GITHUB_ENV
- name: Upload Jars as Artifacts
uses: actions/upload-artifact@v4
with:
name: OneCore-${{ steps.extract_version.outputs.version }}-b${{ env.VERSION_NUMBER_WITH_OFFSET }}
path: ${{ env.artifactPath }}/onecore-${{ steps.extract_version.outputs.version }}.jar