File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # Used when a commit is pushed to the repository
2+ # This makes use of caching for faster builds and uploads the resulting artifacts
3+ name : build-commit
4+
5+ on :
6+ push :
7+ branches :
8+ - dev
9+
10+ jobs :
11+ build :
12+ runs-on : ubuntu-latest
13+ environment : staging
14+
15+ steps :
16+ - name : Extract current branch name
17+ shell : bash
18+ # bash pattern expansion to grab branch name without slashes
19+ run : ref="${GITHUB_REF#refs/heads/}" && echo "branch=${ref////-}" >> $GITHUB_OUTPUT
20+ id : ref
21+
22+ - name : Checkout sources
23+ uses : actions/checkout@v4
24+
25+ - name : Setup Java 21
26+ uses : actions/setup-java@v4
27+ with :
28+ distribution : temurin
29+ java-version : 21
30+
31+ - name : Setup Gradle
32+ uses : gradle/actions/setup-gradle@v4
33+ with :
34+ cache-read-only : false
35+
36+ - name : Execute Gradle build
37+ run : ./gradlew build
38+
39+ - name : Upload artifacts
40+ uses : actions/upload-artifact@v4
41+ with :
42+ name : sodium-artifacts-${{ steps.ref.outputs.branch }}
43+ path : build/mods/*.jar
44+
45+ - name : Publish Release Snapshot to CaffeineMC Maven
46+ env :
47+ ORG_GRADLE_PROJECT_caffeineMCMavenUsername : ${{ secrets.CAFFEINEMC_MAVEN_USERNAME }}
48+ ORG_GRADLE_PROJECT_caffeineMCMavenPassword : ${{ secrets.CAFFEINEMC_MAVEN_PASSWORD }}
49+ if : ${{ env.ORG_GRADLE_PROJECT_caffeineMCMavenUsername != '' && env.ORG_GRADLE_PROJECT_caffeineMCMavenPassword != '' }}
50+ run : ./gradlew publishAllPublicationsToCaffeineMCRepository
Original file line number Diff line number Diff line change 22# This makes use of caching for faster builds and uploads the resulting artifacts
33name : build-commit
44
5- on : [ push ]
5+ on :
6+ push :
7+ branches-ignore :
8+ - dev
69
710jobs :
811 build :
912 runs-on : ubuntu-latest
10- environment :
11- name : staging
1213
1314 steps :
1415 - name : Extract current branch name
1516 shell : bash
1617 # bash pattern expansion to grab branch name without slashes
1718 run : ref="${GITHUB_REF#refs/heads/}" && echo "branch=${ref////-}" >> $GITHUB_OUTPUT
1819 id : ref
20+
1921 - name : Checkout sources
2022 uses : actions/checkout@v4
2123
3840 with :
3941 name : sodium-artifacts-${{ steps.ref.outputs.branch }}
4042 path : build/mods/*.jar
41-
42- - name : Publish Commit Snapshot to CaffeineMC Maven
43- env :
44- ORG_GRADLE_PROJECT_caffeineMCMavenUsername : ${{ secrets.CAFFEINEMC_MAVEN_USERNAME }}
45- ORG_GRADLE_PROJECT_caffeineMCMavenPassword : ${{ secrets.CAFFEINEMC_MAVEN_PASSWORD }}
46- if : ${{ env.ORG_GRADLE_PROJECT_caffeineMCMavenUsername != '' && env.ORG_GRADLE_PROJECT_caffeineMCMavenPassword != '' }}
47- run : ./gradlew publishAllPublicationsToCaffeineMCRepository
Original file line number Diff line number Diff line change 99 runs-on : ubuntu-latest
1010
1111 steps :
12- - uses : actions/checkout@v4
13- - uses : actions/setup-java@v4
12+ - name : Extract current branch name
13+ shell : bash
14+ # bash pattern expansion to grab branch name without slashes
15+ run : ref="${GITHUB_REF#refs/heads/}" && echo "branch=${ref////-}" >> $GITHUB_OUTPUT
16+ id : ref
17+
18+ - name : Checkout sources
19+ uses : actions/checkout@v4
20+
21+ - name : Setup Java 21
22+ uses : actions/setup-java@v4
1423 with :
1524 distribution : temurin
1625 java-version : 21
2736 uses : actions/upload-artifact@v4
2837 with :
2938 name : sodium-artifacts-${{ steps.ref.outputs.branch }}
30- path : build/mods/*.jar
39+ path : build/mods/*.jar
You can’t perform that action at this time.
0 commit comments