2023-04-01 12:12:56 +03:00
|
|
|
# SPDX-License-Identifier: MIT
|
2023-05-26 15:48:58 +03:00
|
|
|
|
|
|
|
name: Upload (and download) a release to (and from) a project found in a Forgejo instance that is different from the one running the workflow
|
2023-03-29 18:16:26 +03: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 20:20:39 +03:00
|
|
|
user: testuser
|
2023-03-29 18:16:26 +03:00
|
|
|
password: admin1234
|
2023-03-30 02:08:42 +03:00
|
|
|
lxc-ip-prefix: 10.0.15
|
2023-03-29 20:29:24 +03:00
|
|
|
- id: testrepo
|
|
|
|
run: |
|
|
|
|
forgejo-test-helper.sh push testrepo http://testuser:admin1234@${{ steps.forgejo.outputs.host-port }} testuser testrepo > /tmp/output
|
|
|
|
grep '^sha=' < /tmp/output >> $GITHUB_OUTPUT
|
2023-03-29 18:16:26 +03:00
|
|
|
- id: release-upload
|
|
|
|
uses: SELF@vTest
|
|
|
|
with:
|
|
|
|
direction: upload
|
|
|
|
url: ${{ steps.forgejo.outputs.url }}
|
2023-03-29 20:20:39 +03:00
|
|
|
repo: testuser/testrepo
|
2023-03-29 18:16:26 +03:00
|
|
|
tag: v1.0
|
2023-03-29 20:29:24 +03:00
|
|
|
sha: ${{ steps.testrepo.outputs.sha }}
|
2023-03-29 18:16:26 +03:00
|
|
|
token: ${{ steps.forgejo.outputs.token }}
|
|
|
|
release-dir: upload-dir
|
2023-03-30 00:59:02 +03:00
|
|
|
release-notes: "RELEASE NOTES"
|
2023-03-29 18:16:26 +03:00
|
|
|
verbose: true
|
|
|
|
- id: release-download
|
|
|
|
uses: SELF@vTest
|
|
|
|
with:
|
|
|
|
direction: download
|
|
|
|
url: ${{ steps.forgejo.outputs.url }}
|
2023-03-29 20:20:39 +03:00
|
|
|
repo: testuser/testrepo
|
2023-03-29 18:16:26 +03:00
|
|
|
tag: v1.0
|
|
|
|
token: ${{ steps.forgejo.outputs.token }}
|
|
|
|
release-dir: download-dir
|
|
|
|
verbose: true
|
|
|
|
- run: |
|
|
|
|
diff -u upload-dir download-dir
|