From 8fd7d7bc32fe5d3cf4e6e7737b748139bd5a1850 Mon Sep 17 00:00:00 2001 From: hborawski Date: Tue, 16 Jul 2024 10:21:35 -0700 Subject: [PATCH 01/15] try publishing canary spm/pod with new rule --- BUILD.bazel | 21 ++++++++++++++++++++- MODULE.bazel | 17 ++++++++++++----- scripts/release.sh | 2 ++ 3 files changed, 34 insertions(+), 6 deletions(-) diff --git a/BUILD.bazel b/BUILD.bazel index 0cd3ec2a9..2311e7f15 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -1,4 +1,4 @@ -load("@rules_player//ios:defs.bzl", "assemble_pod") +load("@rules_player//ios:defs.bzl", "assemble_pod", "ios_publish") load("@rules_player//internal:defs.bzl", "stamp") load("@npm//:defs.bzl", "npm_link_all_packages") load("@aspect_rules_js//js:defs.bzl", "js_library") @@ -190,6 +190,25 @@ assemble_pod( podspec = ":PlayerUI_Podspec", ) +ios_publish( + name = "spm_publish", + zip = ":PlayerUI_Pod", + # SPM Release Repo + repository = "https://github.com/player-ui/playerui-swift-package.git", + # CocoaPods + podspec = ":PlayerUI_Podspec", + executable = "bundle exec pod", + globalFlags = [ + # because jenkins runs as root + "--allow-root", + ], + pushFlags = [ + # skip tests because it never runs them right + # and they're run as part of the build pipeline anyway + "--skip-tests", + ], +) + # # Push podspec to specs repo # # tag must exist in github first # pod_push( diff --git a/MODULE.bazel b/MODULE.bazel index 91032e69f..fe9e6c797 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -5,11 +5,18 @@ module( bazel_dep(name = "rules_player") -archive_override( - module_name = "rules_player", - strip_prefix = "rules_player-1.0.0", - urls = ["https://github.com/player-ui/rules_player/archive/refs/tags/v1.0.0.tar.gz"], - integrity = "sha256-08MFpLzTnmwrIZhvE1cBL21cSqmjXzD6SH2HhTf8hR4=" +# archive_override( +# module_name = "rules_player", +# strip_prefix = "rules_player-1.0.0", +# urls = ["https://github.com/player-ui/rules_player/archive/refs/tags/v1.0.0.tar.gz"], +# integrity = "sha256-08MFpLzTnmwrIZhvE1cBL21cSqmjXzD6SH2HhTf8hR4=" +# ) + +git_override( + remote = "https://github.com/player-ui/rules_player.git", + # bazel-6 branch + commit = "cdd3bd507f5caedeccc6aa66b054bd5579508124", + module_name = "rules_player", ) #local_path_override(module_name = "rules_player", path = "../rules_player") diff --git a/scripts/release.sh b/scripts/release.sh index 81593946d..e1a372d7a 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -26,6 +26,8 @@ done # Rebuild to stamp the release podspec bazel build --config=release //:PlayerUI_Podspec //:PlayerUI_Pod +bazel run --config=release //:spm_publish + # VScode extension publishing bazel run --config=release //language/vscode-player-syntax:vscode-plugin.publish From 4a2fc742fed96aaba31fca2916ab7001785bc9d5 Mon Sep 17 00:00:00 2001 From: hborawski Date: Tue, 16 Jul 2024 11:23:48 -0700 Subject: [PATCH 02/15] config git user/email for spm release --- .circleci/config.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 257ba519d..2869fb249 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -51,7 +51,13 @@ commands: - gem-v1-{{ arch }}-main-{{ checksum "Gemfile.lock" }} - run: mkdir ~/.ssh/ && echo -e "Host github.com\n\tStrictHostKeyChecking no\n" > ~/.ssh/config +<<<<<<< Updated upstream - run: echo "//registry.npmjs.com/:_authToken=$NPM_TOKEN" >> ~/.npmrc +======= + - run: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc + - run: git config --global user.email intuit-svc@intuit.com + - run: git config --global user.name "Intuit Service" +>>>>>>> Stashed changes - run: | echo -e $GPG_KEY | gpg --import --batch echo -e "pinentry-mode loopback\npassphrase $DEPLOY_MAVEN_GPG_PASSPHRASE" > ~/.gnupg/gpg.conf From fda4b84f157c24fd9503c542b1fbca0bdd94220e Mon Sep 17 00:00:00 2001 From: hborawski Date: Tue, 16 Jul 2024 11:25:56 -0700 Subject: [PATCH 03/15] config git user/email for spm release --- .circleci/config.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 2869fb249..9f4edc519 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -51,13 +51,9 @@ commands: - gem-v1-{{ arch }}-main-{{ checksum "Gemfile.lock" }} - run: mkdir ~/.ssh/ && echo -e "Host github.com\n\tStrictHostKeyChecking no\n" > ~/.ssh/config -<<<<<<< Updated upstream - - run: echo "//registry.npmjs.com/:_authToken=$NPM_TOKEN" >> ~/.npmrc -======= - run: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc - run: git config --global user.email intuit-svc@intuit.com - run: git config --global user.name "Intuit Service" ->>>>>>> Stashed changes - run: | echo -e $GPG_KEY | gpg --import --batch echo -e "pinentry-mode loopback\npassphrase $DEPLOY_MAVEN_GPG_PASSPHRASE" > ~/.gnupg/gpg.conf From 2375c847e645c83b58fa0fefdc0926ba18657079 Mon Sep 17 00:00:00 2001 From: hborawski Date: Tue, 16 Jul 2024 12:11:28 -0700 Subject: [PATCH 04/15] debug git config --- .circleci/config.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 9f4edc519..cb976e78a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -59,6 +59,7 @@ commands: echo -e "pinentry-mode loopback\npassphrase $DEPLOY_MAVEN_GPG_PASSPHRASE" > ~/.gnupg/gpg.conf - run: | source ~/.bashrc + git config --list bundle install npx auto shipit --only-graduate-with-release-label -vv @@ -67,6 +68,7 @@ jobs: executor: base steps: - checkout + - run: git config --list - restore_cache: keys: From 86db509429a331fa91ba9d465ef796a7b4fac2ed Mon Sep 17 00:00:00 2001 From: hborawski Date: Tue, 16 Jul 2024 12:46:22 -0700 Subject: [PATCH 05/15] use ssh key for pushing to spm repo --- .circleci/config.yml | 6 ++++-- BUILD.bazel | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index cb976e78a..37e48dac7 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -50,10 +50,12 @@ commands: - gem-v1-{{ arch }}-{{ .Branch }}-{{ checksum "Gemfile.lock" }} - gem-v1-{{ arch }}-main-{{ checksum "Gemfile.lock" }} + - add_ssh_keys: + fingerprints: + - "SHA256:hUAWVYdfSW5ml6ufbfyEHUcuPwUJ88xVhsZc21b2lA8" + - run: mkdir ~/.ssh/ && echo -e "Host github.com\n\tStrictHostKeyChecking no\n" > ~/.ssh/config - run: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc - - run: git config --global user.email intuit-svc@intuit.com - - run: git config --global user.name "Intuit Service" - run: | echo -e $GPG_KEY | gpg --import --batch echo -e "pinentry-mode loopback\npassphrase $DEPLOY_MAVEN_GPG_PASSPHRASE" > ~/.gnupg/gpg.conf diff --git a/BUILD.bazel b/BUILD.bazel index 2311e7f15..ae1c4f96f 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -194,7 +194,7 @@ ios_publish( name = "spm_publish", zip = ":PlayerUI_Pod", # SPM Release Repo - repository = "https://github.com/player-ui/playerui-swift-package.git", + repository = "git@github.com:player-ui/playerui-swift-package.git", # CocoaPods podspec = ":PlayerUI_Podspec", executable = "bundle exec pod", From 4e436ef35ee1bcf8062c7eb5497a58af8f094de7 Mon Sep 17 00:00:00 2001 From: hborawski Date: Tue, 16 Jul 2024 12:47:24 -0700 Subject: [PATCH 06/15] change podspec location --- PlayerUI.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PlayerUI.podspec b/PlayerUI.podspec index c6d548139..7eed2d386 100644 --- a/PlayerUI.podspec +++ b/PlayerUI.podspec @@ -18,7 +18,7 @@ and display it as a SwiftUI view comprised of registered assets. s.homepage = 'https://github.com/player-ui/player' s.license = { :type => 'MIT', :file => 'LICENSE' } s.author = { 'hborawski' => 'harris_borawski@intuit.com' } - s.source = { :http => "https://github.com/player-ui/player/releases/download/#{s.version.to_s}/PlayerUI_Pod.zip" } + s.source = { :git => "https://github.com/player-ui/playerui-swift-package.git", :tag => s.version.to_s } s.ios.deployment_target = '14.0' From e8f62ffbea56a1a47d8848834399d3ebd4b071f2 Mon Sep 17 00:00:00 2001 From: hborawski Date: Tue, 16 Jul 2024 13:10:59 -0700 Subject: [PATCH 07/15] dont fail on mkdir for ssh --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 37e48dac7..b315dcf52 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -54,7 +54,7 @@ commands: fingerprints: - "SHA256:hUAWVYdfSW5ml6ufbfyEHUcuPwUJ88xVhsZc21b2lA8" - - run: mkdir ~/.ssh/ && echo -e "Host github.com\n\tStrictHostKeyChecking no\n" > ~/.ssh/config + - run: mkdir -p ~/.ssh/ && echo -e "Host github.com\n\tStrictHostKeyChecking no\n" > ~/.ssh/config - run: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc - run: | echo -e $GPG_KEY | gpg --import --batch From 62359bd53dbed60653e176e4836f91c0e2196079 Mon Sep 17 00:00:00 2001 From: hborawski Date: Tue, 16 Jul 2024 13:53:53 -0700 Subject: [PATCH 08/15] configure username/email for git --- .circleci/config.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index b315dcf52..168188ddd 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -56,6 +56,8 @@ commands: - run: mkdir -p ~/.ssh/ && echo -e "Host github.com\n\tStrictHostKeyChecking no\n" > ~/.ssh/config - run: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc + - run: git config --global user.name "Intuit Servce" + - run: git config --global user.email "opensource-svc@intuit.com" - run: | echo -e $GPG_KEY | gpg --import --batch echo -e "pinentry-mode loopback\npassphrase $DEPLOY_MAVEN_GPG_PASSPHRASE" > ~/.gnupg/gpg.conf From 4c41206a326cc5d50ea09d58724fd68d59370687 Mon Sep 17 00:00:00 2001 From: hborawski Date: Tue, 16 Jul 2024 14:28:07 -0700 Subject: [PATCH 09/15] fix npm cred --- .circleci/config.yml | 2 +- scripts/release.sh | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 168188ddd..62dcbd0c1 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -55,7 +55,7 @@ commands: - "SHA256:hUAWVYdfSW5ml6ufbfyEHUcuPwUJ88xVhsZc21b2lA8" - run: mkdir -p ~/.ssh/ && echo -e "Host github.com\n\tStrictHostKeyChecking no\n" > ~/.ssh/config - - run: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc + - run: echo "//registry.npmjs.com/:_authToken=$NPM_TOKEN" >> ~/.npmrc - run: git config --global user.name "Intuit Servce" - run: git config --global user.email "opensource-svc@intuit.com" - run: | diff --git a/scripts/release.sh b/scripts/release.sh index e1a372d7a..8baf33030 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -28,9 +28,6 @@ bazel build --config=release //:PlayerUI_Podspec //:PlayerUI_Pod bazel run --config=release //:spm_publish -# VScode extension publishing -bazel run --config=release //language/vscode-player-syntax:vscode-plugin.publish - # Maven Central publishing bazel run @rules_player//distribution:staged-maven-deploy -- "$RELEASE_TYPE" --package-group=com.intuit.playerui --legacy --client-timeout=600 --connect-timeout=600 From dac8fcfd657fa156db0814ed0ddd38301d0ae00c Mon Sep 17 00:00:00 2001 From: hborawski Date: Tue, 16 Jul 2024 14:30:30 -0700 Subject: [PATCH 10/15] remove after-shipit cocoapod release integration --- .autorc | 9 ----- scripts/after-shipit-pod-push.js | 59 -------------------------------- 2 files changed, 68 deletions(-) delete mode 100644 scripts/after-shipit-pod-push.js diff --git a/.autorc b/.autorc index e0616aac0..c039217bf 100644 --- a/.autorc +++ b/.autorc @@ -6,14 +6,6 @@ "owner": "player-ui", "repo": "player", "plugins": [ - [ - "upload-assets", - { - "assets": [ - "./bazel-bin/PlayerUI_Pod.zip" - ] - } - ], [ "version-file", { @@ -27,7 +19,6 @@ "labels": "release" } ], - "./scripts/after-shipit-pod-push.js", "./scripts/delete-old-prerelease.js" ] } diff --git a/scripts/after-shipit-pod-push.js b/scripts/after-shipit-pod-push.js deleted file mode 100644 index 82ba70e3f..000000000 --- a/scripts/after-shipit-pod-push.js +++ /dev/null @@ -1,59 +0,0 @@ -/* eslint-disable no-restricted-syntax */ -/* eslint-disable no-unused-vars */ -/* eslint-disable no-await-in-loop */ -const { execSync } = require('child_process'); - -class AfterShipItPodPush { - name = 'after-shipit-pod-push'; - - wasCanary = false; - - apply(auto) { - auto.hooks.canary.tap(this.name, () => { - this.wasCanary = true - }) - auto.hooks.afterShipIt.tapPromise(this.name, async ({ dryRun, newVersion }) => { - if (dryRun) { - auto.logger.log.info('Dry run: would have pushed pod to trunk'); - } else if (this.wasCanary) { - auto.logger.log.info('[AfterShipItPodPush]: Canary not yet supported, skipping pod push.') - } else { - let found = false - let attempt = 0 - - while (!found && attempt < 10) { - const { data } = await auto.git.github.repos.listReleases({owner: auto.config.owner, repo: auto.config.repo}) - const release = data.find(element => element.tag_name === newVersion) - if (release) { - const { data: releaseData } = await auto.git.github.repos.getRelease({owner: auto.config.owner, repo: auto.config.repo, release_id: release.id}) - const zip = releaseData.assets.find(element => element.name === 'PlayerUI_Pod.zip' && element.state === 'uploaded') - - found = !!zip - } - - if (!found) { - attempt++ - await new Promise((resolve) => { - setTimeout(resolve, 500) - }) - } - } - - if (found) { - auto.logger.log.info('Pushing Pod to trunk') - let process - try { - process = execSync('bundle exec pod trunk push --verbose --skip-tests ./bazel-bin/PlayerUI.podspec', {stdio: 'inherit'}) - } catch(e) { - auto.logger.log.error('Pod push failed: ', process && process.stderr.toString(), e) - throw e - } - } else { - auto.logger.log.error('[AfterShipItPodPush]: Release not found, skipping pod push') - } - } - }); - } -} - -module.exports = AfterShipItPodPush; From 50bb0955801ff6741178ae721104f8a9cb2f34c1 Mon Sep 17 00:00:00 2001 From: hborawski Date: Tue, 16 Jul 2024 16:28:02 -0700 Subject: [PATCH 11/15] remove git debug output --- .circleci/config.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 62dcbd0c1..82e671621 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -63,7 +63,6 @@ commands: echo -e "pinentry-mode loopback\npassphrase $DEPLOY_MAVEN_GPG_PASSPHRASE" > ~/.gnupg/gpg.conf - run: | source ~/.bashrc - git config --list bundle install npx auto shipit --only-graduate-with-release-label -vv @@ -72,7 +71,6 @@ jobs: executor: base steps: - checkout - - run: git config --list - restore_cache: keys: From 94357b4610a27f74f8b2ccf459cfd09cb21b6874 Mon Sep 17 00:00:00 2001 From: hborawski Date: Tue, 16 Jul 2024 16:39:44 -0700 Subject: [PATCH 12/15] rename publish rule because its not just spm --- BUILD.bazel | 2 +- scripts/release.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/BUILD.bazel b/BUILD.bazel index ae1c4f96f..3708b8935 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -191,7 +191,7 @@ assemble_pod( ) ios_publish( - name = "spm_publish", + name = "ios_publish", zip = ":PlayerUI_Pod", # SPM Release Repo repository = "git@github.com:player-ui/playerui-swift-package.git", diff --git a/scripts/release.sh b/scripts/release.sh index 8baf33030..c4f76b192 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -26,7 +26,7 @@ done # Rebuild to stamp the release podspec bazel build --config=release //:PlayerUI_Podspec //:PlayerUI_Pod -bazel run --config=release //:spm_publish +bazel run --config=release //:ios_publish # Maven Central publishing bazel run @rules_player//distribution:staged-maven-deploy -- "$RELEASE_TYPE" --package-group=com.intuit.playerui --legacy --client-timeout=600 --connect-timeout=600 From aeb7915e2b8e603ff6a50851c1130f8cbb156815 Mon Sep 17 00:00:00 2001 From: hborawski Date: Thu, 18 Jul 2024 09:52:27 -0700 Subject: [PATCH 13/15] use release version of rules_player for ios_publish --- MODULE.bazel | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/MODULE.bazel b/MODULE.bazel index fe9e6c797..c468d3241 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -5,18 +5,11 @@ module( bazel_dep(name = "rules_player") -# archive_override( -# module_name = "rules_player", -# strip_prefix = "rules_player-1.0.0", -# urls = ["https://github.com/player-ui/rules_player/archive/refs/tags/v1.0.0.tar.gz"], -# integrity = "sha256-08MFpLzTnmwrIZhvE1cBL21cSqmjXzD6SH2HhTf8hR4=" -# ) - -git_override( - remote = "https://github.com/player-ui/rules_player.git", - # bazel-6 branch - commit = "cdd3bd507f5caedeccc6aa66b054bd5579508124", - module_name = "rules_player", +archive_override( + module_name = "rules_player", + strip_prefix = "rules_player-1.0.1", + urls = ["https://github.com/player-ui/rules_player/archive/refs/tags/v1.0.1.tar.gz"], + integrity = "sha256-zIbxx1Bh/X4E8OwbPJz1nY9mOd2uAgmTZyf1Hs2mq+U=" ) #local_path_override(module_name = "rules_player", path = "../rules_player") From bf729f1cc0569d8c9550a221a5c8454104c2434a Mon Sep 17 00:00:00 2001 From: hborawski Date: Thu, 18 Jul 2024 12:46:12 -0700 Subject: [PATCH 14/15] restore resource bundle prefix --- PlayerUI.podspec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PlayerUI.podspec b/PlayerUI.podspec index 7eed2d386..d22c81bdc 100644 --- a/PlayerUI.podspec +++ b/PlayerUI.podspec @@ -96,7 +96,7 @@ and display it as a SwiftUI view comprised of registered assets. subspec.source_files = "plugins/#{path}/ios/Sources/**/*" if resources == TRUE subspec.resource_bundles = { - name => ["plugins/#{path}/ios/Resources/**/*.js"] + "PlayerUI_#{name}" => ["plugins/#{path}/ios/Resources/**/*.js"] } end end @@ -112,7 +112,7 @@ and display it as a SwiftUI view comprised of registered assets. subspec.source_files = "plugins/#{path}/swiftui/Sources/**/*" if resources == TRUE subspec.resource_bundles = { - name => ["plugins/#{path}/swiftui/Resources/**/*.js"] + "PlayerUI_#{name}" => ["plugins/#{path}/swiftui/Resources/**/*.js"] } end end From 6e0b4ef1b40691d918ff2692e44cd9ca65ce5f90 Mon Sep 17 00:00:00 2001 From: hborawski Date: Fri, 19 Jul 2024 16:16:48 -0700 Subject: [PATCH 15/15] fix typo --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 91f5eee31..601efb57c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -56,7 +56,7 @@ commands: - run: mkdir -p ~/.ssh/ && echo -e "Host github.com\n\tStrictHostKeyChecking no\n" > ~/.ssh/config - run: echo "//registry.npmjs.com/:_authToken=$NPM_TOKEN" >> ~/.npmrc - - run: git config --global user.name "Intuit Servce" + - run: git config --global user.name "Intuit Service" - run: git config --global user.email "opensource-svc@intuit.com" - run: | echo -e $GPG_KEY | gpg --import --batch