mirror of
https://code.forgejo.org/actions/forgejo-release.git
synced 2026-02-04 06:48:09 +00:00
feat: allow skipping upload assets (#128)
Reviewed-on: https://code.forgejo.org/actions/forgejo-release/pulls/128 Co-authored-by: Michael Kriese <michael.kriese@visualon.de> Co-committed-by: Michael Kriese <michael.kriese@visualon.de>
This commit is contained in:
parent
f5b4441975
commit
b93b6e8f70
3 changed files with 42 additions and 5 deletions
|
|
@ -22,8 +22,8 @@ inputs:
|
||||||
description: 'Forgejo application token'
|
description: 'Forgejo application token'
|
||||||
default: '${{ forge.token }}'
|
default: '${{ forge.token }}'
|
||||||
release-dir:
|
release-dir:
|
||||||
description: 'Directory in whichs release assets are uploaded or downloaded'
|
description: 'Directory in which release assets are uploaded or downloaded'
|
||||||
required: true
|
default: ''
|
||||||
release-notes:
|
release-notes:
|
||||||
description: 'Release notes'
|
description: 'Release notes'
|
||||||
direction:
|
direction:
|
||||||
|
|
@ -53,6 +53,9 @@ inputs:
|
||||||
hide-archive-link:
|
hide-archive-link:
|
||||||
description: 'Hide the archive links'
|
description: 'Hide the archive links'
|
||||||
default: false
|
default: false
|
||||||
|
skip-assets:
|
||||||
|
description: Skip uploading release assets
|
||||||
|
default: 'false'
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: "composite"
|
using: "composite"
|
||||||
|
|
@ -113,5 +116,7 @@ runs:
|
||||||
echo -n "${{ inputs.gpg-passphrase }}" > $TMP_DIR/gpg-passphrase
|
echo -n "${{ inputs.gpg-passphrase }}" > $TMP_DIR/gpg-passphrase
|
||||||
export GPG_PASSPHRASE="$TMP_DIR/gpg-passphrase"
|
export GPG_PASSPHRASE="$TMP_DIR/gpg-passphrase"
|
||||||
|
|
||||||
|
export SKIP_ASSETS="${{ inputs.skip-assets }}"
|
||||||
|
|
||||||
forgejo-release.sh ${{ inputs.direction }}
|
forgejo-release.sh ${{ inputs.direction }}
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
|
||||||
|
|
@ -84,9 +84,11 @@ upload_release() {
|
||||||
# It is expanded using "${assets[@]}" which preserves the separation of arguments and not split whitespace containing values.
|
# It is expanded using "${assets[@]}" which preserves the separation of arguments and not split whitespace containing values.
|
||||||
# For reference, see https://github.com/koalaman/shellcheck/wiki/SC2086#exceptions
|
# For reference, see https://github.com/koalaman/shellcheck/wiki/SC2086#exceptions
|
||||||
local assets=()
|
local assets=()
|
||||||
for file in "$RELEASE_DIR"/*; do
|
if ! "$SKIP_ASSETS"; then
|
||||||
assets=("${assets[@]}" -a "$file")
|
for file in "$RELEASE_DIR"/*; do
|
||||||
done
|
assets=("${assets[@]}" -a "$file")
|
||||||
|
done
|
||||||
|
fi
|
||||||
if $PRERELEASE || echo "${TAG}" | grep -qi '\-rc'; then
|
if $PRERELEASE || echo "${TAG}" | grep -qi '\-rc'; then
|
||||||
releaseType="--prerelease"
|
releaseType="--prerelease"
|
||||||
echo "Uploading as Pre-Release"
|
echo "Uploading as Pre-Release"
|
||||||
|
|
|
||||||
|
|
@ -92,5 +92,35 @@ jobs:
|
||||||
- if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
|
- if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
|
||||||
run: |
|
run: |
|
||||||
diff -u upload-dir-v3 download-dir-v3
|
diff -u upload-dir-v3 download-dir-v3
|
||||||
|
|
||||||
|
- if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
|
||||||
|
id: release-upload-v4
|
||||||
|
uses: SELF@vTest
|
||||||
|
with:
|
||||||
|
direction: upload
|
||||||
|
tag: v4.0
|
||||||
|
token: FORGEJO_TEST_TOKEN
|
||||||
|
skip-assets: true
|
||||||
|
verbose: true
|
||||||
|
|
||||||
|
- if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
|
||||||
|
id: release-download-v4
|
||||||
|
uses: SELF@vTest
|
||||||
|
with:
|
||||||
|
direction: download
|
||||||
|
tag: v4.0
|
||||||
|
token: FORGEJO_TEST_TOKEN
|
||||||
|
release-dir: download-dir-v4
|
||||||
|
- if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
|
||||||
|
run: |
|
||||||
|
if [ ! -d download-dir-v4 ]; then
|
||||||
|
echo "Missing download dir"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
if [ ! -z "$( ls -A download-dir-v4 )" ]; then
|
||||||
|
echo "Unexpected download files: $( ls -A download-dir-v4 )"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
- if: failure()
|
- if: failure()
|
||||||
run: docker logs forgejo
|
run: docker logs forgejo
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue