Skip to content

Commit bf11ef4

Browse files
authored
Dedicated website build, final status job (#4371)
1 parent 152cef5 commit bf11ef4

File tree

1 file changed

+43
-7
lines changed

1 file changed

+43
-7
lines changed

.github/workflows/build.yml

Lines changed: 43 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,50 @@ jobs:
7575
- name: Run Tests
7676
run: ./gradlew retrofit:robovm-test:robovmTest
7777

78-
publish:
78+
website:
7979
runs-on: ubuntu-latest
80-
if: github.repository == 'square/retrofit' && github.ref == 'refs/heads/trunk'
80+
steps:
81+
- uses: actions/checkout@v4
82+
- uses: actions/setup-java@v4
83+
with:
84+
distribution: 'zulu'
85+
java-version-file: .github/workflows/.java-version
86+
- uses: gradle/actions/setup-gradle@v4
87+
88+
- name: Build snapshot website
89+
run: |
90+
./gradlew copyWebsiteDocs
91+
cd website
92+
npm install && npm run build
93+
94+
- uses: actions/upload-artifact@v4
95+
with:
96+
name: website
97+
path: website/dist
98+
if-no-files-found: error
99+
100+
final-status:
101+
runs-on: ubuntu-latest
102+
if: ${{ !cancelled() }}
81103
needs:
82104
- jvm
83105
- android
84106
- robovm
107+
- website
108+
steps:
109+
- name: Check
110+
run: |
111+
results=$(tr -d '\n' <<< '${{ toJSON(needs.*.result) }}')
112+
if ! grep -q -v -E '(failure|cancelled)' <<< "$results"; then
113+
echo "One or more required jobs failed"
114+
exit 1
115+
fi
116+
117+
publish:
118+
runs-on: ubuntu-latest
119+
if: github.repository == 'square/retrofit' && github.ref == 'refs/heads/trunk'
120+
needs:
121+
- final-status
85122

86123
steps:
87124
- uses: actions/checkout@v4
@@ -98,11 +135,10 @@ jobs:
98135
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.GPG_SECRET_KEY }}
99136
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.GPG_SECRET_PASSPHRASE }}
100137

101-
- name: Build snapshot website
102-
run: |
103-
./gradlew copyWebsiteDocs
104-
cd website
105-
npm install && npm run build
138+
- uses: actions/download-artifact@v4
139+
with:
140+
name: site
141+
path: website/dist
106142

107143
- name: Deploy snapshot website
108144
uses: JamesIves/github-pages-deploy-action@releases/v3

0 commit comments

Comments
 (0)