Skip to content

Commit

Permalink
Use 'v' prefix for versions. Even minor numbers mark stable versions
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinBriza committed Oct 19, 2023
1 parent 00b992f commit 2b61482
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 39 deletions.
46 changes: 23 additions & 23 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 0 additions & 11 deletions dist/get-tag-name.sh

This file was deleted.

14 changes: 14 additions & 0 deletions dist/get-version-name.sh
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion dist/ios/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion dist/macos/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 5 additions & 1 deletion dist/upload-github-release-asset.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 2b61482

Please sign in to comment.