Skip to content

Commit b194da8

Browse files
committed
Update the build script to list the ref.
1 parent b22e34e commit b194da8

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

.github/workflows/main-build.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,24 @@ jobs:
2525
name: build-artifact
2626
- name: Quality gate
2727
run: ./gradlew sonar -Dsonar.token=${{ secrets.SONAR_TOKEN }} -Dsonar.gradle.skipCompile=true -Dsonar.host.url=https://sonarcloud.io
28+
snapshot:
29+
runs-on: ubuntu-latest
30+
needs: build
31+
steps:
32+
- uses: actions/checkout@v4
33+
- name: Configure Java version
34+
uses: actions/setup-java@v4
35+
with:
36+
java-version: '21'
37+
distribution: 'temurin'
38+
architecture: x64
39+
- name: Publish artifacts
40+
run: |
41+
echo "Github ref: ${GITHUB_REF}"
42+
NEW_VERSION=$(echo "${GITHUB_REF}" | cut -d "/" -f3)
43+
echo "New version: ${NEW_VERSION}-SNAPSHOT
44+
echo "Github username: ${GITHUB_ACTOR}"
45+
./gradlew -Pversion=${NEW_VERSION}-SNAPSHOT publish -x check
46+
env:
47+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48+

.github/workflows/release-build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ jobs:
2323
architecture: x64
2424
- name: Publish artifacts
2525
run: |
26+
echo "Github ref: ${GITHUB_REF}"
2627
NEW_VERSION=$(echo "${GITHUB_REF}" | cut -d "/" -f3)
2728
echo "New version: ${NEW_VERSION}"
2829
echo "Github username: ${GITHUB_ACTOR}"

0 commit comments

Comments
 (0)