Skip to content

Commit 1cb8ffc

Browse files
Update build-and-publish.yml
1 parent 0563999 commit 1cb8ffc

File tree

1 file changed

+33
-34
lines changed

1 file changed

+33
-34
lines changed

.github/workflows/build-and-publish.yml

Lines changed: 33 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,31 @@ env:
1919
PUBLISH_TASK: publishMavenCentralReleasePublicationToSonatypeRepository
2020

2121
jobs:
22+
maven_Preview:
23+
if: ${{ github.ref == 'refs/head/dev' }}
24+
environment:
25+
name: maven_central_snapshot
26+
runs-on: ubuntu-latest
27+
steps:
28+
- uses: actions/checkout@v2
29+
- name: Easy detect-secrets
30+
uses: RobertFischer/detect-secrets-action@v2.0.0
31+
- name: Set up JDK
32+
uses: actions/setup-java@v2
33+
with:
34+
java-version: '16'
35+
distribution: 'adopt'
36+
cache: gradle
37+
- run: .\scripts\decodeAndWrite.ps1 -encodedValue $env:ENCODED_VALUE -outputPath $env:OUTPUT_PATH
38+
shell: pwsh
39+
env:
40+
ENCODED_VALUE: ${{ secrets.LOCAL_PROPERTIES }}
41+
OUTPUT_PATH: .\local.properties
42+
- name: Grant execute permission for gradlew
43+
run: chmod +x gradlew
44+
- name: Publish
45+
run: ./gradlew $PREVIEW_TASK
46+
2247
maven_Release:
2348
if: ${{ github.ref == 'ref/head/master' }}
2449
environment:
@@ -33,15 +58,17 @@ jobs:
3358
with:
3459
java-version: '16'
3560
distribution: 'adopt'
36-
cache: gradle
37-
38-
##Copy the Step below for the other files with the appropriate values
61+
cache: gradle
3962
- run: .\scripts\decodeAndWrite.ps1 -encodedValue $env:ENCODED_VALUE -outputPath $env:OUTPUT_PATH
4063
shell: pwsh
4164
env:
42-
ENCODED_VALUE: ""
43-
OUTPUT_PATH: ""
44-
65+
ENCODED_VALUE: ${{ secrets.LOCAL_PROPERTIES }}
66+
OUTPUT_PATH: .\local.properties
67+
- run: .\scripts\decodeAndWrite.ps1 -encodedValue $env:ENCODED_VALUE -outputPath $env:OUTPUT_PATH
68+
shell: pwsh
69+
env:
70+
ENCODED_VALUE: ${{ secrets.SECRING_GPG }}
71+
OUTPUT_PATH: .\secring.gpg
4572
- name: Grant execute permission for gradlew
4673
run: chmod +x gradlew
4774
- name: Publish
@@ -76,31 +103,3 @@ jobs:
76103
env:
77104
GHR_PATH: current/working/directory/drop/
78105
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
79-
80-
maven_Preview:
81-
if: ${{ github.ref == 'refs/head/dev' }}
82-
environment:
83-
name: maven_central_snapshot
84-
runs-on: ubuntu-latest
85-
steps:
86-
- uses: actions/checkout@v2
87-
- name: Easy detect-secrets
88-
uses: RobertFischer/detect-secrets-action@v2.0.0
89-
- name: Set up JDK
90-
uses: actions/setup-java@v2
91-
with:
92-
java-version: '16'
93-
distribution: 'adopt'
94-
cache: gradle
95-
96-
##Copy the Step below for the other files with the appropriate values
97-
- run: .\scripts\decodeAndWrite.ps1 -encodedValue $ENCODED_VALUE -outputPath $OUTPUT_PATH
98-
shell: pwsh
99-
env:
100-
ENCODED_VALUE: ""
101-
OUTPUT_PATH: ""
102-
103-
- name: Grant execute permission for gradlew
104-
run: chmod +x gradlew
105-
- name: Publish
106-
run: ./gradlew $PREVIEW_TASK

0 commit comments

Comments
 (0)