diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a44d2eca..58a4b7b2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -97,7 +97,7 @@ jobs: - name: Build the iOS binary run: | - export TAG_NAME=$(./dist/get-tag-name.sh) + export VERSION_NAME=$(./dist/get-version-name.sh) export CPM_SOURCE_CACHE=~/cpm-cache IMGUR_API_KEY=${{ secrets.IMGUR_API_KEY }} bash ./dist/ios/build.sh - name: Upload artifacts to GitHub @@ -109,15 +109,15 @@ jobs: - name: Upload to GitHub if: github.event_name == 'create' run: | - export TAG_NAME=$(./dist/get-tag-name.sh) - if [[ "$TAG_NAME" != "" ]]; then - ./dist/upload-github-release-asset.sh github_api_token="${{ secrets.GITHUB_TOKEN }}" tag="$TAG_NAME" filename="build_ios/Lith.ipa" renameto="Lith-iOS-${TAG_NAME}.ipa" + export VERSION_NAME=$(./dist/get-version-name.sh) + if [[ "$VERSION_NAME" != "" ]]; then + ./dist/upload-github-release-asset.sh github_api_token="${{ secrets.GITHUB_TOKEN }}" tag="v${VERSION_NAME}" filename="build_ios/Lith.ipa" renameto="Lith-iOS-${VERSION_NAME}.ipa" fi - name: Upload to Testflight if: github.event_name == 'create' run: | - export TAG_NAME=$(./dist/get-tag-name.sh) - if [[ "$TAG_NAME" != "" ]]; then + export VERSION_NAME=$(./dist/get-version-name.sh) + if [[ "$VERSION_NAME" != "" ]]; then xcrun altool --validate-app --file build_ios/Lith.ipa --type ios --username "${{ secrets.APPLEID_NAME }}" --password "${{ secrets.APPLEID_PASSWORD }}" xcrun altool --upload-app --file build_ios/Lith.ipa --type ios --username "${{ secrets.APPLEID_NAME }}" --password "${{ secrets.APPLEID_PASSWORD }}" fi @@ -181,9 +181,9 @@ jobs: - name: Upload to GitHub if: github.event_name == 'create' run: | - TAG_NAME=$(./dist/get-tag-name.sh) - if [[ "$TAG_NAME" != "" ]]; then - ./dist/upload-github-release-asset.sh github_api_token=${{ secrets.GITHUB_TOKEN }} tag="$TAG_NAME" filename="build_android/app/android-build/Lith.apk" renameto="Lith-android-${TAG_NAME}.apk" + VERSION_NAME=$(./dist/get-version-name.sh) + if [[ "$VERSION_NAME" != "" ]]; then + ./dist/upload-github-release-asset.sh github_api_token=${{ secrets.GITHUB_TOKEN }} tag="v${VERSION_NAME}" filename="build_android/app/android-build/Lith.apk" renameto="Lith-android-${VERSION_NAME}.apk" fi Webassembly: @@ -276,13 +276,13 @@ jobs: - name: Build the application shell: bash run: | - TAG_NAME="$(./dist/get-tag-name.sh)" + VERSION_NAME="$(./dist/get-version-name.sh)" eval "$(./dist/win/make-vs2019-env.bat)" mkdir build_win cd build_win export CPM_SOURCE_CACHE=~/cpm-cache export CMAKE_PREFIX_PATH="$Qt6_DIR"/lib/cmake - cmake .. -GNinja -DCMAKE_INSTALL_PREFIX=installed -DCMAKE_BUILD_TYPE=Release -DIMGUR_API_KEY=${{ secrets.IMGUR_API_KEY }} -DVERSION=$TAG_NAME + cmake .. -GNinja -DCMAKE_INSTALL_PREFIX=installed -DCMAKE_BUILD_TYPE=Release -DIMGUR_API_KEY=${{ secrets.IMGUR_API_KEY }} -DVERSION=$VERSION_NAME cmake --build . --config Release cmake --install . --config Release - name: Windeployqt + zip @@ -304,9 +304,9 @@ jobs: shell: bash if: github.event_name == 'create' run: | - TAG_NAME=$(./dist/get-tag-name.sh) - if [[ "$TAG_NAME" != "" ]]; then - ./dist/upload-github-release-asset.sh github_api_token=${{ secrets.GITHUB_TOKEN }} tag="$TAG_NAME" filename="Lith.zip" renameto="Lith-win64-${TAG_NAME}.zip" + VERSION_NAME=$(./dist/get-version-name.sh) + if [[ "$VERSION_NAME" != "" ]]; then + ./dist/upload-github-release-asset.sh github_api_token=${{ secrets.GITHUB_TOKEN }} tag="v${VERSION_NAME}" filename="Lith.zip" renameto="Lith-win64-${VERSION_NAME}.zip" fi @@ -344,9 +344,9 @@ jobs: mkdir build cd build export CPM_SOURCE_CACHE=~/cpm-cache - export TAG_NAME=$(./dist/get-tag-name.sh) + export VERSION_NAME=$(./dist/get-version-name.sh) export CMAKE_PREFIX_PATH="$Qt6_DIR"/lib/cmake - cmake .. -DCMAKE_BUILD_TYPE=Release -DIMGUR_API_KEY=${{ secrets.IMGUR_API_KEY }} -DVERSION=$TAG_NAME -DLITH_FORCE_DOWNLOAD_DEPENDENCIES=ON + cmake .. -DCMAKE_BUILD_TYPE=Release -DIMGUR_API_KEY=${{ secrets.IMGUR_API_KEY }} -DVERSION=$VERSION_NAME -DLITH_FORCE_DOWNLOAD_DEPENDENCIES=ON make -j5 @@ -373,9 +373,9 @@ jobs: - name: Upload to GitHub if: github.event_name == 'create' run: | - TAG_NAME=$(./dist/get-tag-name.sh) - if [[ "$TAG_NAME" != "" ]]; then - ./dist/upload-github-release-asset.sh github_api_token=${{ secrets.GITHUB_TOKEN }} tag="$TAG_NAME" filename="app.Lith.Lith.flatpak" renameto="Lith-linux-${TAG_NAME}.flatpak" + VERSION_NAME=$(./dist/get-version-name.sh) + if [[ "$VERSION_NAME" != "" ]]; then + ./dist/upload-github-release-asset.sh github_api_token=${{ secrets.GITHUB_TOKEN }} tag="v${VERSION_NAME}" filename="app.Lith.Lith.flatpak" renameto="Lith-linux-${VERSION_NAME}.flatpak" fi @@ -430,7 +430,7 @@ jobs: - name: Build the application run: | - export TAG_NAME=$(./dist/get-tag-name.sh) + export VERSION_NAME=$(./dist/get-version-name.sh) export CPM_SOURCE_CACHE=~/cpm-cache IMGUR_API_KEY=${{ secrets.IMGUR_API_KEY }} ./dist/macos/build.sh - name: Generate .dmg @@ -451,8 +451,8 @@ jobs: - name: Upload to GitHub if: github.event_name == 'create' run: | - TAG_NAME=$(./dist/get-tag-name.sh) - if [[ "$TAG_NAME" != "" ]]; then - ./dist/upload-github-release-asset.sh github_api_token=${{ secrets.GITHUB_TOKEN }} tag="$TAG_NAME" filename="build_macos/app/Lith.dmg" renameto="Lith-macOS-${TAG_NAME}.dmg" + VERSION_NAME=$(./dist/get-version-name.sh) + if [[ "$VERSION_NAME" != "" ]]; then + ./dist/upload-github-release-asset.sh github_api_token=${{ secrets.GITHUB_TOKEN }} tag="v${VERSION_NAME}" filename="build_macos/app/Lith.dmg" renameto="Lith-macOS-${VERSION_NAME}.dmg" fi diff --git a/README.md b/README.md index 92e95875..65c8bf7c 100644 --- a/README.md +++ b/README.md @@ -50,8 +50,8 @@ There is also a browser version of Lith you can try right now thanks to WebAssem Lith currently supports the following platforms: - (Usable) **iOS** and **iPadOS**: - - RECOMMENDED: https://testflight.apple.com/join/QfcVgNHD - "Stable" track - releases ending with .0 - - https://testflight.apple.com/join/xS3hWrmj - "Unstable" track - more or less everything I tag, may be messy + - RECOMMENDED: https://testflight.apple.com/join/QfcVgNHD - "Stable" track - even minor releases + - https://testflight.apple.com/join/xS3hWrmj - "Unstable" track - more or less everything I tag with an odd minor version, may be messy - (build-only) Android: https://github.com/LithApp/Lith/releases - (Usable) **Linux**: https://flathub.org/apps/details/app.lith.Lith - (Usable, not tested) Windows: https://github.com/LithApp/Lith/releases diff --git a/dist/get-tag-name.sh b/dist/get-tag-name.sh deleted file mode 100755 index aea1cb9a..00000000 --- a/dist/get-tag-name.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash -PROBABLY_TAG=${GITHUB_REF/refs\/tags\//} - -TAG=$(grep "^[0-9][0-9]*[.][0-9][0-9]*[.][0-9][0-9]*$" <<< "$PROBABLY_TAG") - -# Default tag -#if [ -z "$TAG" ]; then -#fi - -echo $TAG -exit 0 diff --git a/dist/get-version-name.sh b/dist/get-version-name.sh new file mode 100755 index 00000000..278c4699 --- /dev/null +++ b/dist/get-version-name.sh @@ -0,0 +1,14 @@ +#!/bin/bash +PROBABLY_TAG=${GITHUB_REF/refs\/tags\//} + +if [[ "${PROBABLY_TAG}" == "" ]]; then + PROBABLY_TAG=$(git describe --tags) +fi +TAG=$(grep "^v[0-9][0-9]*[.][0-9][0-9]*[.][0-9][0-9]*$" <<< "$PROBABLY_TAG" | sed "s/^v//") + +# Default tag +#if [ -z "$TAG" ]; then +#fi + +echo $TAG +exit 0 diff --git a/dist/ios/build.sh b/dist/ios/build.sh index 700f08fa..150573a9 100644 --- a/dist/ios/build.sh +++ b/dist/ios/build.sh @@ -6,7 +6,7 @@ mkdir build_ios cd build_ios export QT_HOST_PATH="${Qt6_DIR}/../macos" -cmake .. -GXcode -DCMAKE_PREFIX_PATH=$Qt6_DIR -DCMAKE_OSX_SYSROOT=iphoneos -DCMAKE_OSX_ARCHITECTURES=arm64 -DCMAKE_TOOLCHAIN_FILE=$Qt6_DIR/lib/cmake/Qt6/qt.toolchain.cmake -DCMAKE_BUILD_TYPE=Release -DVERSION=$TAG_NAME -DIOS_DEVELOPMENT_TEAM_ID=Z52EFCPL6D -DIMGUR_API_KEY=$IMGUR_API_KEY +cmake .. -GXcode -DCMAKE_PREFIX_PATH=$Qt6_DIR -DCMAKE_OSX_SYSROOT=iphoneos -DCMAKE_OSX_ARCHITECTURES=arm64 -DCMAKE_TOOLCHAIN_FILE=$Qt6_DIR/lib/cmake/Qt6/qt.toolchain.cmake -DCMAKE_BUILD_TYPE=Release -DVERSION=$VERSION_NAME -DIOS_DEVELOPMENT_TEAM_ID=Z52EFCPL6D -DIMGUR_API_KEY=$IMGUR_API_KEY xcodebuild -project Lith.xcodeproj -destination generic/platform=iOS -scheme ALL_BUILD -configuration Release DEVELOPMENT_TEAM=Z52EFCPL6D build xcodebuild -project Lith.xcodeproj -scheme Lith -configuration Release archive -archivePath Lith.xcarchive DEVELOPMENT_TEAM=Z52EFCPL6D diff --git a/dist/macos/build.sh b/dist/macos/build.sh index 20b54bf7..ed421888 100755 --- a/dist/macos/build.sh +++ b/dist/macos/build.sh @@ -3,5 +3,5 @@ mkdir build_macos cd build_macos export CMAKE_PREFIX_PATH=$Qt6_DIR/lib/cmake -cmake .. -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" -DCMAKE_BUILD_TYPE=Release -DIMGUR_API_KEY=$IMGUR_API_KEY -DVERSION=$TAG_NAME -DCMAKE_INSTALL_PREFIX=installed +cmake .. -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" -DCMAKE_BUILD_TYPE=Release -DIMGUR_API_KEY=$IMGUR_API_KEY -DVERSION=$VERSION_NAME -DCMAKE_INSTALL_PREFIX=installed cmake --build . --parallel diff --git a/dist/upload-github-release-asset.sh b/dist/upload-github-release-asset.sh index e893761a..fc3e2d66 100755 --- a/dist/upload-github-release-asset.sh +++ b/dist/upload-github-release-asset.sh @@ -44,7 +44,11 @@ AUTH="Authorization: token $github_api_token" WGET_ARGS="--content-disposition --auth-no-challenge --no-cookie" CURL_ARGS="-LJO#" -if [[ $tag == *.0 ]]; then +if [[ $tag == *.*0.* || \ + $tag == *.*2.* || \ + $tag == *.*4.* || \ + $tag == *.*6.* || \ + $tag == *.*8.* ]]; then IS_PRERELEASE="false" else IS_PRERELEASE="true"