2023-04-01 11:12:56 +02:00
|
|
|
# SPDX-License-Identifier: MIT
|
2023-05-26 14:48:58 +02:00
|
|
|
|
2023-09-02 07:42:49 +02:00
|
|
|
#
|
|
|
|
# Upload (and download) a release to (and from) a project
|
|
|
|
# found in a Forgejo instance that is different from the one running the workflow
|
|
|
|
#
|
|
|
|
name: two Forgejo
|
2023-03-29 17:16:26 +02:00
|
|
|
on: [push]
|
|
|
|
jobs:
|
|
|
|
setup-forgejo:
|
|
|
|
runs-on: self-hosted
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- id: forgejo
|
|
|
|
uses: https://code.forgejo.org/actions/setup-forgejo@v1
|
|
|
|
with:
|
2023-03-29 19:20:39 +02:00
|
|
|
user: testuser
|
2023-03-29 17:16:26 +02:00
|
|
|
password: admin1234
|
2023-03-30 01:08:42 +02:00
|
|
|
lxc-ip-prefix: 10.0.15
|
2023-09-02 07:42:49 +02:00
|
|
|
image-version: 1.20
|
2023-03-29 19:29:24 +02:00
|
|
|
- id: testrepo
|
|
|
|
run: |
|
2024-01-03 21:55:13 +01:00
|
|
|
url=http://testuser:admin1234@${{ steps.forgejo.outputs.host-port }}
|
|
|
|
forgejo-test-helper.sh push testrepo $url testuser testrepo > /tmp/output
|
|
|
|
echo sha=$(forgejo-test-helper.sh branch_tip $url testuser/testrepo main) >> $GITHUB_OUTPUT
|
2023-03-29 17:16:26 +02:00
|
|
|
- id: release-upload
|
|
|
|
uses: SELF@vTest
|
|
|
|
with:
|
|
|
|
direction: upload
|
|
|
|
url: ${{ steps.forgejo.outputs.url }}
|
2023-03-29 19:20:39 +02:00
|
|
|
repo: testuser/testrepo
|
2023-03-29 17:16:26 +02:00
|
|
|
tag: v1.0
|
2023-03-29 19:29:24 +02:00
|
|
|
sha: ${{ steps.testrepo.outputs.sha }}
|
2023-03-29 17:16:26 +02:00
|
|
|
token: ${{ steps.forgejo.outputs.token }}
|
|
|
|
release-dir: upload-dir
|
2023-03-29 23:59:02 +02:00
|
|
|
release-notes: "RELEASE NOTES"
|
2023-03-29 17:16:26 +02:00
|
|
|
verbose: true
|
2024-07-08 20:49:13 +02:00
|
|
|
- id: release-upload-override
|
|
|
|
uses: SELF@vTest
|
|
|
|
with:
|
|
|
|
direction: upload
|
|
|
|
url: ${{ steps.forgejo.outputs.url }}
|
|
|
|
repo: testuser/testrepo
|
|
|
|
tag: v1.0
|
|
|
|
sha: ${{ steps.testrepo.outputs.sha }}
|
|
|
|
token: ${{ steps.forgejo.outputs.token }}
|
|
|
|
release-dir: upload-dir
|
|
|
|
release-notes: "RELEASE NOTES"
|
|
|
|
override: true
|
|
|
|
verbose: true
|
|
|
|
- id: release-upload-v2
|
|
|
|
uses: SELF@vTest
|
|
|
|
with:
|
|
|
|
direction: upload
|
|
|
|
url: ${{ steps.forgejo.outputs.url }}
|
|
|
|
repo: testuser/testrepo
|
|
|
|
tag: v2.0
|
|
|
|
sha: ${{ steps.testrepo.outputs.sha }}
|
|
|
|
token: ${{ steps.forgejo.outputs.token }}
|
|
|
|
release-dir: upload-dir-v2
|
|
|
|
release-notes: "RELEASE NOTES V2"
|
|
|
|
verbose: true
|
2023-03-29 17:16:26 +02:00
|
|
|
- id: release-download
|
|
|
|
uses: SELF@vTest
|
|
|
|
with:
|
|
|
|
direction: download
|
|
|
|
url: ${{ steps.forgejo.outputs.url }}
|
2023-03-29 19:20:39 +02:00
|
|
|
repo: testuser/testrepo
|
2023-03-29 17:16:26 +02:00
|
|
|
tag: v1.0
|
|
|
|
token: ${{ steps.forgejo.outputs.token }}
|
|
|
|
release-dir: download-dir
|
|
|
|
verbose: true
|
|
|
|
- run: |
|
|
|
|
diff -u upload-dir download-dir
|
2024-07-08 20:49:13 +02:00
|
|
|
- id: release-download-latest
|
|
|
|
uses: SELF@vTest
|
|
|
|
with:
|
|
|
|
direction: download
|
|
|
|
url: ${{ steps.forgejo.outputs.url }}
|
|
|
|
repo: testuser/testrepo
|
|
|
|
token: ${{ steps.forgejo.outputs.token }}
|
|
|
|
release-dir: download-dir-v2
|
|
|
|
download-latest: true
|
|
|
|
verbose: true
|
|
|
|
- run: |
|
|
|
|
diff -u upload-dir-v2 download-dir-v2
|
2023-09-02 10:48:52 +02:00
|
|
|
- if: failure()
|
|
|
|
run: docker logs forgejo
|