2023-06-14 11:32:20 +00:00
name : 'Publish release'
author : 'Forgejo authors'
description : |
Publish release
inputs :
forgejo :
2023-07-07 14:30:56 +00:00
description : 'URL of the Forgejo instance where the release is uploaded (e.g. https://codeberg.org)'
2023-06-14 11:32:20 +00:00
required : true
from-owner :
2023-07-07 14:30:56 +00:00
description : 'the owner from which a release is to be copied (e.g forgejo-integration)'
2023-06-14 11:32:20 +00:00
required : true
to-owner :
2023-07-07 14:30:56 +00:00
description : 'the owner to which a release is to be copied (e.g. forgejo-experimental). It has be an organization in which doer has the required permissions. Or be the same as the doer'
2023-06-14 11:32:20 +00:00
required : true
repo :
description : 'the repository from which a release is to be copied relative to from-owner and to-owner'
default : 'forgejo'
ref-name :
2023-07-07 14:30:56 +00:00
description : 'ref_name of the tag of the release to be copied (e.g. github.ref_name)'
2023-06-14 11:32:20 +00:00
required : true
doer :
2023-07-07 14:30:56 +00:00
description : 'Name of the user authoring the release (e.g. release-team). The user must be authorized to create packages in to-owner and releases in to-owner/repo'
2023-06-14 11:32:20 +00:00
required : true
token :
2023-07-07 14:30:56 +00:00
description : 'application token created on forgejo by the doer, with a scope allowing it to create packages in to-owner and releases in to-owner/repo'
2023-06-14 11:32:20 +00:00
required : true
gpg-private-key :
description : 'GPG Private Key to sign the release artifacts'
gpg-passphrase :
description : 'Passphrase of the GPG Private Key'
2023-07-07 14:30:56 +00:00
verbose :
description : 'Increase the verbosity level'
default : 'false'
2023-06-14 11:32:20 +00:00
runs :
using : "composite"
steps :
- id : hostport
run : |
url="${{ inputs.forgejo }}"
hostport=${url##http*://}
hostport=${hostport%%/}
echo "value=$hostport" >> "$GITHUB_OUTPUT"
- id : tag-version
run : |
version="${{ inputs.ref-name }}"
version=${version##*v}
echo "value=$version" >> "$GITHUB_OUTPUT"
- name : apt-get install docker.io
run : |
DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -qq -y docker.io
- name : download release
uses : https://code.forgejo.org/actions/forgejo-release@v1
with :
url : ${{ inputs.forgejo }}
repo : ${{ inputs.from-owner }}/${{ inputs.repo }}
direction : download
release-dir : release
download-retry : 60
token : ${{ inputs.token }}
2023-07-07 14:30:56 +00:00
verbose : ${{ inputs.verbose }}
2023-06-14 11:32:20 +00:00
- name : upload release
uses : https://code.forgejo.org/actions/forgejo-release@v1
with :
url : ${{ inputs.forgejo }}
repo : ${{ inputs.to-owner }}/${{ inputs.repo }}
direction : upload
release-dir : release
release-notes : "See https://codeberg.org/forgejo/forgejo/src/branch/forgejo/RELEASE-NOTES.md#${{ steps.tag-version.outputs.value }}"
token : ${{ inputs.token }}
gpg-private-key : ${{ inputs.gpg-private-key }}
gpg-passphrase : ${{ inputs.gpg-passphrase }}
2023-07-07 14:30:56 +00:00
verbose : ${{ inputs.verbose }}
2023-06-14 11:32:20 +00:00
- name : login to the registry
uses : https://github.com/docker/login-action@v2
with :
registry : ${{ steps.hostport.outputs.value }}
username : ${{ inputs.doer }}
password : ${{ inputs.token }}
- uses : https://code.forgejo.org/forgejo/forgejo-container-image@v1
env :
VERIFY : 'false'
with :
url : https://${{ steps.hostport.outputs.value }}
destination-owner : ${{ inputs.to-owner }}
owner : ${{ inputs.from-owner }}
suffixes : '-rootless'
project : ${{ inputs.repo }}
tag : ${{ steps.tag-version.outputs.value }}
doer : ${{ inputs.doer }}
token : ${{ inputs.token }}
2023-07-07 14:30:56 +00:00
verbose : ${{ inputs.verbose }}