forgejo-release/testdata/upload-download/.forgejo/workflows/test.yml
benniekiss a5aa633273 Support downloading the latest release of a repo (#16)
This PR adds the functionality to download the latest release from a repo. The API provides an endpoint to do so, so an option has been added to the action.

This closes #12

Co-authored-by: benniekiss <bgmt@mail.bbalm.me>
Reviewed-on: https://code.forgejo.org/actions/forgejo-release/pulls/16
Reviewed-by: earl-warren <earl-warren@noreply.code.forgejo.org>
Co-authored-by: benniekiss <benniekiss@noreply.code.forgejo.org>
Co-committed-by: benniekiss <benniekiss@noreply.code.forgejo.org>
2024-07-08 18:49:13 +00:00

66 lines
2 KiB
YAML

# SPDX-License-Identifier: MIT
name: Upload (and download) a release to (and from) the project that runs the workflow
on: [push]
jobs:
upload-download:
runs-on: self-hosted
steps:
- uses: actions/checkout@v3
- if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
id: release-upload
uses: SELF@vTest
with:
direction: upload
tag: v1.0
token: FORGEJO_TOKEN
release-dir: upload-dir
release-notes: "RELEASE NOTES"
verbose: true
- if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
id: release-upload-override
uses: SELF@vTest
with:
direction: upload
tag: v1.0
token: FORGEJO_TOKEN
release-dir: upload-dir
release-notes: "RELEASE NOTES"
override: true
verbose: true
- if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
id: release-upload-v2
uses: SELF@vTest
with:
direction: upload
tag: v2.0
token: FORGEJO_TOKEN
release-dir: upload-dir-v2
release-notes: "RELEASE NOTES V2"
verbose: true
- if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
id: release-download
uses: SELF@vTest
with:
direction: download
tag: v1.0
token: FORGEJO_TOKEN
release-dir: download-dir
verbose: true
- if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
run: |
diff -u upload-dir download-dir
- if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
id: release-download-latest
uses: SELF@vTest
with:
direction: download
token: FORGEJO_TOKEN
release-dir: download-dir-v2
download-latest: true
verbose: true
- if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
run: |
diff -u upload-dir-v2 download-dir-v2
- if: failure()
run: docker logs forgejo