#1 : Publish generic package to gitea
Core Build (push) / self-test (push) Failing after 15s
Core Build (push) / self-test (push) Failing after 15s
+ force flag handling + test case for force
This commit is contained in:
@@ -17,4 +17,14 @@ jobs:
|
|||||||
file: text.txt
|
file: text.txt
|
||||||
package: a-proper-test-package
|
package: a-proper-test-package
|
||||||
version: master
|
version: master
|
||||||
force: false
|
- uses: https://source.vague.tech/open-vague/ci-actions/publish@feature/1-publish
|
||||||
|
with:
|
||||||
|
file: text.txt
|
||||||
|
package: a-proper-test-package
|
||||||
|
version: master
|
||||||
|
force: true
|
||||||
|
- uses: https://source.vague.tech/open-vague/ci-actions/publish@feature/1-publish
|
||||||
|
with:
|
||||||
|
file: text.txt
|
||||||
|
package: a-proper-test-package
|
||||||
|
version: master
|
||||||
@@ -14,12 +14,30 @@ inputs:
|
|||||||
force:
|
force:
|
||||||
description: force package replacement keeping the same version
|
description: force package replacement keeping the same version
|
||||||
required: false
|
required: false
|
||||||
|
default: "false"
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: composite
|
using: composite
|
||||||
steps:
|
steps:
|
||||||
- shell: bash
|
- shell: bash
|
||||||
run: |
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
if [[ "${INPUT_FORCE,,}" == "true" ]]; then
|
||||||
|
status="$(
|
||||||
|
curl --silent --show-error --output /dev/null --write-out '%{http_code}' \
|
||||||
|
--user "acti-bot:${ACTI_BOT_TOKEN}" \
|
||||||
|
--request DELETE \
|
||||||
|
"${{ gitea.server_url }}/api/packages/${{ gitea.repository_owner }}/generic/${{ inputs.package }}/${{ inputs.version }}"
|
||||||
|
)"
|
||||||
|
|
||||||
|
case "$status" in
|
||||||
|
204|404) ;;
|
||||||
|
*)
|
||||||
|
echo "Failed to delete existing package version (HTTP ${status})" >&2
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
curl --fail-with-body \
|
curl --fail-with-body \
|
||||||
--user "acti-bot:${ACTI_BOT_TOKEN}" \
|
--user "acti-bot:${ACTI_BOT_TOKEN}" \
|
||||||
--upload-file ${{ inputs.file }} \
|
--upload-file ${{ inputs.file }} \
|
||||||
|
|||||||
Reference in New Issue
Block a user