mirror of https://github.com/termux/termux-app
Reverted: Revert "ci: use termux/upload-release-actions to attach debug builds to new releases"
This reverts commit 2ac7fd1e56
.
Do not use `upload-release-action` for uploading artifacts and generating checksum and instead keep using standard `sha256sum` and internal github tools. `upload-release-action` also generates checksum in the wrong format, check https://github.com/termux/termux-app/pull/3241#discussion_r1106019790.
This commit is contained in:
parent
67f4891580
commit
755b752a95
|
@ -6,7 +6,7 @@ on:
|
||||||
- published
|
- published
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
attach-apks:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
|
@ -21,15 +21,23 @@ jobs:
|
||||||
with:
|
with:
|
||||||
ref: ${{ env.GITHUB_REF }}
|
ref: ${{ env.GITHUB_REF }}
|
||||||
|
|
||||||
- name: Build
|
- name: Build and attach APKs to release
|
||||||
shell: bash {0}
|
shell: bash {0}
|
||||||
env:
|
env:
|
||||||
PACKAGE_VARIANT: ${{ matrix.package_variant }}
|
PACKAGE_VARIANT: ${{ matrix.package_variant }}
|
||||||
run: |
|
run: |
|
||||||
|
exit_on_error() {
|
||||||
|
echo "$1"
|
||||||
|
echo "Deleting '$RELEASE_VERSION_NAME' release and '$GITHUB_REF' tag"
|
||||||
|
hub release delete "$RELEASE_VERSION_NAME"
|
||||||
|
git push --delete origin "$GITHUB_REF"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
echo "Setting vars"
|
||||||
RELEASE_VERSION_NAME="${GITHUB_REF/refs\/tags\//}"
|
RELEASE_VERSION_NAME="${GITHUB_REF/refs\/tags\//}"
|
||||||
if ! printf "%s" "${RELEASE_VERSION_NAME/v/}" | grep -qP '^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$'; then
|
if ! printf "%s" "${RELEASE_VERSION_NAME/v/}" | grep -qP '^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$'; then
|
||||||
echo "The versionName '${RELEASE_VERSION_NAME/v/}' is not a valid version as per semantic version '2.0.0' spec in the format 'major.minor.patch(-prerelease)(+buildmetadata)'. https://semver.org/spec/v2.0.0.html."
|
exit_on_error "The versionName '${RELEASE_VERSION_NAME/v/}' is not a valid version as per semantic version '2.0.0' spec in the format 'major.minor.patch(-prerelease)(+buildmetadata)'. https://semver.org/spec/v2.0.0.html."
|
||||||
exit 1
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
APK_DIR_PATH="./app/build/outputs/apk/debug"
|
APK_DIR_PATH="./app/build/outputs/apk/debug"
|
||||||
|
@ -39,35 +47,38 @@ jobs:
|
||||||
echo "Building APKs for 'APK_VERSION_TAG' release"
|
echo "Building APKs for 'APK_VERSION_TAG' release"
|
||||||
export TERMUX_APK_VERSION_TAG="$APK_VERSION_TAG" # Used by app/build.gradle
|
export TERMUX_APK_VERSION_TAG="$APK_VERSION_TAG" # Used by app/build.gradle
|
||||||
export TERMUX_PACKAGE_VARIANT="${{ env.PACKAGE_VARIANT }}" # Used by app/build.gradle
|
export TERMUX_PACKAGE_VARIANT="${{ env.PACKAGE_VARIANT }}" # Used by app/build.gradle
|
||||||
./gradlew assembleDebug
|
if ! ./gradlew assembleDebug; then
|
||||||
|
exit_on_error "Build failed for '$APK_VERSION_TAG' release."
|
||||||
|
fi
|
||||||
|
|
||||||
echo "Validating APKs"
|
echo "Validating APKs"
|
||||||
for abi in universal arm64-v8a armeabi-v7a x86_64 x86; do
|
for abi in universal arm64-v8a armeabi-v7a x86_64 x86; do
|
||||||
if ! test -f "$APK_DIR_PATH/${APK_BASENAME_PREFIX}_$abi.apk"; then
|
if ! test -f "$APK_DIR_PATH/${APK_BASENAME_PREFIX}_$abi.apk"; then
|
||||||
files_found="$(ls "$APK_DIR_PATH")"
|
files_found="$(ls "$APK_DIR_PATH")"
|
||||||
echo "Failed to find built APK at '$APK_DIR_PATH/${APK_BASENAME_PREFIX}_$abi.apk'. Files found: "$'\n'"$files_found"
|
exit_on_error "Failed to find built APK at '$APK_DIR_PATH/${APK_BASENAME_PREFIX}_$abi.apk'. Files found: "$'\n'"$files_found"
|
||||||
exit 1
|
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
- name: Upload APKs to GitHub artifact
|
|
||||||
uses: actions/upload-artifact@v4
|
echo "Generating sha25sums file"
|
||||||
with:
|
if ! (cd "$APK_DIR_PATH"; sha256sum \
|
||||||
name: ${{ matrix.package_variant }}
|
"${APK_BASENAME_PREFIX}_universal.apk" \
|
||||||
path: ./app/build/outputs/apk/debug/*.apk
|
"${APK_BASENAME_PREFIX}_arm64-v8a.apk" \
|
||||||
upload:
|
"${APK_BASENAME_PREFIX}_armeabi-v7a.apk" \
|
||||||
runs-on: ubuntu-latest
|
"${APK_BASENAME_PREFIX}_x86_64.apk" \
|
||||||
needs: build
|
"${APK_BASENAME_PREFIX}_x86.apk" \
|
||||||
env:
|
> "${APK_BASENAME_PREFIX}_sha256sums"); then
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
exit_on_error "Generate sha25sums failed for '$APK_VERSION_TAG' release."
|
||||||
steps:
|
fi
|
||||||
- name: Download artifact
|
|
||||||
uses: actions/download-artifact@v4
|
echo "Attaching APKs to github release"
|
||||||
- name: Upload APKs to release
|
if ! hub release edit \
|
||||||
uses: termux/upload-release-action@v4.2.0
|
-m "" \
|
||||||
with:
|
-a "$APK_DIR_PATH/${APK_BASENAME_PREFIX}_universal.apk" \
|
||||||
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
-a "$APK_DIR_PATH/${APK_BASENAME_PREFIX}_arm64-v8a.apk" \
|
||||||
file: "**/*.apk"
|
-a "$APK_DIR_PATH/${APK_BASENAME_PREFIX}_armeabi-v7a.apk" \
|
||||||
file_glob: true
|
-a "$APK_DIR_PATH/${APK_BASENAME_PREFIX}_x86_64.apk" \
|
||||||
release_name:
|
-a "$APK_DIR_PATH/${APK_BASENAME_PREFIX}_x86.apk" \
|
||||||
tag: ${{ github.event.release.tag_name }}
|
-a "$APK_DIR_PATH/${APK_BASENAME_PREFIX}_sha256sums" \
|
||||||
checksums: sha256,sha512,md5
|
"$RELEASE_VERSION_NAME"; then
|
||||||
|
exit_on_error "Attach APKs to release failed for '$APK_VERSION_TAG' release."
|
||||||
|
fi
|
||||||
|
|
Loading…
Reference in New Issue