From 8beca1a4bc4d6960db702f5b390aad7ce03c2d59 Mon Sep 17 00:00:00 2001 From: Feodor Fitsner Date: Wed, 16 Nov 2022 08:46:23 -0800 Subject: [PATCH 1/7] Set dev build version --- .appveyor.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.appveyor.yml b/.appveyor.yml index a71a7b556..089e707c0 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -110,6 +110,16 @@ for: only: - job_name: Build Flet package for Flutter + init: + - ps: | + if ($env:APPVEYOR_REPO_TAG_NAME) { + $v = $env:APPVEYOR_REPO_TAG_NAME.replace("v", "") + } else { + $cv = [version](git describe --abbrev=0).substring(1) + $v = "$($cv.major).$($cv.minor+1).0.dev$($env:APPVEYOR_BUILD_NUMBER)" + } + Update-AppveyorBuild -Version $v + install: - flutter upgrade From ad6e33e473be42f59f8823865ae078d4e802e1e4 Mon Sep 17 00:00:00 2001 From: Feodor Fitsner Date: Wed, 16 Nov 2022 08:48:22 -0800 Subject: [PATCH 2/7] Get version on install --- .appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.appveyor.yml b/.appveyor.yml index 089e707c0..551702262 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -110,7 +110,7 @@ for: only: - job_name: Build Flet package for Flutter - init: + install: - ps: | if ($env:APPVEYOR_REPO_TAG_NAME) { $v = $env:APPVEYOR_REPO_TAG_NAME.replace("v", "") From a8a4155cb4d32e385dd596e1b870aec199928ee5 Mon Sep 17 00:00:00 2001 From: Feodor Fitsner Date: Wed, 16 Nov 2022 08:49:05 -0800 Subject: [PATCH 3/7] Fix yaml --- .appveyor.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 551702262..00df0f364 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -119,9 +119,7 @@ for: $v = "$($cv.major).$($cv.minor+1).0.dev$($env:APPVEYOR_BUILD_NUMBER)" } Update-AppveyorBuild -Version $v - - install: - - flutter upgrade + - flutter upgrade build_script: - cd package From 41da9fde800fb3dfe24c3b8b64c88742ff4bc421 Mon Sep 17 00:00:00 2001 From: Feodor Fitsner Date: Wed, 16 Nov 2022 09:07:57 -0800 Subject: [PATCH 4/7] semver build number --- .appveyor.yml | 4 ++-- server/.goreleaser.yml | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 00df0f364..833756057 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -116,7 +116,7 @@ for: $v = $env:APPVEYOR_REPO_TAG_NAME.replace("v", "") } else { $cv = [version](git describe --abbrev=0).substring(1) - $v = "$($cv.major).$($cv.minor+1).0.dev$($env:APPVEYOR_BUILD_NUMBER)" + $v = "$($cv.major).$($cv.minor+1).0+$($env:APPVEYOR_BUILD_NUMBER)" } Update-AppveyorBuild -Version $v - flutter upgrade @@ -142,7 +142,7 @@ for: build_script: - cd client - - ps: if ($env:APPVEYOR_REPO_TAG_NAME -match "[0-9\.]+") { $env:FLET_VER=$Matches.0 } else { $env:FLET_VER=$env:APPVEYOR_BUILD_VERSION } + - ps: if ($env:APPVEYOR_REPO_TAG_NAME -match "[0-9\.]+") { $env:FLET_VER=$Matches.0 } else { $env:FLET_VER=$env:APPVEYOR_BUILD_VERSION.replace(".dev", "+") } - flutter build windows --build-name=%FLET_VER% - set RELEASE_DIR=build\windows\runner\Release - copy "%VC_REDIST_DIR%\msvcp140.dll" %RELEASE_DIR% diff --git a/server/.goreleaser.yml b/server/.goreleaser.yml index 80ccb600a..2955dd746 100644 --- a/server/.goreleaser.yml +++ b/server/.goreleaser.yml @@ -1,5 +1,8 @@ project_name: fletd +snapshot: + name_template: '{{ .Env.APPVEYOR_BUILD_VERSION }}' + builds: - id: fletd main: cmd/fletd/main.go From 9a8e9f172109a8b9e9016aefeab6b777ca36fc02 Mon Sep 17 00:00:00 2001 From: Feodor Fitsner Date: Wed, 16 Nov 2022 09:35:41 -0800 Subject: [PATCH 5/7] Patch wheels version --- .appveyor.yml | 62 +++++++++++---------------------------------------- 1 file changed, 13 insertions(+), 49 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 833756057..5a3f13f2d 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -302,15 +302,7 @@ for: if [[ ! -z "$APPVEYOR_PULL_REQUEST_NUMBER" ]]; then bundle exec fastlane build_flutter elif [[ "$APPVEYOR_REPO_TAG" == "true" ]]; then - if [[ "$APPVEYOR_REPO_TAG_NAME" =~ ([0-9\.]+) ]]; then - export FLET_PACKAGE_VERSION="${BASH_REMATCH[1]}" - echo "FLET_PACKAGE_VERSION: ${FLET_PACKAGE_VERSION}" - export ITMSTRANSPORTER_FORCE_ITMS_PACKAGE_UPLOAD=true - bundle exec fastlane upload_appstore - else - echo "Cannot extract version information from a tag." - exit 1 - fi + bundle exec fastlane upload_appstore else bundle exec fastlane build_ipa fi @@ -344,21 +336,7 @@ for: - bundle install --path vendor/bundle - sh: | export FLET_PACKAGE_VERSION="${APPVEYOR_BUILD_VERSION}" - if [[ ! -z "$APPVEYOR_PULL_REQUEST_NUMBER" ]]; then - bundle exec fastlane build_flutter - elif [[ "$APPVEYOR_REPO_TAG" == "true" ]]; then - if [[ "$APPVEYOR_REPO_TAG_NAME" =~ ([0-9\.]+) ]]; then - export FLET_PACKAGE_VERSION="${BASH_REMATCH[1]}" - echo "FLET_PACKAGE_VERSION: ${FLET_PACKAGE_VERSION}" - export ITMSTRANSPORTER_FORCE_ITMS_PACKAGE_UPLOAD=true - bundle exec fastlane upload_appstore - else - echo "Cannot extract version information from a tag." - exit 1 - fi - else - bundle exec fastlane build_ipa - fi + bundle exec fastlane build_ipa artifacts: - path: client/build/flet.ipa @@ -442,31 +420,17 @@ for: build_script: - ps: | $ErrorActionPreference = "Stop" + $ver = $env:APPVEYOR_BUILD_VERSION.replace("+", ".dev") + + # if ($env:APPVEYOR_REPO_TAG -eq 'true') { + # # release mode + # $env:TWINE_PASSWORD = $env:pypi_key + # } else { + # # build mode + # $env:TWINE_PASSWORD = $env:test_pypi_key + # $env:TWINE_REPOSITORY = 'testpypi' + # } - if ($env:APPVEYOR_REPO_TAG -eq 'true') { - # release mode - - # version - $ver = $env:APPVEYOR_REPO_TAG_NAME - if ($ver.StartsWith('v')) { $ver = $ver.Substring(1) } - - # prerelease moniker - $idx = $ver.indexOf('-') - if ($idx -ne -1) { - $prerelease = $ver.Substring($idx + 1) - $ver = $ver.Substring(0, $idx) - } - $env:TWINE_PASSWORD = $env:pypi_key - } else { - - # build mode - $ver = $env:APPVEYOR_BUILD_VERSION - $env:TWINE_PASSWORD = $env:test_pypi_key - $env:TWINE_REPOSITORY = 'testpypi' - } - - # patch version - $env:PACKAGE_VERSION = $ver (Get-Content pyproject.toml).replace("version = `"0.1.0`"", "version = `"$ver`"") | Set-Content pyproject.toml (Get-Content flet/version.py).replace("version = `"`"", "version = `"$ver`"") | Set-Content flet/version.py @@ -476,7 +440,7 @@ for: # publish package - sh: | - if [[ "$APPVEYOR_PULL_REQUEST_NUMBER" == "" ]]; then + if [[ "$APPVEYOR_REPO_BRANCH" == "main" ]]; then twine upload dist/* fi From 7f87a86eee6762a7f7d39330b3897c27781938ca Mon Sep 17 00:00:00 2001 From: Feodor Fitsner Date: Wed, 16 Nov 2022 10:17:05 -0800 Subject: [PATCH 6/7] Fix Flutter versions --- .appveyor.yml | 39 ++++++++++++++++----------------------- 1 file changed, 16 insertions(+), 23 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 5a3f13f2d..f2088fe46 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -51,10 +51,10 @@ environment: job_depends_on: build_flet_package APPVEYOR_BUILD_WORKER_IMAGE: macos-monterey - # - job_name: Build Flet Studio for iOS - # job_group: build_flet - # job_depends_on: build_flet_package - # APPVEYOR_BUILD_WORKER_IMAGE: macos-monterey + - job_name: Build Flet Studio for iOS + job_group: build_flet + job_depends_on: build_flet_package + APPVEYOR_BUILD_WORKER_IMAGE: macos-monterey - job_name: Build Fletd job_group: build_flet @@ -142,8 +142,7 @@ for: build_script: - cd client - - ps: if ($env:APPVEYOR_REPO_TAG_NAME -match "[0-9\.]+") { $env:FLET_VER=$Matches.0 } else { $env:FLET_VER=$env:APPVEYOR_BUILD_VERSION.replace(".dev", "+") } - - flutter build windows --build-name=%FLET_VER% + - flutter build windows --build-name=%APPVEYOR_BUILD_VERSION% - set RELEASE_DIR=build\windows\runner\Release - copy "%VC_REDIST_DIR%\msvcp140.dll" %RELEASE_DIR% - copy "%VC_REDIST_DIR%\vcruntime140.dll" %RELEASE_DIR% @@ -189,8 +188,7 @@ for: build_script: # Flutter macOS client - cd client - - if [[ "$APPVEYOR_REPO_TAG_NAME" =~ ([0-9\.]+) ]]; then export FLET_VER="${BASH_REMATCH[1]}"; else export FLET_VER="$APPVEYOR_BUILD_VERSION"; fi - - flutter build macos --build-name=$FLET_VER + - flutter build macos --build-name=$APPVEYOR_BUILD_VERSION - tar -czvf flet-macos-amd64.tar.gz -C build/macos/Build/Products/Release Flet.app artifacts: @@ -220,8 +218,7 @@ for: build_script: - cd client - - if [[ "$APPVEYOR_REPO_TAG_NAME" =~ ([0-9\.]+) ]]; then export FLET_VER="${BASH_REMATCH[1]}"; else export FLET_VER="$APPVEYOR_BUILD_VERSION"; fi - - flutter build linux --build-name=$FLET_VER + - flutter build linux --build-name=$APPVEYOR_BUILD_VERSION - mv build/linux/x64/release/bundle build/linux/x64/release/flet - tar -czvf flet-linux-amd64.tar.gz -C build/linux/x64/release flet @@ -258,8 +255,7 @@ for: build_script: - cd client - - if [[ "$APPVEYOR_REPO_TAG_NAME" =~ ([0-9\.]+) ]]; then export FLET_VER="${BASH_REMATCH[1]}"; else export FLET_VER="$APPVEYOR_BUILD_VERSION"; fi - - flutter build linux --build-name=$FLET_VER + - flutter build linux --build-name=$APPVEYOR_BUILD_VERSION - mv build/linux/arm64/release/bundle build/linux/arm64/release/flet - tar -czvf flet-linux-arm64.tar.gz -C build/linux/arm64/release flet @@ -336,7 +332,13 @@ for: - bundle install --path vendor/bundle - sh: | export FLET_PACKAGE_VERSION="${APPVEYOR_BUILD_VERSION}" - bundle exec fastlane build_ipa + if [[ ! -z "$APPVEYOR_PULL_REQUEST_NUMBER" ]]; then + bundle exec fastlane build_flutter + elif [[ "$APPVEYOR_REPO_TAG" == "true" ]]; then + bundle exec fastlane upload_appstore + else + bundle exec fastlane build_ipa + fi artifacts: - path: client/build/flet.ipa @@ -421,16 +423,6 @@ for: - ps: | $ErrorActionPreference = "Stop" $ver = $env:APPVEYOR_BUILD_VERSION.replace("+", ".dev") - - # if ($env:APPVEYOR_REPO_TAG -eq 'true') { - # # release mode - # $env:TWINE_PASSWORD = $env:pypi_key - # } else { - # # build mode - # $env:TWINE_PASSWORD = $env:test_pypi_key - # $env:TWINE_REPOSITORY = 'testpypi' - # } - (Get-Content pyproject.toml).replace("version = `"0.1.0`"", "version = `"$ver`"") | Set-Content pyproject.toml (Get-Content flet/version.py).replace("version = `"`"", "version = `"$ver`"") | Set-Content flet/version.py @@ -441,6 +433,7 @@ for: # publish package - sh: | if [[ "$APPVEYOR_REPO_BRANCH" == "main" ]]; then + $env:TWINE_PASSWORD = $env:pypi_key twine upload dist/* fi From 95e14eb8d425bef5c61b704036e78bc7ce35b076 Mon Sep 17 00:00:00 2001 From: Feodor Fitsner Date: Wed, 16 Nov 2022 10:22:17 -0800 Subject: [PATCH 7/7] Publish to pypi on main branch only --- .appveyor.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index f2088fe46..518603e0b 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -90,11 +90,9 @@ environment: job_depends_on: python_tests APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu TWINE_USERNAME: __token__ - TWINE_NON_INTERACTIVE: true - pypi_key: + TWINE_PASSWORD: secure: 174ncAbF5IjSIkmioPt62jeSnzmTlRNchUkE4QdjDWH8xK1olYtySXLJpo2q95HcP7lWJky1hv4APESiRRHnBWoY0XRFafzM/mbCDMzG1tZXiXZmpP1qzHAtRP2QSCIg18xh1TMktraUdTi7sbJnjjRhqzgbW1k0kLBxKw79MPFBhYQ/TiGcmaYWZbWVZNY3HCUCb6Dt7bG1OE2Ul9rD1gvs55xwO9Oq9FOVA1VnMYw= - test_pypi_key: - secure: cMCzqE9PcLcAiQ7POU0eVmLsXpy/n3WA9USIQNDKKbvUeajtURVITKpQ4MmwUXZAGv8giPPDUppiIf22AwIfx3O43tBVCp/HjvKNCbgY8sTaQBx60mLRbVBfD1F/+VfeuSTm57qtuSxUkZWF1JlWp8UQqIwCMHHDd0/wqDfmPNKj6U617Lp3vIfhsfgaDofspCKSGfG8+Z+6gcpmI+mA1wFHQB+l/BAbsGbgih8HiH6EzcuyIphxQKEA6r2XDPWE + TWINE_NON_INTERACTIVE: true matrix: fast_finish: true @@ -432,8 +430,7 @@ for: # publish package - sh: | - if [[ "$APPVEYOR_REPO_BRANCH" == "main" ]]; then - $env:TWINE_PASSWORD = $env:pypi_key + if [[ "$APPVEYOR_REPO_BRANCH" == "main" && "$APPVEYOR_PULL_REQUEST_NUMBER" == "" ]]; then twine upload dist/* fi