|
11 | 11 | - uses: actions/checkout@v4
|
12 | 12 | with:
|
13 | 13 | fetch-depth: 1
|
| 14 | + |
14 | 15 | - name: Configure, compile and package
|
| 16 | + id: build-appimage |
| 17 | + env: |
| 18 | + PR_ID: ${{ github.event.number }} |
15 | 19 | run: |
|
16 | 20 | BUILDNR=${GITHUB_RUN_ID} VERSION_SUFFIX=${GITHUB_HEAD_REF} BUILD_UPDATER=ON DESKTOP_CLIENT_ROOT=`pwd` EXECUTABLE_NAME=nextcloud QT_BASE_DIR=/opt/qt OPENSSL_ROOT_DIR=/usr/local/lib64 /bin/bash -c "./admin/linux/build-appimage.sh"
|
17 |
| - BUILDNR=${GITHUB_RUN_ID} VERSION_SUFFIX=${GITHUB_HEAD_REF} DESKTOP_CLIENT_ROOT=`pwd` /bin/bash -c "./admin/linux/upload-appimage.sh" || echo "Upload failed, however this is an optional step." |
| 21 | +
|
| 22 | + - name: Upload AppImage artifact |
| 23 | + id: upload-appimage |
| 24 | + uses: actions/upload-artifact@v4 |
| 25 | + with: |
| 26 | + name: appimage-pr-${{ github.event.number }} |
| 27 | + path: ${{ steps.build-appimage.outputs.APPIMAGE_NAME }} |
| 28 | + overwrite: true |
| 29 | + |
| 30 | + - name: Comment AppImage |
| 31 | + uses: actions/github-script@v7 |
| 32 | + with: |
| 33 | + script: | |
| 34 | + const comment_identifier_string = "<!-- automated comment for an appimage build -->"; |
| 35 | +
|
| 36 | + const comment_body = ` |
| 37 | + ${comment_identifier_string} |
| 38 | +
|
| 39 | + AppImage file: [${{ steps.build-appimage.outputs.APPIMAGE_NAME }}](${{ steps.upload-appimage.outputs.artifact-url }}) |
| 40 | +
|
| 41 | + To test this change/fix you can simply download above AppImage file and test it. |
| 42 | +
|
| 43 | + Please make sure to quit your existing Nextcloud app and backup your data. |
| 44 | + `; |
| 45 | +
|
| 46 | + console.log("fetching old comments") |
| 47 | + const comments = await github.rest.issues.listComments({ |
| 48 | + owner: context.repo.owner, |
| 49 | + repo: context.repo.repo, |
| 50 | + issue_number: context.issue.number, |
| 51 | + }); |
| 52 | +
|
| 53 | + comments |
| 54 | + .data |
| 55 | + .filter(comment => comment.body?.includes(comment_identifier_string)) |
| 56 | + .forEach(comment => { |
| 57 | + console.log(`deleting previous AppImage comment with ID ${comment.id}`) |
| 58 | + github.rest.issues.deleteComment({ |
| 59 | + owner: context.repo.owner, |
| 60 | + repo: context.repo.repo, |
| 61 | + comment_id: comment.id, |
| 62 | + }) |
| 63 | + }); |
| 64 | +
|
| 65 | + console.log("creating new comment") |
| 66 | + github.rest.issues.createComment({ |
| 67 | + owner: context.repo.owner, |
| 68 | + repo: context.repo.repo, |
| 69 | + issue_number: context.issue.number, |
| 70 | + body: comment_body, |
| 71 | + }); |
0 commit comments