@@ -49,20 +49,26 @@ jobs:
|
|||||||
test -n "${GITEA_PACKAGE_USER}"
|
test -n "${GITEA_PACKAGE_USER}"
|
||||||
test -n "${GITEA_PACKAGE_TOKEN}"
|
test -n "${GITEA_PACKAGE_TOKEN}"
|
||||||
|
|
||||||
BASE_URL="${GITEA_BASE_URL:-${GITHUB_SERVER_URL}}"
|
BASE_URL="${GITEA_BASE_URL:-https://192.168.3.80}"
|
||||||
PACKAGE_OWNER="${GITEA_PACKAGE_OWNER:-${GITHUB_REPOSITORY_OWNER}}"
|
PACKAGE_OWNER="${GITEA_PACKAGE_OWNER:-melabidi}"
|
||||||
PACKAGE_NAME="alrahma_sunday_school"
|
PACKAGE_NAME="alrahma_sunday_school"
|
||||||
REF_NAME="${GITHUB_REF_NAME:-manual}"
|
REF_NAME="${GITHUB_REF_NAME:-manual}"
|
||||||
SHORT_SHA="$(printf '%s' "${GITHUB_SHA}" | cut -c1-7)"
|
SHORT_SHA="$(printf '%s' "${GITHUB_SHA}" | cut -c1-7)"
|
||||||
VERSION="$(printf '%s-%s-%s' "${REF_NAME}" "${GITHUB_RUN_NUMBER}" "${SHORT_SHA}" | sed 's/[^A-Za-z0-9._+-]/-/g')"
|
VERSION="$(printf '%s-%s-%s' "${REF_NAME}" "${GITHUB_RUN_NUMBER}" "${SHORT_SHA}" | sed 's/[^A-Za-z0-9._+-]/-/g')"
|
||||||
FILE_NAME="${PACKAGE_NAME}-${VERSION}.tar.gz"
|
FILE_NAME="${PACKAGE_NAME}-${VERSION}.tar.gz"
|
||||||
|
PACKAGE_URL="${BASE_URL}/api/packages/${PACKAGE_OWNER}/generic/${PACKAGE_NAME}/${VERSION}/${FILE_NAME}"
|
||||||
|
|
||||||
tar -czf "build/${FILE_NAME}" -C build/deploy .
|
tar -czf "build/${FILE_NAME}" -C build/deploy .
|
||||||
|
echo "Publishing package ${PACKAGE_NAME} ${VERSION} to ${BASE_URL}/-/packages"
|
||||||
|
echo "Package owner: ${PACKAGE_OWNER}"
|
||||||
|
echo "Package file: ${FILE_NAME}"
|
||||||
|
|
||||||
curl --fail-with-body \
|
curl --fail-with-body --insecure \
|
||||||
--user "${GITEA_PACKAGE_USER}:${GITEA_PACKAGE_TOKEN}" \
|
--user "${GITEA_PACKAGE_USER}:${GITEA_PACKAGE_TOKEN}" \
|
||||||
--upload-file "build/${FILE_NAME}" \
|
--upload-file "build/${FILE_NAME}" \
|
||||||
"${BASE_URL}/api/packages/${PACKAGE_OWNER}/generic/${PACKAGE_NAME}/${VERSION}/${FILE_NAME}"
|
"${PACKAGE_URL}"
|
||||||
|
|
||||||
|
echo "Package uploaded: ${PACKAGE_URL}"
|
||||||
|
|
||||||
- name: Configure SSH
|
- name: Configure SSH
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
+2
-2
@@ -48,7 +48,7 @@ Required repository secrets for package publishing:
|
|||||||
|
|
||||||
Optional repository secrets:
|
Optional repository secrets:
|
||||||
|
|
||||||
- `GITEA_BASE_URL` - defaults to the Actions server URL.
|
- `GITEA_BASE_URL` - defaults to `https://192.168.3.80`.
|
||||||
- `GITEA_PACKAGE_OWNER` - defaults to the repository owner.
|
- `GITEA_PACKAGE_OWNER` - defaults to `melabidi`.
|
||||||
|
|
||||||
The token must have permission to publish packages for the package owner.
|
The token must have permission to publish packages for the package owner.
|
||||||
|
|||||||
Reference in New Issue
Block a user