diff options
author | Kristóf Marussy <kristof@marussy.com> | 2024-06-23 21:29:58 +0200 |
---|---|---|
committer | Kristóf Marussy <kristof@marussy.com> | 2024-06-23 21:46:33 +0200 |
commit | 45d92310f55d953472c95e1f81b1a113178187fb (patch) | |
tree | 2bc0b868a8f8b80dda91f3355f8addc1a6eede0f /.github | |
parent | build: automate GitHub pages deployment (diff) | |
download | refinery-45d92310f55d953472c95e1f81b1a113178187fb.tar.gz refinery-45d92310f55d953472c95e1f81b1a113178187fb.tar.zst refinery-45d92310f55d953472c95e1f81b1a113178187fb.zip |
build: publish Maven snapshots to GH pages
Diffstat (limited to '.github')
-rw-r--r-- | .github/workflows/build.yml | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9511db6a..916e124e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml | |||
@@ -80,6 +80,25 @@ jobs: | |||
80 | SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | 80 | SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |
81 | run: | | 81 | run: | |
82 | ./gradlew sonar -Pci --info --stacktrace --max-workers 4 --no-daemon | 82 | ./gradlew sonar -Pci --info --stacktrace --max-workers 4 --no-daemon |
83 | - name: Build signed Maven repository | ||
84 | if: ${{ matrix.os == 'ubuntu-latest' && github.event_name == 'push' && github.repository == 'graphs4value/refinery' }} | ||
85 | env: | ||
86 | PGP_KEY: ${{ secrets.PGP_KEY }} | ||
87 | PGP_KEY_ID: ${{ secrets.PGP_KEY_ID }} | ||
88 | PGP_PASSWORD: ${{ secrets.PGP_PASSWORD }} | ||
89 | run: | | ||
90 | ./gradlew mavenRepositoryTar -Pci -PforceSign --info --stacktrace --max-workers 4 --no-daemon | ||
91 | - name: Build unsigned Maven repository | ||
92 | if: ${{ matrix.os == 'ubuntu-latest' && (github.event_name != 'push' || github.repository != 'graphs4value/refinery') }} | ||
93 | run: | | ||
94 | ./gradlew mavenRepositoryTar -Pci --info --stacktrace --max-workers 4 --no-daemon | ||
95 | - name: Upload Maven repository artifact | ||
96 | if: ${{ matrix.os == 'ubuntu-latest' }} | ||
97 | uses: actions/upload-artifact@v4 | ||
98 | with: | ||
99 | name: maven-repository-tar | ||
100 | path: build/refinery-maven-repository.tar | ||
101 | compression-level: 0 | ||
83 | - name: Upload site artifact | 102 | - name: Upload site artifact |
84 | if: ${{ matrix.os == 'ubuntu-latest' }} | 103 | if: ${{ matrix.os == 'ubuntu-latest' }} |
85 | uses: actions/upload-artifact@v4 | 104 | uses: actions/upload-artifact@v4 |
@@ -107,8 +126,12 @@ jobs: | |||
107 | with: | 126 | with: |
108 | name: site-zip | 127 | name: site-zip |
109 | path: site-zip | 128 | path: site-zip |
129 | - name: Download Maven repository artifact | ||
130 | uses: actions/download-artifact@v4 | ||
131 | with: | ||
132 | name: maven-repository-tar | ||
133 | path: maven-repository-tar | ||
110 | - name: Import GPG key | 134 | - name: Import GPG key |
111 | id: import-gpg | ||
112 | uses: crazy-max/ghaction-import-gpg@ea88154188003ca5aeb616063b2d0dd6a9cf86e2 | 135 | uses: crazy-max/ghaction-import-gpg@ea88154188003ca5aeb616063b2d0dd6a9cf86e2 |
113 | with: | 136 | with: |
114 | gpg_private_key: ${{ secrets.PGP_KEY }} | 137 | gpg_private_key: ${{ secrets.PGP_KEY }} |
@@ -131,6 +154,10 @@ jobs: | |||
131 | git init | 154 | git init |
132 | git remote add origin "https://x-access-token:${GH_PAGES_TOKEN}@github.com/graphs4value/graphs4value.github.io.git" | 155 | git remote add origin "https://x-access-token:${GH_PAGES_TOKEN}@github.com/graphs4value/graphs4value.github.io.git" |
133 | unzip ../site-zip/refinery-docs.zip | 156 | unzip ../site-zip/refinery-docs.zip |
157 | mkdir -p maven/snapshots | ||
158 | pushd maven/snapshots | ||
159 | tar xf ../../../maven-repository-tar/refinery-maven-repository.tar | ||
160 | popd | ||
134 | git add . | 161 | git add . |
135 | git commit -S -m "Update from https://github.com/${GITHUB_REPOSITORY}/commit/${GITHUB_SHA}" | 162 | git commit -S -m "Update from https://github.com/${GITHUB_REPOSITORY}/commit/${GITHUB_SHA}" |
136 | git push --force origin main | 163 | git push --force origin main |