From 460dc78d1888599885d93e7be4736be1bf2cf08e Mon Sep 17 00:00:00 2001 From: Ivy Shih <97625966+ishih-opti@users.noreply.github.com> Date: Thu, 1 Sep 2022 13:54:23 -0700 Subject: [PATCH 001/138] Add .circleci/config.yml --- .circleci/config.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e741da9f..b8c3cd4a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -20,7 +20,7 @@ jobs: test: docker: - image: circleci/golang:1.13 - working_directory: /go/src/github.com/segmentio/aws-okta + working_directory: /go/src/github.com/optimizely/aws-okta steps: - run: # Do this prior to checkout so that it doesn't modify go.mod file. @@ -54,7 +54,7 @@ jobs: dist-linux: docker: - image: circleci/golang:1.13 - working_directory: /go/src/github.com/segmentio/aws-okta + working_directory: /go/src/github.com/optimizely/aws-okta steps: - checkout - run: @@ -77,7 +77,7 @@ jobs: publish-packagecloud: docker: - image: circleci/golang:1.13 - working_directory: /go/src/github.com/segmentio/aws-okta + working_directory: /go/src/github.com/optimizely/aws-okta steps: - checkout - attach_workspace: { at: . } @@ -96,7 +96,7 @@ jobs: publish-github-linux: docker: - image: circleci/golang:1.13 - working_directory: /go/src/github.com/segmentio/aws-okta + working_directory: /go/src/github.com/optimizely/aws-okta steps: - checkout - attach_workspace: { at: . } @@ -132,7 +132,7 @@ workflows: tags: only: /v[0-9]+(\.[0-9]+)*(-[a-zA-Z0-9-]+)?/ - publish-github-linux: - context: github-segmentcircle-oss-release + context: github-optimizelycircle-oss-release requires: - dist-linux filters: From d9ed70ba344450b3b9aff0fb744900b5b114c90f Mon Sep 17 00:00:00 2001 From: Ivy Shih <97625966+ishih-opti@users.noreply.github.com> Date: Wed, 7 Sep 2022 09:01:06 -0700 Subject: [PATCH 002/138] Updated config.yml --- .circleci/config.yml | 91 +++++++++++++++++++++++++++++++++++--------- 1 file changed, 73 insertions(+), 18 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b8c3cd4a..dbffad15 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -74,7 +74,25 @@ jobs: root: . paths: ['dist/*'] - publish-packagecloud: + # publish-packagecloud: + # docker: + # - image: circleci/golang:1.13 + # working_directory: /go/src/github.com/optimizely/aws-okta + # steps: + # - checkout + # - attach_workspace: { at: . } + # - run: + # name: Install tools + # command: | + # make -f Makefile.tools github-release + # # this is all for package_cloud :/ + # sudo apt update -q + # sudo apt install -yq ruby ruby-dev build-essential + # # fixes https://askubuntu.com/questions/872399/error-failed-to-build-gem-native-extension-when-trying-to-download-rubocop + # sudo gem install rake + # sudo make -f Makefile.tools package_cloud + # make -f Makefile.release publish-packagecloud + publish-github-linux: docker: - image: circleci/golang:1.13 working_directory: /go/src/github.com/optimizely/aws-okta @@ -85,15 +103,33 @@ jobs: name: Install tools command: | make -f Makefile.tools github-release - # this is all for package_cloud :/ - sudo apt update -q - sudo apt install -yq ruby ruby-dev build-essential - # fixes https://askubuntu.com/questions/872399/error-failed-to-build-gem-native-extension-when-trying-to-download-rubocop - sudo gem install rake - sudo make -f Makefile.tools package_cloud - make -f Makefile.release publish-packagecloud + make -f Makefile.release publish-github-linux - publish-github-linux: +# ishih - my change, add job list: dist-darwin and publish-github-darwin + dist-darwin: + docker: + - image: circleci/golang:1.13 + working_directory: /go/src/github.com/optimizely/aws-okta + steps: + - checkout + - run: + name: Install nfpm, rpmbuild + command: | + sudo make -f Makefile.tools rpmbuild-darwin sha256sum-darwin + - run: + name: Install libusb + command: | + sudo brew upgrade brew + sudo brew install libusb + - run: + name: Make distributables + command: | + make -f Makefile.release dist-darwin + - persist_to_workspace: + root: . + paths: ['dist/*'] + + publish-github-darwin: docker: - image: circleci/golang:1.13 working_directory: /go/src/github.com/optimizely/aws-okta @@ -104,13 +140,13 @@ jobs: name: Install tools command: | make -f Makefile.tools github-release - make -f Makefile.release publish-github-linux + make -f Makefile.release publish-github-darwin workflows: version: 2 # currently we only build/publish for linux: macOS builds require non-FOSS # Keychain libs that require a macOS host to build on - # https://github.com/segmentio/aws-okta/issues/81 + # https://github.com/optimizely/aws-okta/issues/81 test-dist-publish-linux: jobs: - test @@ -120,26 +156,45 @@ workflows: filters: tags: only: /.*/ - - publish-packagecloud: - context: packagecloud + - dist-darwin: + # needed to ensure dist happens on tag events + filters: + tags: + only: /.*/ + # - publish-packagecloud: + # context: packagecloud + # requires: + # - dist-linux + # filters: + # # never publish from a branch event + # branches: + # ignore: /.*/ + # # release only on tag push events like vX[.Y.Z...][-whatever] + # tags: + # only: /v[0-9]+(\.[0-9]+)*(-[a-zA-Z0-9-]+)?/ + - publish-github-linux: + context: github-optimizelycircle-oss-release requires: - dist-linux filters: # never publish from a branch event branches: ignore: /.*/ + # disabled (temporarily?) due to https://github.com/optimizely/aws-okta/issues/301 # release only on tag push events like vX[.Y.Z...][-whatever] - tags: - only: /v[0-9]+(\.[0-9]+)*(-[a-zA-Z0-9-]+)?/ - - publish-github-linux: + # tags: + # only: /v[0-9]+(\.[0-9]+)*(-[a-zA-Z0-9-]+)?/ + ### ishih-opti - add for dawrin + - publish-github-darwin: context: github-optimizelycircle-oss-release requires: - - dist-linux + - dist-darwin filters: # never publish from a branch event branches: ignore: /.*/ - # disabled (temporarily?) due to https://github.com/segmentio/aws-okta/issues/301 + # disabled (temporarily?) due to https://github.com/optimizely/aws-okta/issues/301 # release only on tag push events like vX[.Y.Z...][-whatever] # tags: # only: /v[0-9]+(\.[0-9]+)*(-[a-zA-Z0-9-]+)?/ + From ab5a3d7334e6cb5c0a557e3d44c6d3358f8a7127 Mon Sep 17 00:00:00 2001 From: Ivy Shih <97625966+ishih-opti@users.noreply.github.com> Date: Wed, 7 Sep 2022 09:22:04 -0700 Subject: [PATCH 003/138] Updated config.yml --- .circleci/config.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index dbffad15..70d58858 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -119,8 +119,10 @@ jobs: - run: name: Install libusb command: | - sudo brew upgrade brew - sudo brew install libusb + # sudo brew upgrade brew + # sudo brew install libusb + sudo apt update -q + sudo apt install -yq libusb-dev libusb-1.0.0-dev - run: name: Make distributables command: | @@ -196,5 +198,4 @@ workflows: # disabled (temporarily?) due to https://github.com/optimizely/aws-okta/issues/301 # release only on tag push events like vX[.Y.Z...][-whatever] # tags: - # only: /v[0-9]+(\.[0-9]+)*(-[a-zA-Z0-9-]+)?/ - + # only: /v[0-9]+(\.[0-9]+)*(-[a-zA-Z0-9-]+)?/ \ No newline at end of file From a597f33ca46faf319c260e0e40976ad0fee13dae Mon Sep 17 00:00:00 2001 From: Ivy Shih <97625966+ishih-opti@users.noreply.github.com> Date: Wed, 7 Sep 2022 09:38:14 -0700 Subject: [PATCH 004/138] Updated config.yml --- .circleci/config.yml | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 70d58858..0d4de6f7 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -113,19 +113,23 @@ jobs: steps: - checkout - run: - name: Install nfpm, rpmbuild - command: | - sudo make -f Makefile.tools rpmbuild-darwin sha256sum-darwin - - run: - name: Install libusb + name: Install libusb and brew command: | # sudo brew upgrade brew # sudo brew install libusb sudo apt update -q - sudo apt install -yq libusb-dev libusb-1.0.0-dev + sudo apt install -yq libusb-dev libusb-1.0.0-dev build-essential curl ruby + yes | ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install)" || true + - run: + name: Install nfpm, rpmbuild + command: | + export PATH="$HOME/.linuxbrew/bin:$PATH" + sudo make -f Makefile.tools rpmbuild-darwin sha256sum-darwin + - run: name: Make distributables command: | + export PATH="$HOME/.linuxbrew/bin:$PATH" make -f Makefile.release dist-darwin - persist_to_workspace: root: . @@ -141,6 +145,7 @@ jobs: - run: name: Install tools command: | + export PATH="$HOME/.linuxbrew/bin:$PATH" make -f Makefile.tools github-release make -f Makefile.release publish-github-darwin @@ -198,4 +203,5 @@ workflows: # disabled (temporarily?) due to https://github.com/optimizely/aws-okta/issues/301 # release only on tag push events like vX[.Y.Z...][-whatever] # tags: - # only: /v[0-9]+(\.[0-9]+)*(-[a-zA-Z0-9-]+)?/ \ No newline at end of file + # only: /v[0-9]+(\.[0-9]+)*(-[a-zA-Z0-9-]+)?/ + From 1e4f32b1ef2ce10cda4b420cfd120de960c10e92 Mon Sep 17 00:00:00 2001 From: Ivy Shih <97625966+ishih-opti@users.noreply.github.com> Date: Mon, 12 Sep 2022 09:12:24 -0700 Subject: [PATCH 005/138] Updated config.yml --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 0d4de6f7..057fe294 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -120,6 +120,7 @@ jobs: sudo apt update -q sudo apt install -yq libusb-dev libusb-1.0.0-dev build-essential curl ruby yes | ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install)" || true + export PATH="$HOME/.linuxbrew/bin:$PATH" - run: name: Install nfpm, rpmbuild command: | From 169441e2438385871843c2a0e6f1c81fb319aace Mon Sep 17 00:00:00 2001 From: Ivy Shih <97625966+ishih-opti@users.noreply.github.com> Date: Mon, 12 Sep 2022 09:20:05 -0700 Subject: [PATCH 006/138] Updated config.yml --- .circleci/config.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 057fe294..62f46672 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -120,7 +120,9 @@ jobs: sudo apt update -q sudo apt install -yq libusb-dev libusb-1.0.0-dev build-essential curl ruby yes | ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install)" || true + eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" export PATH="$HOME/.linuxbrew/bin:$PATH" + which brew - run: name: Install nfpm, rpmbuild command: | From 9b0c3d436074a8b1c3258b86eafe0b1cd93d76f8 Mon Sep 17 00:00:00 2001 From: Ivy Shih <97625966+ishih-opti@users.noreply.github.com> Date: Mon, 12 Sep 2022 09:21:38 -0700 Subject: [PATCH 007/138] Updated config.yml --- .circleci/config.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 62f46672..773ab508 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -128,7 +128,6 @@ jobs: command: | export PATH="$HOME/.linuxbrew/bin:$PATH" sudo make -f Makefile.tools rpmbuild-darwin sha256sum-darwin - - run: name: Make distributables command: | From f0be43a0f761161be9e34a653ef77974b412c64c Mon Sep 17 00:00:00 2001 From: Ivy Shih <97625966+ishih-opti@users.noreply.github.com> Date: Mon, 12 Sep 2022 09:26:46 -0700 Subject: [PATCH 008/138] Updated config.yml --- .circleci/config.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 773ab508..087a2fc6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -123,16 +123,18 @@ jobs: eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" export PATH="$HOME/.linuxbrew/bin:$PATH" which brew + sudo make -f Makefile.tools rpmbuild-darwin sha256sum-darwin + make -f Makefile.release dist-darwin - run: name: Install nfpm, rpmbuild command: | export PATH="$HOME/.linuxbrew/bin:$PATH" - sudo make -f Makefile.tools rpmbuild-darwin sha256sum-darwin + - run: name: Make distributables command: | export PATH="$HOME/.linuxbrew/bin:$PATH" - make -f Makefile.release dist-darwin + - persist_to_workspace: root: . paths: ['dist/*'] From 22f567b36e9e5624779abf074037b35edf82786a Mon Sep 17 00:00:00 2001 From: Ivy Shih <97625966+ishih-opti@users.noreply.github.com> Date: Mon, 12 Sep 2022 09:31:31 -0700 Subject: [PATCH 009/138] Updated config.yml --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 087a2fc6..533526b4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -123,7 +123,7 @@ jobs: eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" export PATH="$HOME/.linuxbrew/bin:$PATH" which brew - sudo make -f Makefile.tools rpmbuild-darwin sha256sum-darwin + make -f Makefile.tools rpmbuild-darwin sha256sum-darwin make -f Makefile.release dist-darwin - run: name: Install nfpm, rpmbuild From 733ce575c68a1c64a474ae9d3c92779e82c75502 Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Mon, 12 Sep 2022 09:57:30 -0700 Subject: [PATCH 010/138] removingin trailing orphan quote at line 24 --- Makefile.tools | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.tools b/Makefile.tools index c4cdd1d7..d1167744 100644 --- a/Makefile.tools +++ b/Makefile.tools @@ -21,7 +21,7 @@ rpmbuild-darwin: brew install rpm sha256sum-darwin: - brew install coreutils && ln -s $$(which gsha256sum) /usr/local/bin/sha256sum` + brew install coreutils && ln -s $$(which gsha256sum) /usr/local/bin/sha256sum github-release: GO111MODULE=off go get -u github.com/aktau/github-release From 144e1f905c1dcbcd61874fc8eaee399f99de76bf Mon Sep 17 00:00:00 2001 From: Ivy Shih <97625966+ishih-opti@users.noreply.github.com> Date: Mon, 12 Sep 2022 10:16:26 -0700 Subject: [PATCH 011/138] Updated config.yml --- .circleci/config.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 533526b4..07111879 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -123,7 +123,9 @@ jobs: eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" export PATH="$HOME/.linuxbrew/bin:$PATH" which brew + # builing tools make -f Makefile.tools rpmbuild-darwin sha256sum-darwin + # building releases make -f Makefile.release dist-darwin - run: name: Install nfpm, rpmbuild From 3594e2e039e33a736d1cad81b57fc956b6e96cd5 Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Mon, 12 Sep 2022 10:29:42 -0700 Subject: [PATCH 012/138] comment out error code in sha256sum-darwin --- Makefile.tools | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.tools b/Makefile.tools index d1167744..3128a844 100644 --- a/Makefile.tools +++ b/Makefile.tools @@ -21,7 +21,7 @@ rpmbuild-darwin: brew install rpm sha256sum-darwin: - brew install coreutils && ln -s $$(which gsha256sum) /usr/local/bin/sha256sum + brew install coreutils #&& ln -s $$(which gsha256sum) /usr/local/bin/sha256sum github-release: GO111MODULE=off go get -u github.com/aktau/github-release From c53981b3047f7ed3105e2b6742df8592ae2a8ec7 Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Mon, 12 Sep 2022 10:56:35 -0700 Subject: [PATCH 013/138] add sudo to brew --- .circleci/config.yml | 1 - Makefile.tools | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 07111879..a49fa22c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -131,7 +131,6 @@ jobs: name: Install nfpm, rpmbuild command: | export PATH="$HOME/.linuxbrew/bin:$PATH" - - run: name: Make distributables command: | diff --git a/Makefile.tools b/Makefile.tools index 3128a844..5200ceb4 100644 --- a/Makefile.tools +++ b/Makefile.tools @@ -21,7 +21,7 @@ rpmbuild-darwin: brew install rpm sha256sum-darwin: - brew install coreutils #&& ln -s $$(which gsha256sum) /usr/local/bin/sha256sum + sudo brew install coreutils && ln -s $$(which gsha256sum) /usr/local/bin/sha256sum github-release: GO111MODULE=off go get -u github.com/aktau/github-release From 253d10856d6764b4cc8b0292f1d3e0a85f4a545f Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Mon, 12 Sep 2022 12:00:11 -0700 Subject: [PATCH 014/138] comment out the lnking in sha256sum-darwin --- Makefile.tools | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile.tools b/Makefile.tools index 5200ceb4..6db0789b 100644 --- a/Makefile.tools +++ b/Makefile.tools @@ -21,7 +21,8 @@ rpmbuild-darwin: brew install rpm sha256sum-darwin: - sudo brew install coreutils && ln -s $$(which gsha256sum) /usr/local/bin/sha256sum + brew install coreutils + # && ln -s $$(which gsha256sum) /usr/local/bin/sha256sum github-release: GO111MODULE=off go get -u github.com/aktau/github-release From 1cf83bbd24f9c29f036a8b9aaffc31ec747638b5 Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Mon, 12 Sep 2022 12:18:43 -0700 Subject: [PATCH 015/138] add installation of github-release --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index a49fa22c..2ac18589 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -126,6 +126,7 @@ jobs: # builing tools make -f Makefile.tools rpmbuild-darwin sha256sum-darwin # building releases + go get github.com/github-release/github-release make -f Makefile.release dist-darwin - run: name: Install nfpm, rpmbuild From f9c10895d254e8bbe60936e562d0c67b16ae3fcb Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Mon, 12 Sep 2022 12:27:07 -0700 Subject: [PATCH 016/138] add arm64 for mac in Makefie --- Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 078e38ca..54db98c4 100644 --- a/Makefile +++ b/Makefile @@ -10,7 +10,7 @@ LDFLAGS := -ldflags='-X "main.Version=$(VERSION)"' test: GO111MODULE=on go test -mod=vendor -v ./... -all: dist/aws-okta-$(VERSION)-darwin-amd64 dist/aws-okta-$(VERSION)-linux-amd64 +all: dist/aws-okta-$(VERSION)-darwin-amd64 dist/aws-okta-$(VERSION)-darwin-arm64 dist/aws-okta-$(VERSION)-linux-amd64 clean: rm -rf ./dist @@ -21,6 +21,9 @@ dist/: dist/aws-okta-$(VERSION)-darwin-amd64: | dist/ GOOS=darwin GOARCH=amd64 GO111MODULE=on go build -mod=vendor $(LDFLAGS) -o $@ +dist/aws-okta-$(VERSION)-darwin-arm64: | dist/ + GOOS=darwin GOARCH=arm64 GO111MODULE=on go build -mod=vendor $(LDFLAGS) -o $@ + dist/aws-okta-$(VERSION)-linux-amd64: | dist/ GOOS=linux GOARCH=amd64 GO111MODULE=on go build -mod=vendor $(LDFLAGS) -o $@ From 576d66b58228e2da25ad91d9a395043c0f01dc84 Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Mon, 12 Sep 2022 12:31:19 -0700 Subject: [PATCH 017/138] add changes in Makefile.release for arm64 support on Mac --- .circleci/config.yml | 10 +--------- Makefile.release | 26 ++++++++++++++++++-------- 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 2ac18589..601904a3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -113,7 +113,7 @@ jobs: steps: - checkout - run: - name: Install libusb and brew + name: Install libusb, brew, nfpm, rpmbuild and make distribution command: | # sudo brew upgrade brew # sudo brew install libusb @@ -128,14 +128,6 @@ jobs: # building releases go get github.com/github-release/github-release make -f Makefile.release dist-darwin - - run: - name: Install nfpm, rpmbuild - command: | - export PATH="$HOME/.linuxbrew/bin:$PATH" - - run: - name: Make distributables - command: | - export PATH="$HOME/.linuxbrew/bin:$PATH" - persist_to_workspace: root: . diff --git a/Makefile.release b/Makefile.release index ad982111..9579acfe 100644 --- a/Makefile.release +++ b/Makefile.release @@ -49,7 +49,7 @@ github-release: set -o pipefail; \ scripts/changelog | github-release release \ --security-token $$GH_LOGIN \ - --user segmentio \ + --user optimizely \ --repo aws-okta \ $(GITHUB_RELEASE_FLAGS) \ --tag $(VERSION) \ @@ -57,24 +57,34 @@ github-release: --name $(VERSION) || \ github-release info \ --security-token $$GH_LOGIN \ - --user segmentio \ + --user optimizely \ --repo aws-okta \ --tag $(VERSION) publish-github-darwin-bin: dist/aws-okta-$(VERSION)-darwin-amd64 | github-release github-release upload \ --security-token $$GH_LOGIN \ - --user segmentio \ + --user optimizely \ --repo aws-okta \ --tag $(VERSION) \ --name aws-okta-$(VERSION)-darwin-amd64 \ --replace \ --file $< +publish-github-darwin-bin: dist/aws-okta-$(VERSION)-darwin-arm64 | github-release + github-release upload \ + --security-token $$GH_LOGIN \ + --user optimizely \ + --repo aws-okta \ + --tag $(VERSION) \ + --name aws-okta-$(VERSION)-darwin-arm64 \ + --replace \ + --file $< + publish-github-linux-bin: dist/aws-okta-$(VERSION)-linux-amd64 | github-release github-release upload \ --security-token $$GH_LOGIN \ - --user segmentio \ + --user optimizely \ --repo aws-okta \ --tag $(VERSION) \ --name aws-okta-$(VERSION)-linux-amd64 \ @@ -84,7 +94,7 @@ publish-github-linux-bin: dist/aws-okta-$(VERSION)-linux-amd64 | github-release publish-github-deb: dist/aws-okta_$(VERSION)_amd64.deb | github-release github-release upload \ --security-token $$GH_LOGIN \ - --user segmentio \ + --user optimizely \ --repo aws-okta \ --tag $(VERSION) \ --name aws-okta_$(VERSION)_amd64.deb \ @@ -94,7 +104,7 @@ publish-github-deb: dist/aws-okta_$(VERSION)_amd64.deb | github-release publish-github-rpm: dist/aws-okta_$(VERSION)_amd64.rpm | github-release github-release upload \ --security-token $$GH_LOGIN \ - --user segmentio \ + --user optimizely \ --repo aws-okta \ --tag $(VERSION) \ --name aws-okta_$(VERSION)_amd64.rpm \ @@ -104,7 +114,7 @@ publish-github-rpm: dist/aws-okta_$(VERSION)_amd64.rpm | github-release publish-github-sha256sums: dist/aws-okta-$(VERSION).sha256sums | github-release github-release upload \ --security-token $$GH_LOGIN \ - --user segmentio \ + --user optimizely \ --repo aws-okta \ --tag $(VERSION) \ --name aws-okta-$(VERSION).sha256sums \ @@ -137,7 +147,7 @@ publish-packagecloud-rpm: dist/aws-okta_$(VERSION)_amd64.rpm packagecloud.conf.j dist: dist-darwin dist-linux dist/aws-okta-$(VERSION).sha256sums -dist-darwin: dist/aws-okta-$(VERSION)-darwin-amd64 +dist-darwin: dist/aws-okta-$(VERSION)-darwin-amd64 dist/aws-okta-$(VERSION)-darwin-arm64 dist-linux: dist/aws-okta-$(VERSION)-linux-amd64 dist/aws-okta_$(VERSION)_amd64.deb dist/aws-okta_$(VERSION)_amd64.rpm From da2b1508e75670715d525698e16803ed6c23b2ca Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Mon, 12 Sep 2022 12:51:35 -0700 Subject: [PATCH 018/138] add arm64 bin to the bottom list --- Makefile.release | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile.release b/Makefile.release index 9579acfe..6d3e042b 100644 --- a/Makefile.release +++ b/Makefile.release @@ -39,7 +39,7 @@ publish-linux: publish-github-linux publish-packagecloud publish-github: publish-github-darwin publish-github-linux publish-github-sha256sums -publish-github-darwin: publish-github-darwin-bin +publish-github-darwin: publish-github-darwin-bin publish-github-darwin-bin-arm6 publish-github-linux: publish-github-linux-bin publish-github-deb publish-github-rpm @@ -71,7 +71,7 @@ publish-github-darwin-bin: dist/aws-okta-$(VERSION)-darwin-amd64 | github-releas --replace \ --file $< -publish-github-darwin-bin: dist/aws-okta-$(VERSION)-darwin-arm64 | github-release +publish-github-darwin-bin-arm64: dist/aws-okta-$(VERSION)-darwin-arm64 | github-release github-release upload \ --security-token $$GH_LOGIN \ --user optimizely \ @@ -175,4 +175,5 @@ dist/aws-okta_$(VERSION)_amd64.rpm: dist/nfpm-$(VERSION).yaml dist/aws-okta-$(VE publish-github-deb \ publish-github-darwin \ publish-github-darwin-bin \ + publish-github-darwin-bin-arm64 \ github-release From 1b609cc835c62e618e88fed084dfb8d652ac7296 Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Mon, 12 Sep 2022 13:03:55 -0700 Subject: [PATCH 019/138] add option for arm64 build on linux --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 54db98c4..8bdb18b5 100644 --- a/Makefile +++ b/Makefile @@ -22,7 +22,7 @@ dist/aws-okta-$(VERSION)-darwin-amd64: | dist/ GOOS=darwin GOARCH=amd64 GO111MODULE=on go build -mod=vendor $(LDFLAGS) -o $@ dist/aws-okta-$(VERSION)-darwin-arm64: | dist/ - GOOS=darwin GOARCH=arm64 GO111MODULE=on go build -mod=vendor $(LDFLAGS) -o $@ + CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 GO111MODULE=on go build -mod=vendor $(LDFLAGS) -o $@ dist/aws-okta-$(VERSION)-linux-amd64: | dist/ GOOS=linux GOARCH=amd64 GO111MODULE=on go build -mod=vendor $(LDFLAGS) -o $@ From d924732baad7b11fb39482dd23814726c57b826b Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Mon, 12 Sep 2022 13:18:47 -0700 Subject: [PATCH 020/138] add a package for arm64 compile --- .circleci/config.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 601904a3..17e3813e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -113,7 +113,7 @@ jobs: steps: - checkout - run: - name: Install libusb, brew, nfpm, rpmbuild and make distribution + name: Install libusb, brew, nfpm, rpmbuild,llvm and make distribution command: | # sudo brew upgrade brew # sudo brew install libusb @@ -123,6 +123,7 @@ jobs: eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" export PATH="$HOME/.linuxbrew/bin:$PATH" which brew + brew install llvm # builing tools make -f Makefile.tools rpmbuild-darwin sha256sum-darwin # building releases From c000d6f76701049a7ad8240ddcc34f90ce7e918f Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Mon, 12 Sep 2022 13:19:36 -0700 Subject: [PATCH 021/138] remove the flag in makefile in attempt to make arm64 to compile on linux --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 8bdb18b5..54db98c4 100644 --- a/Makefile +++ b/Makefile @@ -22,7 +22,7 @@ dist/aws-okta-$(VERSION)-darwin-amd64: | dist/ GOOS=darwin GOARCH=amd64 GO111MODULE=on go build -mod=vendor $(LDFLAGS) -o $@ dist/aws-okta-$(VERSION)-darwin-arm64: | dist/ - CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 GO111MODULE=on go build -mod=vendor $(LDFLAGS) -o $@ + GOOS=darwin GOARCH=arm64 GO111MODULE=on go build -mod=vendor $(LDFLAGS) -o $@ dist/aws-okta-$(VERSION)-linux-amd64: | dist/ GOOS=linux GOARCH=amd64 GO111MODULE=on go build -mod=vendor $(LDFLAGS) -o $@ From 69da1f3f828498dd5d73aa77536d0702e7932668 Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Mon, 12 Sep 2022 14:06:52 -0700 Subject: [PATCH 022/138] switching build OS to macos --- .circleci/config.yml | 87 ++++++++++++++++++++++++++------------------ Makefile.tools | 2 +- 2 files changed, 53 insertions(+), 36 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 17e3813e..b76e8735 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -106,47 +106,64 @@ jobs: make -f Makefile.release publish-github-linux # ishih - my change, add job list: dist-darwin and publish-github-darwin - dist-darwin: - docker: - - image: circleci/golang:1.13 - working_directory: /go/src/github.com/optimizely/aws-okta - steps: +dist-darwin: + macos: + xcode: 12.5.1 # indicate our selected version of Xcode + resource_class: macos.x86.metal.gen1 # dedicated host, with 24-hour billing + steps: - checkout - run: - name: Install libusb, brew, nfpm, rpmbuild,llvm and make distribution - command: | - # sudo brew upgrade brew - # sudo brew install libusb - sudo apt update -q - sudo apt install -yq libusb-dev libusb-1.0.0-dev build-essential curl ruby - yes | ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install)" || true - eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" - export PATH="$HOME/.linuxbrew/bin:$PATH" - which brew - brew install llvm - # builing tools - make -f Makefile.tools rpmbuild-darwin sha256sum-darwin - # building releases - go get github.com/github-release/github-release - make -f Makefile.release dist-darwin - + name: install packages + command: | + yes | ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install)" || true + eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" + which brew + make -f Makefile.tools rpmbuild-darwin sha256sum-darwin + make -f Makefile.release dist-darwin - persist_to_workspace: root: . paths: ['dist/*'] + # dist-darwin: + # docker: + # - image: circleci/golang:1.17 + # working_directory: /go/src/github.com/optimizely/aws-okta + # steps: + # - checkout + # - run: + # name: Install libusb, brew, nfpm, rpmbuild,llvm and make distribution + # command: | + # # sudo brew upgrade brew + # # sudo brew install libusb + # sudo apt update -q + # sudo apt install -yq libusb-dev libusb-1.0.0-dev build-essential curl ruby + # yes | ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install)" || true + # eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" + # export PATH="$HOME/.linuxbrew/bin:$PATH" + # which brew + # # brew install llvm + # # builing tools + # make -f Makefile.tools rpmbuild-darwin sha256sum-darwin + # # building releases + # go get github.com/github-release/github-release + # make -f Makefile.release dist-darwin + + # - persist_to_workspace: + # root: . + # paths: ['dist/*'] - publish-github-darwin: - docker: - - image: circleci/golang:1.13 - working_directory: /go/src/github.com/optimizely/aws-okta - steps: - - checkout - - attach_workspace: { at: . } - - run: - name: Install tools - command: | - export PATH="$HOME/.linuxbrew/bin:$PATH" - make -f Makefile.tools github-release - make -f Makefile.release publish-github-darwin + # publish-github-darwin: + # docker: + # - image: circleci/golang:1.13 + # working_directory: /go/src/github.com/optimizely/aws-okta + # steps: + # - checkout + # - attach_workspace: { at: . } + # - run: + # name: Install tools + # command: | + # export PATH="$HOME/.linuxbrew/bin:$PATH" + # make -f Makefile.tools github-release + # make -f Makefile.release publish-github-darwin workflows: version: 2 diff --git a/Makefile.tools b/Makefile.tools index 6db0789b..8c35c641 100644 --- a/Makefile.tools +++ b/Makefile.tools @@ -21,7 +21,7 @@ rpmbuild-darwin: brew install rpm sha256sum-darwin: - brew install coreutils + brew install coreutils # && ln -s $$(which gsha256sum) /usr/local/bin/sha256sum github-release: From 5bc610cad84fde8c9efe1892e984465de1378d85 Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Mon, 12 Sep 2022 14:14:16 -0700 Subject: [PATCH 023/138] fixing spaces issues in config.yml --- .circleci/config.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b76e8735..e79bf2d5 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -113,13 +113,14 @@ dist-darwin: steps: - checkout - run: - name: install packages - command: | - yes | ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install)" || true - eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" - which brew - make -f Makefile.tools rpmbuild-darwin sha256sum-darwin - make -f Makefile.release dist-darwin + name: install packages + command: | + yes | ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install)" || true + eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" + which brew + brew install go@1.17 + make -f Makefile.tools rpmbuild-darwin sha256sum-darwin + make -f Makefile.release dist-darwin - persist_to_workspace: root: . paths: ['dist/*'] From 6d283e246cf0403c8088131c786e27c87e9ef915 Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Mon, 12 Sep 2022 14:16:44 -0700 Subject: [PATCH 024/138] uncomment code block that was commented out by accident in config.yml --- .circleci/config.yml | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e79bf2d5..6449778d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -110,6 +110,7 @@ dist-darwin: macos: xcode: 12.5.1 # indicate our selected version of Xcode resource_class: macos.x86.metal.gen1 # dedicated host, with 24-hour billing + working_directory: /go/src/github.com/optimizely/aws-okta steps: - checkout - run: @@ -152,19 +153,22 @@ dist-darwin: # root: . # paths: ['dist/*'] - # publish-github-darwin: - # docker: - # - image: circleci/golang:1.13 - # working_directory: /go/src/github.com/optimizely/aws-okta - # steps: - # - checkout - # - attach_workspace: { at: . } - # - run: - # name: Install tools - # command: | - # export PATH="$HOME/.linuxbrew/bin:$PATH" - # make -f Makefile.tools github-release - # make -f Makefile.release publish-github-darwin + publish-github-darwin: + # docker: + # - image: circleci/golang:1.13 + macos: + xcode: 12.5.1 # indicate our selected version of Xcode + resource_class: macos.x86.metal.gen1 # dedicated host, with 24-hour billing + working_directory: /go/src/github.com/optimizely/aws-okta + steps: + - checkout + - attach_workspace: { at: . } + - run: + name: Install tools + command: | + export PATH="$HOME/.linuxbrew/bin:$PATH" + make -f Makefile.tools github-release + make -f Makefile.release publish-github-darwin workflows: version: 2 From a41d2c1acbeaddc34693c4c422a4ea32bc41be85 Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Mon, 12 Sep 2022 14:18:17 -0700 Subject: [PATCH 025/138] uncomment code block that was commented out by accident in config.yml --- .circleci/config.yml | 40 +++++++++++++++++++--------------------- 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6449778d..6d9f1882 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -105,26 +105,25 @@ jobs: make -f Makefile.tools github-release make -f Makefile.release publish-github-linux -# ishih - my change, add job list: dist-darwin and publish-github-darwin -dist-darwin: - macos: - xcode: 12.5.1 # indicate our selected version of Xcode - resource_class: macos.x86.metal.gen1 # dedicated host, with 24-hour billing - working_directory: /go/src/github.com/optimizely/aws-okta - steps: - - checkout - - run: - name: install packages - command: | - yes | ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install)" || true - eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" - which brew - brew install go@1.17 - make -f Makefile.tools rpmbuild-darwin sha256sum-darwin - make -f Makefile.release dist-darwin - - persist_to_workspace: - root: . - paths: ['dist/*'] + # ishih - my change, add job list: dist-darwin and publish-github-darwin + dist-darwin: + macos: + xcode: 12.5.1 # indicate our selected version of Xcode + working_directory: /go/src/github.com/optimizely/aws-okta + steps: + - checkout + - run: + name: install packages + command: | + yes | ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install)" || true + eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" + which brew + brew install go@1.17 + make -f Makefile.tools rpmbuild-darwin sha256sum-darwin + make -f Makefile.release dist-darwin + - persist_to_workspace: + root: . + paths: ['dist/*'] # dist-darwin: # docker: # - image: circleci/golang:1.17 @@ -158,7 +157,6 @@ dist-darwin: # - image: circleci/golang:1.13 macos: xcode: 12.5.1 # indicate our selected version of Xcode - resource_class: macos.x86.metal.gen1 # dedicated host, with 24-hour billing working_directory: /go/src/github.com/optimizely/aws-okta steps: - checkout From e91c4d5cddbe0bfd394f9005699332c9f61394f8 Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Mon, 12 Sep 2022 14:20:32 -0700 Subject: [PATCH 026/138] uncomment code block that was commented out by accident in config.yml --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6d9f1882..06ab1b59 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -109,7 +109,7 @@ jobs: dist-darwin: macos: xcode: 12.5.1 # indicate our selected version of Xcode - working_directory: /go/src/github.com/optimizely/aws-okta + # working_directory: /go/src/github.com/optimizely/aws-okta steps: - checkout - run: @@ -157,7 +157,7 @@ jobs: # - image: circleci/golang:1.13 macos: xcode: 12.5.1 # indicate our selected version of Xcode - working_directory: /go/src/github.com/optimizely/aws-okta + # working_directory: /go/src/github.com/optimizely/aws-okta steps: - checkout - attach_workspace: { at: . } From 30b4369b27d94900539ac8fb1969f9f6fa911056 Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Mon, 12 Sep 2022 14:28:54 -0700 Subject: [PATCH 027/138] add go path config.yml --- .circleci/config.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 06ab1b59..5102a035 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -117,8 +117,9 @@ jobs: command: | yes | ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install)" || true eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" - which brew brew install go@1.17 + export PATH=/usr/local/opt/go@1.17/bin:$PATH + which go make -f Makefile.tools rpmbuild-darwin sha256sum-darwin make -f Makefile.release dist-darwin - persist_to_workspace: From 4a11c8acaad8f248fa2ac45091f490788d54bb06 Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Mon, 12 Sep 2022 14:40:37 -0700 Subject: [PATCH 028/138] dependency pkg install in config.yml --- .circleci/config.yml | 2 +- Makefile.tools | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5102a035..d49557ec 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -117,7 +117,7 @@ jobs: command: | yes | ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install)" || true eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" - brew install go@1.17 + brew install go@1.17 libusb nfpm export PATH=/usr/local/opt/go@1.17/bin:$PATH which go make -f Makefile.tools rpmbuild-darwin sha256sum-darwin diff --git a/Makefile.tools b/Makefile.tools index 8c35c641..d1167744 100644 --- a/Makefile.tools +++ b/Makefile.tools @@ -21,8 +21,7 @@ rpmbuild-darwin: brew install rpm sha256sum-darwin: - brew install coreutils - # && ln -s $$(which gsha256sum) /usr/local/bin/sha256sum + brew install coreutils && ln -s $$(which gsha256sum) /usr/local/bin/sha256sum github-release: GO111MODULE=off go get -u github.com/aktau/github-release From 4e29dc24641cfc86793bae31d54abece2f7ecc18 Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Mon, 12 Sep 2022 14:50:32 -0700 Subject: [PATCH 029/138] dependency pkg install in config.yml --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index d49557ec..c7b7ba98 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -118,7 +118,7 @@ jobs: yes | ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install)" || true eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" brew install go@1.17 libusb nfpm - export PATH=/usr/local/opt/go@1.17/bin:$PATH + export PATH=/usr/local/opt/go@1.17/bin:/usr/local/opt/coreutils/libexec/gnubin:$PATH which go make -f Makefile.tools rpmbuild-darwin sha256sum-darwin make -f Makefile.release dist-darwin From 6bec3acec231fc9dd5cc61dfa9f7ec5df2f036cc Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Mon, 12 Sep 2022 14:58:56 -0700 Subject: [PATCH 030/138] dependency pkg install in config.yml --- Makefile.tools | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile.tools b/Makefile.tools index d1167744..8c35c641 100644 --- a/Makefile.tools +++ b/Makefile.tools @@ -21,7 +21,8 @@ rpmbuild-darwin: brew install rpm sha256sum-darwin: - brew install coreutils && ln -s $$(which gsha256sum) /usr/local/bin/sha256sum + brew install coreutils + # && ln -s $$(which gsha256sum) /usr/local/bin/sha256sum github-release: GO111MODULE=off go get -u github.com/aktau/github-release From a741a025f845f1fce197237d33ed4d15669c8ce0 Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Mon, 12 Sep 2022 15:25:43 -0700 Subject: [PATCH 031/138] dependency pkg install in config.yml --- .circleci/config.yml | 4 ++-- nfpm.yaml.tmpl | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c7b7ba98..7857f35d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -117,9 +117,9 @@ jobs: command: | yes | ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install)" || true eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" - brew install go@1.17 libusb nfpm + brew install go@1.17 libusb export PATH=/usr/local/opt/go@1.17/bin:/usr/local/opt/coreutils/libexec/gnubin:$PATH - which go + go install github.com/goreleaser/nfpm/v2/cmd/nfpm@latest make -f Makefile.tools rpmbuild-darwin sha256sum-darwin make -f Makefile.release dist-darwin - persist_to_workspace: diff --git a/nfpm.yaml.tmpl b/nfpm.yaml.tmpl index 9ac5296a..cd4c7ec7 100644 --- a/nfpm.yaml.tmpl +++ b/nfpm.yaml.tmpl @@ -8,7 +8,7 @@ provides: - aws-okta vendor: 'Segment, Inc.' maintainer: tooling-team@segment.com -homepage: "https://github.com/segmentio/aws-okta" +homepage: "https://github.com/optimizely/aws-okta" license: "MIT" # IMHO packages should install to /usr/bin bindir: /usr/bin From 4ced03a265c9b1ac4da09887bffeaa442c72e624 Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Mon, 12 Sep 2022 15:45:29 -0700 Subject: [PATCH 032/138] dependency pkg install in config.yml --- .circleci/config.yml | 4 ++-- Makefile.tools | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7857f35d..464d3c36 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -94,7 +94,7 @@ jobs: # make -f Makefile.release publish-packagecloud publish-github-linux: docker: - - image: circleci/golang:1.13 + - image: circleci/golang:1.17 working_directory: /go/src/github.com/optimizely/aws-okta steps: - checkout @@ -119,7 +119,7 @@ jobs: eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" brew install go@1.17 libusb export PATH=/usr/local/opt/go@1.17/bin:/usr/local/opt/coreutils/libexec/gnubin:$PATH - go install github.com/goreleaser/nfpm/v2/cmd/nfpm@latest + # go install github.com/goreleaser/nfpm/v2/cmd/nfpm@latest make -f Makefile.tools rpmbuild-darwin sha256sum-darwin make -f Makefile.release dist-darwin - persist_to_workspace: diff --git a/Makefile.tools b/Makefile.tools index 8c35c641..ac442a75 100644 --- a/Makefile.tools +++ b/Makefile.tools @@ -2,7 +2,8 @@ # # These are fragile, non-portable, and often require root # -NFPM_VERSION := 0.9.3 +#NFPM_VERSION := 0.9.3 +NFPM_VERSION := 1.3.1 #from https://github.com/goreleaser/nfpm/releases/download/v0.9.3/nfpm_0.9.3_checksums.txt NFPM_SHA256 := f875ac060a30ec5c164e5444a7278322b276707493fa0ced6bfdd56640f0a6ea From ec017eee694ebf09915406db1aad94423e21e30a Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Mon, 12 Sep 2022 15:50:25 -0700 Subject: [PATCH 033/138] dependency pkg install in config.yml --- Makefile.tools | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile.tools b/Makefile.tools index ac442a75..35ab047e 100644 --- a/Makefile.tools +++ b/Makefile.tools @@ -3,9 +3,10 @@ # These are fragile, non-portable, and often require root # #NFPM_VERSION := 0.9.3 -NFPM_VERSION := 1.3.1 +NFPM_VERSION := 1.3.0 #from https://github.com/goreleaser/nfpm/releases/download/v0.9.3/nfpm_0.9.3_checksums.txt -NFPM_SHA256 := f875ac060a30ec5c164e5444a7278322b276707493fa0ced6bfdd56640f0a6ea +# NFPM_SHA256 := f875ac060a30ec5c164e5444a7278322b276707493fa0ced6bfdd56640f0a6ea +NFPM_SHA256 := b184973c91ce257890a43093e3e44a6f8c409eb60f7d26cbd56e706cc50fd919 nfpm-debian: cd /tmp && \ From c91908abc86b3be24d729750f62ab665113bbca9 Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Mon, 12 Sep 2022 15:53:29 -0700 Subject: [PATCH 034/138] dependency pkg install in config.yml --- Makefile.tools | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile.tools b/Makefile.tools index 35ab047e..85feb1c5 100644 --- a/Makefile.tools +++ b/Makefile.tools @@ -3,10 +3,10 @@ # These are fragile, non-portable, and often require root # #NFPM_VERSION := 0.9.3 -NFPM_VERSION := 1.3.0 +NFPM_VERSION := 1.2.1 #from https://github.com/goreleaser/nfpm/releases/download/v0.9.3/nfpm_0.9.3_checksums.txt # NFPM_SHA256 := f875ac060a30ec5c164e5444a7278322b276707493fa0ced6bfdd56640f0a6ea -NFPM_SHA256 := b184973c91ce257890a43093e3e44a6f8c409eb60f7d26cbd56e706cc50fd919 +NFPM_SHA256 := 4659e714cc3d1fc1fa3ba75bb531901b0d2a89e5f59171145fb89bf1d392cb29 nfpm-debian: cd /tmp && \ From 1ce60d3a423ad1f2e5342c262c29bb1cb97a208f Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Mon, 12 Sep 2022 15:55:25 -0700 Subject: [PATCH 035/138] dependency pkg install in config.yml --- Makefile.tools | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.tools b/Makefile.tools index 85feb1c5..ffabc97d 100644 --- a/Makefile.tools +++ b/Makefile.tools @@ -3,7 +3,7 @@ # These are fragile, non-portable, and often require root # #NFPM_VERSION := 0.9.3 -NFPM_VERSION := 1.2.1 +NFPM_VERSION := 1.2.0 #from https://github.com/goreleaser/nfpm/releases/download/v0.9.3/nfpm_0.9.3_checksums.txt # NFPM_SHA256 := f875ac060a30ec5c164e5444a7278322b276707493fa0ced6bfdd56640f0a6ea NFPM_SHA256 := 4659e714cc3d1fc1fa3ba75bb531901b0d2a89e5f59171145fb89bf1d392cb29 From 9670b0f91c188d460a45c398c3d4a0283174734c Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Mon, 12 Sep 2022 16:06:31 -0700 Subject: [PATCH 036/138] dependency pkg install in config.yml --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 464d3c36..fbb08337 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -118,7 +118,7 @@ jobs: yes | ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install)" || true eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" brew install go@1.17 libusb - export PATH=/usr/local/opt/go@1.17/bin:/usr/local/opt/coreutils/libexec/gnubin:$PATH + export PATH=/usr/local/opt/go@1.17/bin:/usr/local/opt/coreutils/libexec/gnubin:/usr/local/bin:$PATH # go install github.com/goreleaser/nfpm/v2/cmd/nfpm@latest make -f Makefile.tools rpmbuild-darwin sha256sum-darwin make -f Makefile.release dist-darwin From 049443d32bfb325bb15c0d8bd45357f2946c104d Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Mon, 12 Sep 2022 16:11:23 -0700 Subject: [PATCH 037/138] dependency pkg install in config.yml --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index fbb08337..beb07350 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -120,6 +120,7 @@ jobs: brew install go@1.17 libusb export PATH=/usr/local/opt/go@1.17/bin:/usr/local/opt/coreutils/libexec/gnubin:/usr/local/bin:$PATH # go install github.com/goreleaser/nfpm/v2/cmd/nfpm@latest + go install github.com/goreleaser/nfpm/v2/cmd/nfpm@@1.20 make -f Makefile.tools rpmbuild-darwin sha256sum-darwin make -f Makefile.release dist-darwin - persist_to_workspace: From 68343325744497142428f2dcbbe7a49a222c7d60 Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Mon, 12 Sep 2022 16:24:41 -0700 Subject: [PATCH 038/138] dependency pkg install in config.yml --- .circleci/config.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index beb07350..c7c79454 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -120,7 +120,8 @@ jobs: brew install go@1.17 libusb export PATH=/usr/local/opt/go@1.17/bin:/usr/local/opt/coreutils/libexec/gnubin:/usr/local/bin:$PATH # go install github.com/goreleaser/nfpm/v2/cmd/nfpm@latest - go install github.com/goreleaser/nfpm/v2/cmd/nfpm@@1.20 + curl -Ls https://github.com/goreleaser/nfpm/releases/download/v1.2.0/nfpm_1.2.0_Darwin_x86_64.tar.gz > nfpm.tar.gz + tar xzvf nfpm.tar.gz && mv nfpm /usr/local/bin make -f Makefile.tools rpmbuild-darwin sha256sum-darwin make -f Makefile.release dist-darwin - persist_to_workspace: From 1af1c016edbed4cc00ddc05e67761c351d275715 Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Mon, 12 Sep 2022 16:40:06 -0700 Subject: [PATCH 039/138] now all gree, clean up code in config.yml --- .circleci/config.yml | 69 ++++++++++++-------------------------------- 1 file changed, 19 insertions(+), 50 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c7c79454..031627db 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -74,24 +74,24 @@ jobs: root: . paths: ['dist/*'] - # publish-packagecloud: - # docker: - # - image: circleci/golang:1.13 - # working_directory: /go/src/github.com/optimizely/aws-okta - # steps: - # - checkout - # - attach_workspace: { at: . } - # - run: - # name: Install tools - # command: | - # make -f Makefile.tools github-release - # # this is all for package_cloud :/ - # sudo apt update -q - # sudo apt install -yq ruby ruby-dev build-essential - # # fixes https://askubuntu.com/questions/872399/error-failed-to-build-gem-native-extension-when-trying-to-download-rubocop - # sudo gem install rake - # sudo make -f Makefile.tools package_cloud - # make -f Makefile.release publish-packagecloud + publish-packagecloud: + docker: + - image: circleci/golang:1.13 + working_directory: /go/src/github.com/optimizely/aws-okta + steps: + - checkout + - attach_workspace: { at: . } + - run: + name: Install tools + command: | + make -f Makefile.tools github-release + # this is all for package_cloud :/ + sudo apt update -q + sudo apt install -yq ruby ruby-dev build-essential + # fixes https://askubuntu.com/questions/872399/error-failed-to-build-gem-native-extension-when-trying-to-download-rubocop + sudo gem install rake + sudo make -f Makefile.tools package_cloud + make -f Makefile.release publish-packagecloud publish-github-linux: docker: - image: circleci/golang:1.17 @@ -127,47 +127,16 @@ jobs: - persist_to_workspace: root: . paths: ['dist/*'] - # dist-darwin: - # docker: - # - image: circleci/golang:1.17 - # working_directory: /go/src/github.com/optimizely/aws-okta - # steps: - # - checkout - # - run: - # name: Install libusb, brew, nfpm, rpmbuild,llvm and make distribution - # command: | - # # sudo brew upgrade brew - # # sudo brew install libusb - # sudo apt update -q - # sudo apt install -yq libusb-dev libusb-1.0.0-dev build-essential curl ruby - # yes | ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install)" || true - # eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" - # export PATH="$HOME/.linuxbrew/bin:$PATH" - # which brew - # # brew install llvm - # # builing tools - # make -f Makefile.tools rpmbuild-darwin sha256sum-darwin - # # building releases - # go get github.com/github-release/github-release - # make -f Makefile.release dist-darwin - - # - persist_to_workspace: - # root: . - # paths: ['dist/*'] - publish-github-darwin: - # docker: - # - image: circleci/golang:1.13 macos: xcode: 12.5.1 # indicate our selected version of Xcode - # working_directory: /go/src/github.com/optimizely/aws-okta steps: - checkout - attach_workspace: { at: . } - run: name: Install tools command: | - export PATH="$HOME/.linuxbrew/bin:$PATH" + echo "====== publish-github-darwin =====" make -f Makefile.tools github-release make -f Makefile.release publish-github-darwin From d69b9e614a7ba98e28079645ce9d079145bbb273 Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Mon, 12 Sep 2022 16:55:41 -0700 Subject: [PATCH 040/138] now all gree, clean up code in config.yml --- .circleci/config.yml | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 031627db..b69625d0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -122,7 +122,13 @@ jobs: # go install github.com/goreleaser/nfpm/v2/cmd/nfpm@latest curl -Ls https://github.com/goreleaser/nfpm/releases/download/v1.2.0/nfpm_1.2.0_Darwin_x86_64.tar.gz > nfpm.tar.gz tar xzvf nfpm.tar.gz && mv nfpm /usr/local/bin + - run: + name: make tools for macos + command: | make -f Makefile.tools rpmbuild-darwin sha256sum-darwin + - run: + name: make distribution + command: | make -f Makefile.release dist-darwin - persist_to_workspace: root: . @@ -145,7 +151,7 @@ workflows: # currently we only build/publish for linux: macOS builds require non-FOSS # Keychain libs that require a macOS host to build on # https://github.com/optimizely/aws-okta/issues/81 - test-dist-publish-linux: + test-dist-publish: jobs: - test - test-build-golang-prev @@ -159,17 +165,17 @@ workflows: filters: tags: only: /.*/ - # - publish-packagecloud: - # context: packagecloud - # requires: - # - dist-linux - # filters: - # # never publish from a branch event - # branches: - # ignore: /.*/ - # # release only on tag push events like vX[.Y.Z...][-whatever] - # tags: - # only: /v[0-9]+(\.[0-9]+)*(-[a-zA-Z0-9-]+)?/ + - publish-packagecloud: + context: packagecloud + requires: + - dist-linux dist-darwin + filters: + # never publish from a branch event + branches: + ignore: /.*/ + # release only on tag push events like vX[.Y.Z...][-whatever] + tags: + only: /v[0-9]+(\.[0-9]+)*(-[a-zA-Z0-9-]+)?/ - publish-github-linux: context: github-optimizelycircle-oss-release requires: From 223dcb45b0953fbe7e24497fab455d9c0286c1a7 Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Mon, 12 Sep 2022 16:56:29 -0700 Subject: [PATCH 041/138] now all gree, clean up code in config.yml --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b69625d0..5e68195c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -168,7 +168,7 @@ workflows: - publish-packagecloud: context: packagecloud requires: - - dist-linux dist-darwin + - dist-linux, dist-darwin filters: # never publish from a branch event branches: From f4000a9d04690c6523b9fb45097f4758c48c842c Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Mon, 12 Sep 2022 16:57:09 -0700 Subject: [PATCH 042/138] now all gree, clean up code in config.yml --- .circleci/config.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5e68195c..93669ae3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -165,17 +165,17 @@ workflows: filters: tags: only: /.*/ - - publish-packagecloud: - context: packagecloud - requires: - - dist-linux, dist-darwin - filters: - # never publish from a branch event - branches: - ignore: /.*/ - # release only on tag push events like vX[.Y.Z...][-whatever] - tags: - only: /v[0-9]+(\.[0-9]+)*(-[a-zA-Z0-9-]+)?/ + # - publish-packagecloud: + # context: packagecloud + # requires: + # - dist-linux, dist-darwin + # filters: + # # never publish from a branch event + # branches: + # ignore: /.*/ + # # release only on tag push events like vX[.Y.Z...][-whatever] + # tags: + # only: /v[0-9]+(\.[0-9]+)*(-[a-zA-Z0-9-]+)?/ - publish-github-linux: context: github-optimizelycircle-oss-release requires: From 73930283366f895a7a0bdac6f684f2e1257277e2 Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Tue, 13 Sep 2022 14:15:41 -0700 Subject: [PATCH 043/138] fix pkg cloud --- .circleci/config.yml | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 93669ae3..58c9a1f2 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -165,17 +165,18 @@ workflows: filters: tags: only: /.*/ - # - publish-packagecloud: - # context: packagecloud - # requires: - # - dist-linux, dist-darwin - # filters: - # # never publish from a branch event - # branches: - # ignore: /.*/ - # # release only on tag push events like vX[.Y.Z...][-whatever] - # tags: - # only: /v[0-9]+(\.[0-9]+)*(-[a-zA-Z0-9-]+)?/ + - publish-packagecloud: + context: packagecloud + requires: + - dist-linux + - dist-darwin + filters: + # never publish from a branch event + branches: + ignore: /.*/ + # release only on tag push events like vX[.Y.Z...][-whatever] + tags: + only: /v[0-9]+(\.[0-9]+)*(-[a-zA-Z0-9-]+)?/ - publish-github-linux: context: github-optimizelycircle-oss-release requires: From ac68fa1fb0384a9bb1b4b6d7593d95f0742663a6 Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Tue, 13 Sep 2022 14:24:27 -0700 Subject: [PATCH 044/138] fix step dependency --- .circleci/config.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 58c9a1f2..5f0d6c94 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -123,12 +123,12 @@ jobs: curl -Ls https://github.com/goreleaser/nfpm/releases/download/v1.2.0/nfpm_1.2.0_Darwin_x86_64.tar.gz > nfpm.tar.gz tar xzvf nfpm.tar.gz && mv nfpm /usr/local/bin - run: - name: make tools for macos + name: make tools for macos and distribution command: | make -f Makefile.tools rpmbuild-darwin sha256sum-darwin - - run: - name: make distribution - command: | + # - run: + # name: make distribution + # command: | make -f Makefile.release dist-darwin - persist_to_workspace: root: . From 279be1864b39aa59ca1cb7f35e042827fe4f168e Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Tue, 13 Sep 2022 15:01:31 -0700 Subject: [PATCH 045/138] fix step dependency --- .circleci/config.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5f0d6c94..d4d54570 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -125,10 +125,12 @@ jobs: - run: name: make tools for macos and distribution command: | + export PATH=/usr/local/opt/go@1.17/bin:/usr/local/opt/coreutils/libexec/gnubin:/usr/local/bin:$PATH make -f Makefile.tools rpmbuild-darwin sha256sum-darwin - # - run: - # name: make distribution - # command: | + - run: + name: make distribution + command: | + export PATH=/usr/local/opt/go@1.17/bin:/usr/local/opt/coreutils/libexec/gnubin:/usr/local/bin:$PATH make -f Makefile.release dist-darwin - persist_to_workspace: root: . From 8dabd0c9eaeb8be97d609f62d367f0f5aaf4ad11 Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Tue, 13 Sep 2022 15:25:57 -0700 Subject: [PATCH 046/138] update segment to optimizely in Makefile.release for package cloud --- .circleci/config.yml | 4 ++-- Makefile.release | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index d4d54570..6f786f57 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -50,7 +50,6 @@ jobs: git status exit 1 fi - dist-linux: docker: - image: circleci/golang:1.13 @@ -123,7 +122,7 @@ jobs: curl -Ls https://github.com/goreleaser/nfpm/releases/download/v1.2.0/nfpm_1.2.0_Darwin_x86_64.tar.gz > nfpm.tar.gz tar xzvf nfpm.tar.gz && mv nfpm /usr/local/bin - run: - name: make tools for macos and distribution + name: make tools for macos command: | export PATH=/usr/local/opt/go@1.17/bin:/usr/local/opt/coreutils/libexec/gnubin:/usr/local/bin:$PATH make -f Makefile.tools rpmbuild-darwin sha256sum-darwin @@ -145,6 +144,7 @@ jobs: name: Install tools command: | echo "====== publish-github-darwin =====" + export PATH=/usr/local/opt/go@1.17/bin:/usr/local/opt/coreutils/libexec/gnubin:/usr/local/bin:$PATH make -f Makefile.tools github-release make -f Makefile.release publish-github-darwin diff --git a/Makefile.release b/Makefile.release index 6d3e042b..7970ebf8 100644 --- a/Makefile.release +++ b/Makefile.release @@ -130,18 +130,18 @@ packagecloud.conf.json: publish-packagecloud-deb: dist/aws-okta_$(VERSION)_amd64.deb packagecloud.conf.json @set -o pipefail; \ for v in $(PACKAGECLOUD_DEB_DISTROS); do \ - (package_cloud yank --config packagecloud.conf.json segment/aws-okta$(PACKAGECLOUD_NAME_SUFFIX)/$$v aws-okta_$(VERSION_NO_V)_amd64.deb || true) | \ + (package_cloud yank --config packagecloud.conf.json optimizely/aws-okta$(PACKAGECLOUD_NAME_SUFFIX)/$$v aws-okta_$(VERSION_NO_V)_amd64.deb || true) | \ grep -v 'with token:' || true ; \ - package_cloud push --config packagecloud.conf.json segment/aws-okta$(PACKAGECLOUD_NAME_SUFFIX)/$$v $< | \ + package_cloud push --config packagecloud.conf.json optimizely/aws-okta$(PACKAGECLOUD_NAME_SUFFIX)/$$v $< | \ grep -v 'with token:' ; \ done publish-packagecloud-rpm: dist/aws-okta_$(VERSION)_amd64.rpm packagecloud.conf.json @set -o pipefail; \ for v in $(PACKAGECLOUD_RPM_DISTROS); do \ - (package_cloud yank --config packagecloud.conf.json segment/aws-okta$(PACKAGECLOUD_NAME_SUFFIX)/$$v aws-okta-$(subst -,_,$(VERSION_NO_V))-1.x86_64.rpm || true) | \ + (package_cloud yank --config packagecloud.conf.json optimizely/aws-okta$(PACKAGECLOUD_NAME_SUFFIX)/$$v aws-okta-$(subst -,_,$(VERSION_NO_V))-1.x86_64.rpm || true) | \ grep -v 'with token:' || true ; \ - package_cloud push --config packagecloud.conf.json segment/aws-okta$(PACKAGECLOUD_NAME_SUFFIX)/$$v $< | \ + package_cloud push --config packagecloud.conf.json optimizely/aws-okta$(PACKAGECLOUD_NAME_SUFFIX)/$$v $< | \ grep -v 'with token:' ; \ done From b3a1cad2ca095d6f289ae9ebd291328499d89633 Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Tue, 13 Sep 2022 15:37:40 -0700 Subject: [PATCH 047/138] changing publish code for darwins --- .circleci/config.yml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6f786f57..c2059ad0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -104,11 +104,10 @@ jobs: make -f Makefile.tools github-release make -f Makefile.release publish-github-linux - # ishih - my change, add job list: dist-darwin and publish-github-darwin + # ishih-opti - my change, add job list: dist-darwin and publish-github-darwin dist-darwin: macos: xcode: 12.5.1 # indicate our selected version of Xcode - # working_directory: /go/src/github.com/optimizely/aws-okta steps: - checkout - run: @@ -131,6 +130,13 @@ jobs: command: | export PATH=/usr/local/opt/go@1.17/bin:/usr/local/opt/coreutils/libexec/gnubin:/usr/local/bin:$PATH make -f Makefile.release dist-darwin + - run: + name: make git release + command: | + echo "====== publish-github-darwin =====" + export PATH=/usr/local/opt/go@1.17/bin:/usr/local/opt/coreutils/libexec/gnubin:/usr/local/bin:$PATH + make -f Makefile.tools github-release + make -f Makefile.release publish-github-darwin - persist_to_workspace: root: . paths: ['dist/*'] @@ -143,10 +149,10 @@ jobs: - run: name: Install tools command: | - echo "====== publish-github-darwin =====" - export PATH=/usr/local/opt/go@1.17/bin:/usr/local/opt/coreutils/libexec/gnubin:/usr/local/bin:$PATH - make -f Makefile.tools github-release - make -f Makefile.release publish-github-darwin + echo "====== the end =====" + # export PATH=/usr/local/opt/go@1.17/bin:/usr/local/opt/coreutils/libexec/gnubin:/usr/local/bin:$PATH + # make -f Makefile.tools github-release + # make -f Makefile.release publish-github-darwin workflows: version: 2 From 0f826f975ed1edf596a3a099abe98e394d34d0e7 Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Tue, 13 Sep 2022 15:53:50 -0700 Subject: [PATCH 048/138] fixing things for github-release --- Makefile.tools | 2 +- go.mod | 6 ++++++ go.sum | 12 ++++++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/Makefile.tools b/Makefile.tools index ffabc97d..4705da3f 100644 --- a/Makefile.tools +++ b/Makefile.tools @@ -27,7 +27,7 @@ sha256sum-darwin: # && ln -s $$(which gsha256sum) /usr/local/bin/sha256sum github-release: - GO111MODULE=off go get -u github.com/aktau/github-release + GO111MODULE=off go install github.com/aktau/github-release package_cloud: gem install package_cloud diff --git a/go.mod b/go.mod index b563f361..a3b1cb4b 100644 --- a/go.mod +++ b/go.mod @@ -2,11 +2,15 @@ module github.com/segmentio/aws-okta require ( github.com/99designs/keyring v1.1.6 + github.com/aktau/github-release v0.10.0 // indirect github.com/alessio/shellescape v0.0.0-20190409004728-b115ca0f9053 github.com/aws/aws-sdk-go v1.25.35 github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 // indirect + github.com/dustin/go-humanize v1.0.0 // indirect + github.com/github-release/github-release v0.10.0 // indirect github.com/inconshreveable/mousetrap v1.0.0 // indirect github.com/karalabe/hid v1.0.0 // indirect + github.com/kevinburke/rest v0.0.0-20210506044642-5611499aa33c // indirect github.com/konsorten/go-windows-terminal-sequences v1.0.2 // indirect github.com/marshallbrekka/go-u2fhost v0.0.0-20200114212649-cc764c209ee9 github.com/mitchellh/go-homedir v1.1.0 @@ -18,7 +22,9 @@ require ( github.com/spf13/cobra v0.0.0-20170621173259-31694f19adee github.com/spf13/pflag v1.0.0 // indirect github.com/stretchr/testify v1.3.0 + github.com/tomnomnom/linkheader v0.0.0-20180905144013-02ca5825eb80 // indirect github.com/vaughan0/go-ini v0.0.0-20130923145212-a98ad7ee00ec + github.com/voxelbrain/goptions v0.0.0-20180630082107-58cddc247ea2 // indirect github.com/xtgo/uuid v0.0.0-20140804021211-a0b114877d4c // indirect golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4 golang.org/x/net v0.0.0-20190628185345-da137c7871d7 diff --git a/go.sum b/go.sum index 28b4f38d..f4484bab 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,7 @@ github.com/99designs/keyring v1.1.6 h1:kVDC2uCgVwecxCk+9zoCt2uEL6dt+dfVzMvGgnVcIuM= github.com/99designs/keyring v1.1.6/go.mod h1:16e0ds7LGQQcT59QqkTg72Hh5ShM51Byv5PEmW6uoRU= +github.com/aktau/github-release v0.10.0 h1:4U+9iRM7n094ZCROdnoah084FDmdQ01hwQsz0f0hwIw= +github.com/aktau/github-release v0.10.0/go.mod h1:cPkP83iRnV8pAJyQlQ4vjLJoC+JE+aT5sOrYz3sTsX0= github.com/alessio/shellescape v0.0.0-20190409004728-b115ca0f9053 h1:H/GMMKYPkEIC3DF/JWQz8Pdd+Feifov2EIgGfNpeogI= github.com/alessio/shellescape v0.0.0-20190409004728-b115ca0f9053/go.mod h1:xW8sBma2LE3QxFSzCnH9qe6gAE2yO9GvQaWwX89HxbE= github.com/aws/aws-sdk-go v1.25.35 h1:fe2tJnqty/v/50pyngKdNk/NP8PFphYDA1Z7N3EiiiE= @@ -11,8 +13,12 @@ github.com/danieljoos/wincred v1.0.2/go.mod h1:SnuYRW9lp1oJrZX/dXJqr0cPK5gYXqx3E github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo= +github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dvsekhvalnov/jose2go v0.0.0-20200901110807-248326c1351b h1:HBah4D48ypg3J7Np4N+HY/ZR76fx3HEUGxDU6Uk39oQ= github.com/dvsekhvalnov/jose2go v0.0.0-20200901110807-248326c1351b/go.mod h1:7BvyPhdbLxMXIYTFPLsyJRFMsKmOZnQmzh6Gb+uquuM= +github.com/github-release/github-release v0.10.0 h1:nJ3oEV2JrC0brYi6B8CsXumn/ORFeiAEOB2fwN9epOw= +github.com/github-release/github-release v0.10.0/go.mod h1:CcaWgA5VoBGz94mOHYIXavqUA8kADNZxU+5/oDQxF6o= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 h1:ZpnhV/YsD2/4cESfV5+Hoeu/iUR3ruzNvZ+yQfO03a0= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= @@ -27,6 +33,8 @@ github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7 github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/karalabe/hid v1.0.0 h1:+/CIMNXhSU/zIJgnIvBD2nKHxS/bnRHhhs9xBryLpPo= github.com/karalabe/hid v1.0.0/go.mod h1:Vr51f8rUOLYrfrWDFlV12GGQgM5AT8sVh+2fY4MPeu8= +github.com/kevinburke/rest v0.0.0-20210506044642-5611499aa33c h1:hnbwWED5rIu+UaMkLR3JtnscMVGqp35lfzQwLuZAAUY= +github.com/kevinburke/rest v0.0.0-20210506044642-5611499aa33c/go.mod h1:pD+iEcdAGVXld5foVN4e24zb/6fnb60tgZPZ3P/3T/I= github.com/keybase/go-keychain v0.0.0-20190712205309-48d3d31d256d h1:Z+RDyXzjKE0i2sTjZ/b1uxiGtPhFy34Ou/Tk0qwN0kM= github.com/keybase/go-keychain v0.0.0-20190712205309-48d3d31d256d/go.mod h1:JJNrCn9otv/2QP4D7SMJBgaleKpOf66PnW6F5WGNRIc= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -68,8 +76,12 @@ github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoH github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/tomnomnom/linkheader v0.0.0-20180905144013-02ca5825eb80 h1:nrZ3ySNYwJbSpD6ce9duiP+QkD3JuLCcWkdaehUS/3Y= +github.com/tomnomnom/linkheader v0.0.0-20180905144013-02ca5825eb80/go.mod h1:iFyPdL66DjUD96XmzVL3ZntbzcflLnznH0fr99w5VqE= github.com/vaughan0/go-ini v0.0.0-20130923145212-a98ad7ee00ec h1:DGmKwyZwEB8dI7tbLt/I/gQuP559o/0FrAkHKlQM/Ks= github.com/vaughan0/go-ini v0.0.0-20130923145212-a98ad7ee00ec/go.mod h1:owBmyHYMLkxyrugmfwE/DLJyW8Ro9mkphwuVErQ0iUw= +github.com/voxelbrain/goptions v0.0.0-20180630082107-58cddc247ea2 h1:txplJASvd6b/hrE0s/Ixfpp2cuwH9IO9oZBAN9iYa4A= +github.com/voxelbrain/goptions v0.0.0-20180630082107-58cddc247ea2/go.mod h1:DGCIhurYgnLz8J9ga1fMV/fbLDyUvTyrWXVWUIyJon4= github.com/xtgo/uuid v0.0.0-20140804021211-a0b114877d4c h1:3lbZUMbMiGUW/LMkfsEABsc5zNT9+b1CvsJx47JzJ8g= github.com/xtgo/uuid v0.0.0-20140804021211-a0b114877d4c/go.mod h1:UrdRz5enIKZ63MEE3IF9l2/ebyx59GyGgPi+tICQdmM= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 h1:VklqNMn3ovrHsnt90PveolxSbWFaJdECFbxSq0Mqo2M= From 9328c654039996d2491ef333f17dd6d9fbc14969 Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Tue, 13 Sep 2022 16:07:29 -0700 Subject: [PATCH 049/138] cleanup in Makefile.tools --- Makefile.tools | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Makefile.tools b/Makefile.tools index 4705da3f..c1588475 100644 --- a/Makefile.tools +++ b/Makefile.tools @@ -2,10 +2,8 @@ # # These are fragile, non-portable, and often require root # -#NFPM_VERSION := 0.9.3 NFPM_VERSION := 1.2.0 -#from https://github.com/goreleaser/nfpm/releases/download/v0.9.3/nfpm_0.9.3_checksums.txt -# NFPM_SHA256 := f875ac060a30ec5c164e5444a7278322b276707493fa0ced6bfdd56640f0a6ea +#from https://github.com/goreleaser/nfpm/releases/download/v1.2.0/nfpm_1.2.0_checksums.txt NFPM_SHA256 := 4659e714cc3d1fc1fa3ba75bb531901b0d2a89e5f59171145fb89bf1d392cb29 nfpm-debian: From 675c7f3d55c76ff641d167f3db8355d05e41d7a8 Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Tue, 13 Sep 2022 16:16:37 -0700 Subject: [PATCH 050/138] cleanup in Makefile.tools --- Makefile.tools | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile.tools b/Makefile.tools index c1588475..7c94d9d2 100644 --- a/Makefile.tools +++ b/Makefile.tools @@ -3,7 +3,7 @@ # These are fragile, non-portable, and often require root # NFPM_VERSION := 1.2.0 -#from https://github.com/goreleaser/nfpm/releases/download/v1.2.0/nfpm_1.2.0_checksums.txt +#from https://github.com/goreleaser/nfpm/releases/download/v0.9.3/nfpm_1.2.0_checksums.txt NFPM_SHA256 := 4659e714cc3d1fc1fa3ba75bb531901b0d2a89e5f59171145fb89bf1d392cb29 nfpm-debian: @@ -25,7 +25,7 @@ sha256sum-darwin: # && ln -s $$(which gsha256sum) /usr/local/bin/sha256sum github-release: - GO111MODULE=off go install github.com/aktau/github-release + GO111MODULE=off go get -d github.com/aktau/github-release package_cloud: gem install package_cloud From 075892d267ff686a4a1de066f40b35ad06498786 Mon Sep 17 00:00:00 2001 From: Ivy Shih <97625966+ishih-opti@users.noreply.github.com> Date: Wed, 14 Sep 2022 09:15:31 -0700 Subject: [PATCH 051/138] Add .circleci/config.yml --- .circleci/config.yml | 90 ++++++-------------------------------------- 1 file changed, 11 insertions(+), 79 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c2059ad0..e741da9f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -20,7 +20,7 @@ jobs: test: docker: - image: circleci/golang:1.13 - working_directory: /go/src/github.com/optimizely/aws-okta + working_directory: /go/src/github.com/segmentio/aws-okta steps: - run: # Do this prior to checkout so that it doesn't modify go.mod file. @@ -50,10 +50,11 @@ jobs: git status exit 1 fi + dist-linux: docker: - image: circleci/golang:1.13 - working_directory: /go/src/github.com/optimizely/aws-okta + working_directory: /go/src/github.com/segmentio/aws-okta steps: - checkout - run: @@ -76,7 +77,7 @@ jobs: publish-packagecloud: docker: - image: circleci/golang:1.13 - working_directory: /go/src/github.com/optimizely/aws-okta + working_directory: /go/src/github.com/segmentio/aws-okta steps: - checkout - attach_workspace: { at: . } @@ -91,10 +92,11 @@ jobs: sudo gem install rake sudo make -f Makefile.tools package_cloud make -f Makefile.release publish-packagecloud + publish-github-linux: docker: - - image: circleci/golang:1.17 - working_directory: /go/src/github.com/optimizely/aws-okta + - image: circleci/golang:1.13 + working_directory: /go/src/github.com/segmentio/aws-okta steps: - checkout - attach_workspace: { at: . } @@ -104,62 +106,12 @@ jobs: make -f Makefile.tools github-release make -f Makefile.release publish-github-linux - # ishih-opti - my change, add job list: dist-darwin and publish-github-darwin - dist-darwin: - macos: - xcode: 12.5.1 # indicate our selected version of Xcode - steps: - - checkout - - run: - name: install packages - command: | - yes | ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install)" || true - eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" - brew install go@1.17 libusb - export PATH=/usr/local/opt/go@1.17/bin:/usr/local/opt/coreutils/libexec/gnubin:/usr/local/bin:$PATH - # go install github.com/goreleaser/nfpm/v2/cmd/nfpm@latest - curl -Ls https://github.com/goreleaser/nfpm/releases/download/v1.2.0/nfpm_1.2.0_Darwin_x86_64.tar.gz > nfpm.tar.gz - tar xzvf nfpm.tar.gz && mv nfpm /usr/local/bin - - run: - name: make tools for macos - command: | - export PATH=/usr/local/opt/go@1.17/bin:/usr/local/opt/coreutils/libexec/gnubin:/usr/local/bin:$PATH - make -f Makefile.tools rpmbuild-darwin sha256sum-darwin - - run: - name: make distribution - command: | - export PATH=/usr/local/opt/go@1.17/bin:/usr/local/opt/coreutils/libexec/gnubin:/usr/local/bin:$PATH - make -f Makefile.release dist-darwin - - run: - name: make git release - command: | - echo "====== publish-github-darwin =====" - export PATH=/usr/local/opt/go@1.17/bin:/usr/local/opt/coreutils/libexec/gnubin:/usr/local/bin:$PATH - make -f Makefile.tools github-release - make -f Makefile.release publish-github-darwin - - persist_to_workspace: - root: . - paths: ['dist/*'] - publish-github-darwin: - macos: - xcode: 12.5.1 # indicate our selected version of Xcode - steps: - - checkout - - attach_workspace: { at: . } - - run: - name: Install tools - command: | - echo "====== the end =====" - # export PATH=/usr/local/opt/go@1.17/bin:/usr/local/opt/coreutils/libexec/gnubin:/usr/local/bin:$PATH - # make -f Makefile.tools github-release - # make -f Makefile.release publish-github-darwin - workflows: version: 2 # currently we only build/publish for linux: macOS builds require non-FOSS # Keychain libs that require a macOS host to build on - # https://github.com/optimizely/aws-okta/issues/81 - test-dist-publish: + # https://github.com/segmentio/aws-okta/issues/81 + test-dist-publish-linux: jobs: - test - test-build-golang-prev @@ -168,16 +120,10 @@ workflows: filters: tags: only: /.*/ - - dist-darwin: - # needed to ensure dist happens on tag events - filters: - tags: - only: /.*/ - publish-packagecloud: context: packagecloud requires: - dist-linux - - dist-darwin filters: # never publish from a branch event branches: @@ -186,28 +132,14 @@ workflows: tags: only: /v[0-9]+(\.[0-9]+)*(-[a-zA-Z0-9-]+)?/ - publish-github-linux: - context: github-optimizelycircle-oss-release + context: github-segmentcircle-oss-release requires: - dist-linux filters: # never publish from a branch event branches: ignore: /.*/ - # disabled (temporarily?) due to https://github.com/optimizely/aws-okta/issues/301 - # release only on tag push events like vX[.Y.Z...][-whatever] - # tags: - # only: /v[0-9]+(\.[0-9]+)*(-[a-zA-Z0-9-]+)?/ - ### ishih-opti - add for dawrin - - publish-github-darwin: - context: github-optimizelycircle-oss-release - requires: - - dist-darwin - filters: - # never publish from a branch event - branches: - ignore: /.*/ - # disabled (temporarily?) due to https://github.com/optimizely/aws-okta/issues/301 + # disabled (temporarily?) due to https://github.com/segmentio/aws-okta/issues/301 # release only on tag push events like vX[.Y.Z...][-whatever] # tags: # only: /v[0-9]+(\.[0-9]+)*(-[a-zA-Z0-9-]+)?/ - From 1f030505ccae1f95b1b14168d8e91e68cffba1f4 Mon Sep 17 00:00:00 2001 From: Ivy Shih <97625966+ishih-opti@users.noreply.github.com> Date: Wed, 14 Sep 2022 09:17:35 -0700 Subject: [PATCH 052/138] Add .circleci/config.yml From 2657ffd9038d805d55ad8a62cc216c0b35a3fec1 Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Wed, 14 Sep 2022 09:43:23 -0700 Subject: [PATCH 053/138] change from segement to optimizely in go.mod --- go.mod | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index a3b1cb4b..fd5dd0c7 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/segmentio/aws-okta +module github.com/optimizely/aws-okta require ( github.com/99designs/keyring v1.1.6 @@ -32,4 +32,4 @@ require ( gopkg.in/ini.v1 v1.42.0 ) -go 1.13 +go 1.17 From c4fbfc267ac931a26059145ccc2382a8f3f03fcb Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Wed, 14 Sep 2022 09:48:10 -0700 Subject: [PATCH 054/138] recover overwritten file by master --- .circleci/config.yml | 90 ++++++++++++++++++++++++++++++++++++++------ 1 file changed, 79 insertions(+), 11 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e741da9f..c2059ad0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -20,7 +20,7 @@ jobs: test: docker: - image: circleci/golang:1.13 - working_directory: /go/src/github.com/segmentio/aws-okta + working_directory: /go/src/github.com/optimizely/aws-okta steps: - run: # Do this prior to checkout so that it doesn't modify go.mod file. @@ -50,11 +50,10 @@ jobs: git status exit 1 fi - dist-linux: docker: - image: circleci/golang:1.13 - working_directory: /go/src/github.com/segmentio/aws-okta + working_directory: /go/src/github.com/optimizely/aws-okta steps: - checkout - run: @@ -77,7 +76,7 @@ jobs: publish-packagecloud: docker: - image: circleci/golang:1.13 - working_directory: /go/src/github.com/segmentio/aws-okta + working_directory: /go/src/github.com/optimizely/aws-okta steps: - checkout - attach_workspace: { at: . } @@ -92,11 +91,10 @@ jobs: sudo gem install rake sudo make -f Makefile.tools package_cloud make -f Makefile.release publish-packagecloud - publish-github-linux: docker: - - image: circleci/golang:1.13 - working_directory: /go/src/github.com/segmentio/aws-okta + - image: circleci/golang:1.17 + working_directory: /go/src/github.com/optimizely/aws-okta steps: - checkout - attach_workspace: { at: . } @@ -106,12 +104,62 @@ jobs: make -f Makefile.tools github-release make -f Makefile.release publish-github-linux + # ishih-opti - my change, add job list: dist-darwin and publish-github-darwin + dist-darwin: + macos: + xcode: 12.5.1 # indicate our selected version of Xcode + steps: + - checkout + - run: + name: install packages + command: | + yes | ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install)" || true + eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" + brew install go@1.17 libusb + export PATH=/usr/local/opt/go@1.17/bin:/usr/local/opt/coreutils/libexec/gnubin:/usr/local/bin:$PATH + # go install github.com/goreleaser/nfpm/v2/cmd/nfpm@latest + curl -Ls https://github.com/goreleaser/nfpm/releases/download/v1.2.0/nfpm_1.2.0_Darwin_x86_64.tar.gz > nfpm.tar.gz + tar xzvf nfpm.tar.gz && mv nfpm /usr/local/bin + - run: + name: make tools for macos + command: | + export PATH=/usr/local/opt/go@1.17/bin:/usr/local/opt/coreutils/libexec/gnubin:/usr/local/bin:$PATH + make -f Makefile.tools rpmbuild-darwin sha256sum-darwin + - run: + name: make distribution + command: | + export PATH=/usr/local/opt/go@1.17/bin:/usr/local/opt/coreutils/libexec/gnubin:/usr/local/bin:$PATH + make -f Makefile.release dist-darwin + - run: + name: make git release + command: | + echo "====== publish-github-darwin =====" + export PATH=/usr/local/opt/go@1.17/bin:/usr/local/opt/coreutils/libexec/gnubin:/usr/local/bin:$PATH + make -f Makefile.tools github-release + make -f Makefile.release publish-github-darwin + - persist_to_workspace: + root: . + paths: ['dist/*'] + publish-github-darwin: + macos: + xcode: 12.5.1 # indicate our selected version of Xcode + steps: + - checkout + - attach_workspace: { at: . } + - run: + name: Install tools + command: | + echo "====== the end =====" + # export PATH=/usr/local/opt/go@1.17/bin:/usr/local/opt/coreutils/libexec/gnubin:/usr/local/bin:$PATH + # make -f Makefile.tools github-release + # make -f Makefile.release publish-github-darwin + workflows: version: 2 # currently we only build/publish for linux: macOS builds require non-FOSS # Keychain libs that require a macOS host to build on - # https://github.com/segmentio/aws-okta/issues/81 - test-dist-publish-linux: + # https://github.com/optimizely/aws-okta/issues/81 + test-dist-publish: jobs: - test - test-build-golang-prev @@ -120,10 +168,16 @@ workflows: filters: tags: only: /.*/ + - dist-darwin: + # needed to ensure dist happens on tag events + filters: + tags: + only: /.*/ - publish-packagecloud: context: packagecloud requires: - dist-linux + - dist-darwin filters: # never publish from a branch event branches: @@ -132,14 +186,28 @@ workflows: tags: only: /v[0-9]+(\.[0-9]+)*(-[a-zA-Z0-9-]+)?/ - publish-github-linux: - context: github-segmentcircle-oss-release + context: github-optimizelycircle-oss-release requires: - dist-linux filters: # never publish from a branch event branches: ignore: /.*/ - # disabled (temporarily?) due to https://github.com/segmentio/aws-okta/issues/301 + # disabled (temporarily?) due to https://github.com/optimizely/aws-okta/issues/301 + # release only on tag push events like vX[.Y.Z...][-whatever] + # tags: + # only: /v[0-9]+(\.[0-9]+)*(-[a-zA-Z0-9-]+)?/ + ### ishih-opti - add for dawrin + - publish-github-darwin: + context: github-optimizelycircle-oss-release + requires: + - dist-darwin + filters: + # never publish from a branch event + branches: + ignore: /.*/ + # disabled (temporarily?) due to https://github.com/optimizely/aws-okta/issues/301 # release only on tag push events like vX[.Y.Z...][-whatever] # tags: # only: /v[0-9]+(\.[0-9]+)*(-[a-zA-Z0-9-]+)?/ + From e8fc2a9bded7e22c4456f7310e0b01695bf11203 Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Wed, 14 Sep 2022 09:54:05 -0700 Subject: [PATCH 055/138] revert changes in go.mod --- go.mod | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index fd5dd0c7..a3b1cb4b 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/optimizely/aws-okta +module github.com/segmentio/aws-okta require ( github.com/99designs/keyring v1.1.6 @@ -32,4 +32,4 @@ require ( gopkg.in/ini.v1 v1.42.0 ) -go 1.17 +go 1.13 From 032a2e3e7965be495342880494de428bf6f42f21 Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Wed, 14 Sep 2022 10:15:55 -0700 Subject: [PATCH 056/138] get git-release to start runing --- Makefile.tools | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile.tools b/Makefile.tools index 7c94d9d2..af813edf 100644 --- a/Makefile.tools +++ b/Makefile.tools @@ -25,7 +25,8 @@ sha256sum-darwin: # && ln -s $$(which gsha256sum) /usr/local/bin/sha256sum github-release: - GO111MODULE=off go get -d github.com/aktau/github-release + GO111MODULE=off go get -d github.com/aktau/github-release && \ + mv github-release /usr/local/bin package_cloud: gem install package_cloud From 1c0af36c9269ae16ad127d8a498006639dba400d Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Wed, 14 Sep 2022 14:26:47 -0700 Subject: [PATCH 057/138] get git-release to start runing --- Makefile.tools | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile.tools b/Makefile.tools index af813edf..af6e031e 100644 --- a/Makefile.tools +++ b/Makefile.tools @@ -26,6 +26,7 @@ sha256sum-darwin: github-release: GO111MODULE=off go get -d github.com/aktau/github-release && \ + which github-release && \ mv github-release /usr/local/bin package_cloud: From c4575378ffd08a2bcc2e06e60541eecb364a71c5 Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Wed, 14 Sep 2022 14:36:29 -0700 Subject: [PATCH 058/138] get git-release to start runing --- .circleci/config.yml | 66 ++++++++++++++++++++++---------------------- Makefile.tools | 3 +- 2 files changed, 34 insertions(+), 35 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c2059ad0..1e052073 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -17,39 +17,39 @@ jobs: go build -mod=vendor ./aws-okta version - test: - docker: - - image: circleci/golang:1.13 - working_directory: /go/src/github.com/optimizely/aws-okta - steps: - - run: - # Do this prior to checkout so that it doesn't modify go.mod file. - name: Install modvendor - command: | - go get -u github.com/goware/modvendor - - checkout - - run: - name: Install linux dependencies - libusb - command: | - sudo apt update -q - sudo apt install -yq libusb-dev libusb-1.0.0-dev - - run: - name: Test - command: | - make test - - run: - name: Check modules are tidy and checked in - command: | - export GO111MODULE=on - go mod tidy - go mod vendor - modvendor -copy="**/*.c **/*.h" -v - if [ "$(git status --porcelain)" != "" ]; then - echo "git tree is dirty after tidying and vendoring modules" - echo "ensure go.mod and go.sum are tidy and vendor is checked in" - git status - exit 1 - fi + # test: + # docker: + # - image: circleci/golang:1.13 + # working_directory: /go/src/github.com/optimizely/aws-okta + # steps: + # - run: + # # Do this prior to checkout so that it doesn't modify go.mod file. + # name: Install modvendor + # command: | + # go get -u github.com/goware/modvendor + # - checkout + # - run: + # name: Install linux dependencies - libusb + # command: | + # sudo apt update -q + # sudo apt install -yq libusb-dev libusb-1.0.0-dev + # - run: + # name: Test + # command: | + # make test + # - run: + # name: Check modules are tidy and checked in + # command: | + # export GO111MODULE=on + # go mod tidy + # go mod vendor + # modvendor -copy="**/*.c **/*.h" -v + # if [ "$(git status --porcelain)" != "" ]; then + # echo "git tree is dirty after tidying and vendoring modules" + # echo "ensure go.mod and go.sum are tidy and vendor is checked in" + # git status + # exit 1 + # fi dist-linux: docker: - image: circleci/golang:1.13 diff --git a/Makefile.tools b/Makefile.tools index af6e031e..bb65beb4 100644 --- a/Makefile.tools +++ b/Makefile.tools @@ -26,8 +26,7 @@ sha256sum-darwin: github-release: GO111MODULE=off go get -d github.com/aktau/github-release && \ - which github-release && \ - mv github-release /usr/local/bin + mv ./github-release /usr/local/bin package_cloud: gem install package_cloud From 6d8152f9b2755a1ee65ea9ceef4cbe48592bd6c9 Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Wed, 14 Sep 2022 14:38:25 -0700 Subject: [PATCH 059/138] get git-release to start runing --- .circleci/config.yml | 66 ++++++++++++++++++++++---------------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1e052073..c2059ad0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -17,39 +17,39 @@ jobs: go build -mod=vendor ./aws-okta version - # test: - # docker: - # - image: circleci/golang:1.13 - # working_directory: /go/src/github.com/optimizely/aws-okta - # steps: - # - run: - # # Do this prior to checkout so that it doesn't modify go.mod file. - # name: Install modvendor - # command: | - # go get -u github.com/goware/modvendor - # - checkout - # - run: - # name: Install linux dependencies - libusb - # command: | - # sudo apt update -q - # sudo apt install -yq libusb-dev libusb-1.0.0-dev - # - run: - # name: Test - # command: | - # make test - # - run: - # name: Check modules are tidy and checked in - # command: | - # export GO111MODULE=on - # go mod tidy - # go mod vendor - # modvendor -copy="**/*.c **/*.h" -v - # if [ "$(git status --porcelain)" != "" ]; then - # echo "git tree is dirty after tidying and vendoring modules" - # echo "ensure go.mod and go.sum are tidy and vendor is checked in" - # git status - # exit 1 - # fi + test: + docker: + - image: circleci/golang:1.13 + working_directory: /go/src/github.com/optimizely/aws-okta + steps: + - run: + # Do this prior to checkout so that it doesn't modify go.mod file. + name: Install modvendor + command: | + go get -u github.com/goware/modvendor + - checkout + - run: + name: Install linux dependencies - libusb + command: | + sudo apt update -q + sudo apt install -yq libusb-dev libusb-1.0.0-dev + - run: + name: Test + command: | + make test + - run: + name: Check modules are tidy and checked in + command: | + export GO111MODULE=on + go mod tidy + go mod vendor + modvendor -copy="**/*.c **/*.h" -v + if [ "$(git status --porcelain)" != "" ]; then + echo "git tree is dirty after tidying and vendoring modules" + echo "ensure go.mod and go.sum are tidy and vendor is checked in" + git status + exit 1 + fi dist-linux: docker: - image: circleci/golang:1.13 From 4f6ef6db9f585b7426a4277f3c3821913c9f3b4e Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Wed, 14 Sep 2022 14:47:39 -0700 Subject: [PATCH 060/138] get git-release to start runing --- .circleci/config.yml | 1 - Makefile.tools | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c2059ad0..808ed65a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -117,7 +117,6 @@ jobs: eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" brew install go@1.17 libusb export PATH=/usr/local/opt/go@1.17/bin:/usr/local/opt/coreutils/libexec/gnubin:/usr/local/bin:$PATH - # go install github.com/goreleaser/nfpm/v2/cmd/nfpm@latest curl -Ls https://github.com/goreleaser/nfpm/releases/download/v1.2.0/nfpm_1.2.0_Darwin_x86_64.tar.gz > nfpm.tar.gz tar xzvf nfpm.tar.gz && mv nfpm /usr/local/bin - run: diff --git a/Makefile.tools b/Makefile.tools index bb65beb4..5d06051c 100644 --- a/Makefile.tools +++ b/Makefile.tools @@ -26,7 +26,8 @@ sha256sum-darwin: github-release: GO111MODULE=off go get -d github.com/aktau/github-release && \ - mv ./github-release /usr/local/bin + pwd ; ls -l +# mv ./github-release /usr/local/bin package_cloud: gem install package_cloud From 5fed2d69de00cf9deb69d490f6671b8ab13d34cf Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Wed, 14 Sep 2022 14:51:06 -0700 Subject: [PATCH 061/138] test not to install rpm --- .circleci/config.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 808ed65a..e1dba494 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -123,7 +123,9 @@ jobs: name: make tools for macos command: | export PATH=/usr/local/opt/go@1.17/bin:/usr/local/opt/coreutils/libexec/gnubin:/usr/local/bin:$PATH - make -f Makefile.tools rpmbuild-darwin sha256sum-darwin + # make -f Makefile.tools rpmbuild-darwin sha256sum-darwin + make -f Makefile.tools sha256sum-darwin + - run: name: make distribution command: | From 2022781e03ef470276b3059056a8a0e195812018 Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Wed, 14 Sep 2022 15:08:24 -0700 Subject: [PATCH 062/138] test not to install rpm --- Makefile.tools | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.tools b/Makefile.tools index 5d06051c..d8eb3d1b 100644 --- a/Makefile.tools +++ b/Makefile.tools @@ -26,7 +26,7 @@ sha256sum-darwin: github-release: GO111MODULE=off go get -d github.com/aktau/github-release && \ - pwd ; ls -l + echo $GOPATH; pwd ; ls -l # mv ./github-release /usr/local/bin package_cloud: From 3716109f6e5695d429da5b50522f09d3a415a38d Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Wed, 14 Sep 2022 15:12:32 -0700 Subject: [PATCH 063/138] test not to install libusb --- .circleci/config.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e1dba494..f8cafc1b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -115,7 +115,8 @@ jobs: command: | yes | ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install)" || true eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" - brew install go@1.17 libusb + # brew install go@1.17 libusb + brew install go@1.17 export PATH=/usr/local/opt/go@1.17/bin:/usr/local/opt/coreutils/libexec/gnubin:/usr/local/bin:$PATH curl -Ls https://github.com/goreleaser/nfpm/releases/download/v1.2.0/nfpm_1.2.0_Darwin_x86_64.tar.gz > nfpm.tar.gz tar xzvf nfpm.tar.gz && mv nfpm /usr/local/bin From cb1da196a2397522c15c1d2da54865c2b1bf6d69 Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Wed, 14 Sep 2022 15:14:41 -0700 Subject: [PATCH 064/138] test not to install libusb and put braces around variable --- Makefile.tools | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.tools b/Makefile.tools index d8eb3d1b..9bbd726e 100644 --- a/Makefile.tools +++ b/Makefile.tools @@ -26,7 +26,7 @@ sha256sum-darwin: github-release: GO111MODULE=off go get -d github.com/aktau/github-release && \ - echo $GOPATH; pwd ; ls -l + echo ${GOPATH}; pwd ; ls -l # mv ./github-release /usr/local/bin package_cloud: From 56558a9ba7a61b7c92ca80a4d4614298c32bfb13 Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Wed, 14 Sep 2022 15:18:56 -0700 Subject: [PATCH 065/138] get git-release to start runing --- .circleci/config.yml | 1 + Makefile.tools | 4 +--- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f8cafc1b..6b61e5d4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -137,6 +137,7 @@ jobs: command: | echo "====== publish-github-darwin =====" export PATH=/usr/local/opt/go@1.17/bin:/usr/local/opt/coreutils/libexec/gnubin:/usr/local/bin:$PATH + echo ${GOPATH} make -f Makefile.tools github-release make -f Makefile.release publish-github-darwin - persist_to_workspace: diff --git a/Makefile.tools b/Makefile.tools index 9bbd726e..7c94d9d2 100644 --- a/Makefile.tools +++ b/Makefile.tools @@ -25,9 +25,7 @@ sha256sum-darwin: # && ln -s $$(which gsha256sum) /usr/local/bin/sha256sum github-release: - GO111MODULE=off go get -d github.com/aktau/github-release && \ - echo ${GOPATH}; pwd ; ls -l -# mv ./github-release /usr/local/bin + GO111MODULE=off go get -d github.com/aktau/github-release package_cloud: gem install package_cloud From 431deb735440ee2f906f84b2a5d83953c6803857 Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Wed, 14 Sep 2022 15:30:54 -0700 Subject: [PATCH 066/138] get git-release to start runing --- .circleci/config.yml | 1 - Makefile.tools | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6b61e5d4..f8cafc1b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -137,7 +137,6 @@ jobs: command: | echo "====== publish-github-darwin =====" export PATH=/usr/local/opt/go@1.17/bin:/usr/local/opt/coreutils/libexec/gnubin:/usr/local/bin:$PATH - echo ${GOPATH} make -f Makefile.tools github-release make -f Makefile.release publish-github-darwin - persist_to_workspace: diff --git a/Makefile.tools b/Makefile.tools index 7c94d9d2..9f9e16a0 100644 --- a/Makefile.tools +++ b/Makefile.tools @@ -25,7 +25,8 @@ sha256sum-darwin: # && ln -s $$(which gsha256sum) /usr/local/bin/sha256sum github-release: - GO111MODULE=off go get -d github.com/aktau/github-release + GO111MODULE=off go get -d github.com/aktau/github-release &&\ + mv ${HOME}/go/github-release /usr/local/bin/ package_cloud: gem install package_cloud From fd58304ab9095874814df9df8b5c5f34907c09c6 Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Wed, 14 Sep 2022 15:41:21 -0700 Subject: [PATCH 067/138] get git-release to start runing --- Makefile.tools | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.tools b/Makefile.tools index 9f9e16a0..da35b51c 100644 --- a/Makefile.tools +++ b/Makefile.tools @@ -26,7 +26,7 @@ sha256sum-darwin: github-release: GO111MODULE=off go get -d github.com/aktau/github-release &&\ - mv ${HOME}/go/github-release /usr/local/bin/ + mv ${HOME}/github-release /usr/local/bin/ package_cloud: gem install package_cloud From d63e4525c39f5086cba966503539da29a0a31d9e Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Wed, 14 Sep 2022 15:47:47 -0700 Subject: [PATCH 068/138] get git-release to start runing --- .circleci/config.yml | 1 + Makefile.tools | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f8cafc1b..8a0ec0f3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -137,6 +137,7 @@ jobs: command: | echo "====== publish-github-darwin =====" export PATH=/usr/local/opt/go@1.17/bin:/usr/local/opt/coreutils/libexec/gnubin:/usr/local/bin:$PATH + export GOPATH=${HOME}/project/ make -f Makefile.tools github-release make -f Makefile.release publish-github-darwin - persist_to_workspace: diff --git a/Makefile.tools b/Makefile.tools index da35b51c..3e5eaa5e 100644 --- a/Makefile.tools +++ b/Makefile.tools @@ -26,7 +26,7 @@ sha256sum-darwin: github-release: GO111MODULE=off go get -d github.com/aktau/github-release &&\ - mv ${HOME}/github-release /usr/local/bin/ + mv ${HOME}/project/github-release /usr/local/bin/ package_cloud: gem install package_cloud From 89e4a7216ec3990980a97bd75d54476b2bf83721 Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Wed, 14 Sep 2022 15:55:15 -0700 Subject: [PATCH 069/138] get git-release to start runing --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8a0ec0f3..7577942a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -138,6 +138,7 @@ jobs: echo "====== publish-github-darwin =====" export PATH=/usr/local/opt/go@1.17/bin:/usr/local/opt/coreutils/libexec/gnubin:/usr/local/bin:$PATH export GOPATH=${HOME}/project/ + echo ${GOPATH} make -f Makefile.tools github-release make -f Makefile.release publish-github-darwin - persist_to_workspace: From ed1d86e75060c77ce9fecce4c3a5118636387156 Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Wed, 14 Sep 2022 16:06:36 -0700 Subject: [PATCH 070/138] get git-release to start runing --- .circleci/config.yml | 8 +++++--- Makefile.tools | 3 +-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7577942a..253fe27f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -113,11 +113,14 @@ jobs: - run: name: install packages command: | - yes | ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install)" || true - eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" + + # yes | ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install)" || true + /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" + # eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" # brew install go@1.17 libusb brew install go@1.17 export PATH=/usr/local/opt/go@1.17/bin:/usr/local/opt/coreutils/libexec/gnubin:/usr/local/bin:$PATH + export GOPATH=/usr/local/bin curl -Ls https://github.com/goreleaser/nfpm/releases/download/v1.2.0/nfpm_1.2.0_Darwin_x86_64.tar.gz > nfpm.tar.gz tar xzvf nfpm.tar.gz && mv nfpm /usr/local/bin - run: @@ -137,7 +140,6 @@ jobs: command: | echo "====== publish-github-darwin =====" export PATH=/usr/local/opt/go@1.17/bin:/usr/local/opt/coreutils/libexec/gnubin:/usr/local/bin:$PATH - export GOPATH=${HOME}/project/ echo ${GOPATH} make -f Makefile.tools github-release make -f Makefile.release publish-github-darwin diff --git a/Makefile.tools b/Makefile.tools index 3e5eaa5e..7c94d9d2 100644 --- a/Makefile.tools +++ b/Makefile.tools @@ -25,8 +25,7 @@ sha256sum-darwin: # && ln -s $$(which gsha256sum) /usr/local/bin/sha256sum github-release: - GO111MODULE=off go get -d github.com/aktau/github-release &&\ - mv ${HOME}/project/github-release /usr/local/bin/ + GO111MODULE=off go get -d github.com/aktau/github-release package_cloud: gem install package_cloud From a62bc37d8b19d67215839c486c5f537ec936e1b8 Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Wed, 14 Sep 2022 16:13:12 -0700 Subject: [PATCH 071/138] get git-release to start runing --- .circleci/config.yml | 3 +-- Makefile.tools | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 253fe27f..0d2871bd 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -120,7 +120,6 @@ jobs: # brew install go@1.17 libusb brew install go@1.17 export PATH=/usr/local/opt/go@1.17/bin:/usr/local/opt/coreutils/libexec/gnubin:/usr/local/bin:$PATH - export GOPATH=/usr/local/bin curl -Ls https://github.com/goreleaser/nfpm/releases/download/v1.2.0/nfpm_1.2.0_Darwin_x86_64.tar.gz > nfpm.tar.gz tar xzvf nfpm.tar.gz && mv nfpm /usr/local/bin - run: @@ -140,7 +139,7 @@ jobs: command: | echo "====== publish-github-darwin =====" export PATH=/usr/local/opt/go@1.17/bin:/usr/local/opt/coreutils/libexec/gnubin:/usr/local/bin:$PATH - echo ${GOPATH} + export GOPATH=/usr/local/bin make -f Makefile.tools github-release make -f Makefile.release publish-github-darwin - persist_to_workspace: diff --git a/Makefile.tools b/Makefile.tools index 7c94d9d2..b67660f3 100644 --- a/Makefile.tools +++ b/Makefile.tools @@ -25,6 +25,7 @@ sha256sum-darwin: # && ln -s $$(which gsha256sum) /usr/local/bin/sha256sum github-release: + export GOPATH=/usr/local/bin && \ GO111MODULE=off go get -d github.com/aktau/github-release package_cloud: From 95e0b5e27ee8651ae68d0d47828c4ef7aa394440 Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Wed, 14 Sep 2022 18:51:35 -0700 Subject: [PATCH 072/138] get git-release to start runing --- Makefile.tools | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.tools b/Makefile.tools index b67660f3..e6f614c9 100644 --- a/Makefile.tools +++ b/Makefile.tools @@ -26,7 +26,7 @@ sha256sum-darwin: github-release: export GOPATH=/usr/local/bin && \ - GO111MODULE=off go get -d github.com/aktau/github-release + GO111MODULE=off go install github.com/aktau/github-release package_cloud: gem install package_cloud From bdf3ce0ace1df58dd796ea3cffaa2e8eaa1fa6ea Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Thu, 15 Sep 2022 09:22:42 -0700 Subject: [PATCH 073/138] get git-release to start runing --- Makefile.tools | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile.tools b/Makefile.tools index e6f614c9..341f5ae4 100644 --- a/Makefile.tools +++ b/Makefile.tools @@ -25,8 +25,9 @@ sha256sum-darwin: # && ln -s $$(which gsha256sum) /usr/local/bin/sha256sum github-release: - export GOPATH=/usr/local/bin && \ - GO111MODULE=off go install github.com/aktau/github-release + export GOPATH=/usr/local/bin ; export GOROOT=${HOME} && \ + GO111MODULE=off go install github.com/aktau/github-release && \ + mv ${GOROOT}/github-release ${GOPATH} package_cloud: gem install package_cloud From c32b464e8225611da49ee4de594c86036292bf60 Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Thu, 15 Sep 2022 09:25:31 -0700 Subject: [PATCH 074/138] get git-release to start runing --- Makefile.tools | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Makefile.tools b/Makefile.tools index 341f5ae4..e92194e9 100644 --- a/Makefile.tools +++ b/Makefile.tools @@ -25,9 +25,8 @@ sha256sum-darwin: # && ln -s $$(which gsha256sum) /usr/local/bin/sha256sum github-release: - export GOPATH=/usr/local/bin ; export GOROOT=${HOME} && \ - GO111MODULE=off go install github.com/aktau/github-release && \ - mv ${GOROOT}/github-release ${GOPATH} + export GOPATH=/usr/local/bin && \ + GO111MODULE=off go install github.com/aktau/github-release package_cloud: gem install package_cloud From 0b62bda9c6ff4ca7f80b9da39c881c083d1a69e7 Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Thu, 15 Sep 2022 09:32:26 -0700 Subject: [PATCH 075/138] get git-release to start runing --- Makefile.tools | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile.tools b/Makefile.tools index e92194e9..d4b4dfd3 100644 --- a/Makefile.tools +++ b/Makefile.tools @@ -25,8 +25,8 @@ sha256sum-darwin: # && ln -s $$(which gsha256sum) /usr/local/bin/sha256sum github-release: - export GOPATH=/usr/local/bin && \ - GO111MODULE=off go install github.com/aktau/github-release + GO111MODULE=off go install github.com/aktau/github-release && \ + echo ${GOPATH}; ls -l ${GOPATH} package_cloud: gem install package_cloud From 9ddd2fe3be0a5e9d2d385a3b7fffaf96299a83c1 Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Thu, 15 Sep 2022 09:46:15 -0700 Subject: [PATCH 076/138] get git-release to start runing --- .circleci/config.yml | 2 +- Makefile.tools | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 0d2871bd..a7ba659d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -139,7 +139,7 @@ jobs: command: | echo "====== publish-github-darwin =====" export PATH=/usr/local/opt/go@1.17/bin:/usr/local/opt/coreutils/libexec/gnubin:/usr/local/bin:$PATH - export GOPATH=/usr/local/bin + export GOPATH=/usr/local make -f Makefile.tools github-release make -f Makefile.release publish-github-darwin - persist_to_workspace: diff --git a/Makefile.tools b/Makefile.tools index d4b4dfd3..6018dc47 100644 --- a/Makefile.tools +++ b/Makefile.tools @@ -25,8 +25,7 @@ sha256sum-darwin: # && ln -s $$(which gsha256sum) /usr/local/bin/sha256sum github-release: - GO111MODULE=off go install github.com/aktau/github-release && \ - echo ${GOPATH}; ls -l ${GOPATH} + GO111MODULE=off go install github.com/aktau/github-release@latest package_cloud: gem install package_cloud From dc26eed38c9e952679ee48d15d2f52c0e4958ebc Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Thu, 15 Sep 2022 09:56:53 -0700 Subject: [PATCH 077/138] get git-release to start runing --- Makefile.tools | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile.tools b/Makefile.tools index 6018dc47..90e2f14c 100644 --- a/Makefile.tools +++ b/Makefile.tools @@ -25,8 +25,9 @@ sha256sum-darwin: # && ln -s $$(which gsha256sum) /usr/local/bin/sha256sum github-release: - GO111MODULE=off go install github.com/aktau/github-release@latest - + #GO111MODULE=off go install github.com/aktau/github-release@latest + brew install github-release + package_cloud: gem install package_cloud From 9c47f9ae2a56355a91535e8c55a18143af47d825 Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Thu, 15 Sep 2022 10:18:09 -0700 Subject: [PATCH 078/138] fix github-release command --- Makefile.release | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.release b/Makefile.release index 7970ebf8..99e731b3 100644 --- a/Makefile.release +++ b/Makefile.release @@ -55,7 +55,7 @@ github-release: --tag $(VERSION) \ --description - \ --name $(VERSION) || \ - github-release info \ + github-release info -u optimizely -r aws-okta\ --security-token $$GH_LOGIN \ --user optimizely \ --repo aws-okta \ From 550d9c85fa75b166447d17df36779f490028c6e6 Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Thu, 15 Sep 2022 10:53:58 -0700 Subject: [PATCH 079/138] fix github-release command --- Makefile.release | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile.release b/Makefile.release index 99e731b3..a09434e5 100644 --- a/Makefile.release +++ b/Makefile.release @@ -56,10 +56,10 @@ github-release: --description - \ --name $(VERSION) || \ github-release info -u optimizely -r aws-okta\ - --security-token $$GH_LOGIN \ - --user optimizely \ - --repo aws-okta \ - --tag $(VERSION) + #--security-token $$GH_LOGIN \ + #--user optimizely \ + #--repo aws-okta \ + #--tag $(VERSION) publish-github-darwin-bin: dist/aws-okta-$(VERSION)-darwin-amd64 | github-release github-release upload \ From 4f5c81b8f59045c28bca47f8968f7490d77363c3 Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Thu, 15 Sep 2022 15:24:59 -0700 Subject: [PATCH 080/138] fix github-release command --- .circleci/config.yml | 1 + Makefile.release | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a7ba659d..36be9461 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -140,6 +140,7 @@ jobs: echo "====== publish-github-darwin =====" export PATH=/usr/local/opt/go@1.17/bin:/usr/local/opt/coreutils/libexec/gnubin:/usr/local/bin:$PATH export GOPATH=/usr/local + env|grep VERSION make -f Makefile.tools github-release make -f Makefile.release publish-github-darwin - persist_to_workspace: diff --git a/Makefile.release b/Makefile.release index a09434e5..d91740bb 100644 --- a/Makefile.release +++ b/Makefile.release @@ -7,7 +7,6 @@ include Makefile # use bash so we can use set -o pipefail SHELL := /bin/bash - # set --pre-release if not tagged or tree is dirty or there's a `-` in the tag ifneq (,$(findstring -,$(VERSION))) GITHUB_RELEASE_FLAGS := "--pre-release" From d3008fd1fc117353e8e2abaa71e4179c808cb651 Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Thu, 15 Sep 2022 15:51:06 -0700 Subject: [PATCH 081/138] fix github-release command --- .circleci/config.yml | 2 +- Makefile | 3 ++- Makefile.release | 8 ++++---- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 36be9461..0a76a537 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -140,7 +140,7 @@ jobs: echo "====== publish-github-darwin =====" export PATH=/usr/local/opt/go@1.17/bin:/usr/local/opt/coreutils/libexec/gnubin:/usr/local/bin:$PATH export GOPATH=/usr/local - env|grep VERSION + env|grep -i git make -f Makefile.tools github-release make -f Makefile.release publish-github-darwin - persist_to_workspace: diff --git a/Makefile b/Makefile index 54db98c4..1dcfe7fd 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,8 @@ # # This makefile is meant for humans -VERSION := $(shell git describe --tags --always --dirty="-dev") +# VERSION := $(shell git describe --tags --always --dirty="-dev") +VERSION := $(shell git describe --tags --always --dirty="-dev"|cut -d"-" -f 1 ) LDFLAGS := -ldflags='-X "main.Version=$(VERSION)"' test: diff --git a/Makefile.release b/Makefile.release index d91740bb..6c5918dc 100644 --- a/Makefile.release +++ b/Makefile.release @@ -55,10 +55,10 @@ github-release: --description - \ --name $(VERSION) || \ github-release info -u optimizely -r aws-okta\ - #--security-token $$GH_LOGIN \ - #--user optimizely \ - #--repo aws-okta \ - #--tag $(VERSION) + --security-token $$GH_LOGIN \ + --user optimizely \ + --repo aws-okta \ + --tag $(VERSION) publish-github-darwin-bin: dist/aws-okta-$(VERSION)-darwin-amd64 | github-release github-release upload \ From ac9bb1197d400aa9a2da6051e80d0d691ec7b83a Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Fri, 16 Sep 2022 12:38:32 -0700 Subject: [PATCH 082/138] fixing git-release --- .circleci/config.yml | 3 ++- Makefile | 2 +- Makefile.release | 21 ++++++++------------- 3 files changed, 11 insertions(+), 15 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 0a76a537..7bb7a00b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -140,7 +140,8 @@ jobs: echo "====== publish-github-darwin =====" export PATH=/usr/local/opt/go@1.17/bin:/usr/local/opt/coreutils/libexec/gnubin:/usr/local/bin:$PATH export GOPATH=/usr/local - env|grep -i git + export GIT_LOGIN=ishih-opti + export GITHUB_TOKEN=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 make -f Makefile.tools github-release make -f Makefile.release publish-github-darwin - persist_to_workspace: diff --git a/Makefile b/Makefile index 1dcfe7fd..9551cf5e 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ # This makefile is meant for humans # VERSION := $(shell git describe --tags --always --dirty="-dev") -VERSION := $(shell git describe --tags --always --dirty="-dev"|cut -d"-" -f 1 ) +VERSION := $(shell git describe --tags --always --dirty="-dev"|cut -d"-" -f 1 )-test LDFLAGS := -ldflags='-X "main.Version=$(VERSION)"' test: diff --git a/Makefile.release b/Makefile.release index 6c5918dc..9be6eca7 100644 --- a/Makefile.release +++ b/Makefile.release @@ -47,22 +47,17 @@ publish-packagecloud: publish-packagecloud-deb publish-packagecloud-rpm github-release: set -o pipefail; \ scripts/changelog | github-release release \ - --security-token $$GH_LOGIN \ + --security-token $$GITHUB_TOKEN \ --user optimizely \ --repo aws-okta \ $(GITHUB_RELEASE_FLAGS) \ --tag $(VERSION) \ --description - \ - --name $(VERSION) || \ - github-release info -u optimizely -r aws-okta\ - --security-token $$GH_LOGIN \ - --user optimizely \ - --repo aws-okta \ - --tag $(VERSION) + --name $(VERSION) \ publish-github-darwin-bin: dist/aws-okta-$(VERSION)-darwin-amd64 | github-release github-release upload \ - --security-token $$GH_LOGIN \ + --security-token $$GITHUB_TOKEN \ --user optimizely \ --repo aws-okta \ --tag $(VERSION) \ @@ -72,7 +67,7 @@ publish-github-darwin-bin: dist/aws-okta-$(VERSION)-darwin-amd64 | github-releas publish-github-darwin-bin-arm64: dist/aws-okta-$(VERSION)-darwin-arm64 | github-release github-release upload \ - --security-token $$GH_LOGIN \ + --security-token $$GITHUB_TOKEN \ --user optimizely \ --repo aws-okta \ --tag $(VERSION) \ @@ -82,7 +77,7 @@ publish-github-darwin-bin-arm64: dist/aws-okta-$(VERSION)-darwin-arm64 | github- publish-github-linux-bin: dist/aws-okta-$(VERSION)-linux-amd64 | github-release github-release upload \ - --security-token $$GH_LOGIN \ + --security-token $$GITHUB_TOKEN \ --user optimizely \ --repo aws-okta \ --tag $(VERSION) \ @@ -92,7 +87,7 @@ publish-github-linux-bin: dist/aws-okta-$(VERSION)-linux-amd64 | github-release publish-github-deb: dist/aws-okta_$(VERSION)_amd64.deb | github-release github-release upload \ - --security-token $$GH_LOGIN \ + --security-token $$GITHUB_TOKEN \ --user optimizely \ --repo aws-okta \ --tag $(VERSION) \ @@ -102,7 +97,7 @@ publish-github-deb: dist/aws-okta_$(VERSION)_amd64.deb | github-release publish-github-rpm: dist/aws-okta_$(VERSION)_amd64.rpm | github-release github-release upload \ - --security-token $$GH_LOGIN \ + --security-token $$GITHUB_TOKEN \ --user optimizely \ --repo aws-okta \ --tag $(VERSION) \ @@ -112,7 +107,7 @@ publish-github-rpm: dist/aws-okta_$(VERSION)_amd64.rpm | github-release publish-github-sha256sums: dist/aws-okta-$(VERSION).sha256sums | github-release github-release upload \ - --security-token $$GH_LOGIN \ + --security-token $$GITHUB_TOKEN \ --user optimizely \ --repo aws-okta \ --tag $(VERSION) \ From 551eb0d5e5f72c089ed547ae87c1c83d0486a3d1 Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Fri, 16 Sep 2022 12:50:56 -0700 Subject: [PATCH 083/138] fixing git-release --- Makefile.release | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile.release b/Makefile.release index 9be6eca7..9d9f5cda 100644 --- a/Makefile.release +++ b/Makefile.release @@ -8,10 +8,10 @@ include Makefile # use bash so we can use set -o pipefail SHELL := /bin/bash # set --pre-release if not tagged or tree is dirty or there's a `-` in the tag -ifneq (,$(findstring -,$(VERSION))) - GITHUB_RELEASE_FLAGS := "--pre-release" - PACKAGECLOUD_NAME_SUFFIX := "-prerelease" -endif +#ifneq (,$(findstring -,$(VERSION))) +# GITHUB_RELEASE_FLAGS := "--pre-release" +# PACKAGECLOUD_NAME_SUFFIX := "-prerelease" +#endif # TODO: use this consistently; 99% of the time, we don't want a v VERSION_NO_V := $(patsubst v%,%,$(VERSION)) From 5318f20ddd369c773c95f08749a278546b0e7ea7 Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Fri, 16 Sep 2022 13:40:41 -0700 Subject: [PATCH 084/138] fixing git-release --- Makefile.release | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile.release b/Makefile.release index 9d9f5cda..02db28c2 100644 --- a/Makefile.release +++ b/Makefile.release @@ -44,10 +44,11 @@ publish-github-linux: publish-github-linux-bin publish-github-deb publish-github publish-packagecloud: publish-packagecloud-deb publish-packagecloud-rpm +# scripts/changelog | github-release release \ github-release: set -o pipefail; \ - scripts/changelog | github-release release \ --security-token $$GITHUB_TOKEN \ + "test"| github-release release \ --user optimizely \ --repo aws-okta \ $(GITHUB_RELEASE_FLAGS) \ From 8560a58bf377af0158912e5ace690bf687f85136 Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Fri, 16 Sep 2022 14:13:59 -0700 Subject: [PATCH 085/138] fix github-release command --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7bb7a00b..d8c11393 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -141,7 +141,7 @@ jobs: export PATH=/usr/local/opt/go@1.17/bin:/usr/local/opt/coreutils/libexec/gnubin:/usr/local/bin:$PATH export GOPATH=/usr/local export GIT_LOGIN=ishih-opti - export GITHUB_TOKEN=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 + export GITHUB_TOKEN=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 make -f Makefile.tools github-release make -f Makefile.release publish-github-darwin - persist_to_workspace: From f9305a43faf02fb94550c39c98f8aa1c8d37d509 Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Tue, 20 Sep 2022 09:32:32 -0700 Subject: [PATCH 086/138] fix github-release command --- Makefile.release | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile.release b/Makefile.release index 02db28c2..97f07f2a 100644 --- a/Makefile.release +++ b/Makefile.release @@ -47,6 +47,7 @@ publish-packagecloud: publish-packagecloud-deb publish-packagecloud-rpm # scripts/changelog | github-release release \ github-release: set -o pipefail; \ + github-release release \ --security-token $$GITHUB_TOKEN \ "test"| github-release release \ --user optimizely \ From 3dcdd6065673a7a35f6280c3d631b78c26556bc2 Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Tue, 20 Sep 2022 10:21:11 -0700 Subject: [PATCH 087/138] fix github-release command --- Makefile.release | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile.release b/Makefile.release index 97f07f2a..89308903 100644 --- a/Makefile.release +++ b/Makefile.release @@ -14,7 +14,7 @@ SHELL := /bin/bash #endif # TODO: use this consistently; 99% of the time, we don't want a v -VERSION_NO_V := $(patsubst v%,%,$(VERSION)) +VERSION_NO_V := $(patsubst v%,%,$(VERSION))-test PACKAGECLOUD_DEB_DISTROS := \ debian/stretch \ @@ -60,6 +60,7 @@ github-release: publish-github-darwin-bin: dist/aws-okta-$(VERSION)-darwin-amd64 | github-release github-release upload \ --security-token $$GITHUB_TOKEN \ + --auth-user $$GIT_LOGIN \ --user optimizely \ --repo aws-okta \ --tag $(VERSION) \ From 8caafeb43a574c14696de3673a05d569485dbbd5 Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Wed, 21 Sep 2022 16:31:52 -0700 Subject: [PATCH 088/138] github-release command work separately for linux and darwin --- .circleci/config.yml | 67 ++++++++--------- Makefile.gh | 171 +++++++++++++++++++++++++++++++++++++++++++ Makefile.release | 18 ++--- 3 files changed, 211 insertions(+), 45 deletions(-) create mode 100644 Makefile.gh diff --git a/.circleci/config.yml b/.circleci/config.yml index d8c11393..bb94f76a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -73,24 +73,24 @@ jobs: root: . paths: ['dist/*'] - publish-packagecloud: - docker: - - image: circleci/golang:1.13 - working_directory: /go/src/github.com/optimizely/aws-okta - steps: - - checkout - - attach_workspace: { at: . } - - run: - name: Install tools - command: | - make -f Makefile.tools github-release - # this is all for package_cloud :/ - sudo apt update -q - sudo apt install -yq ruby ruby-dev build-essential - # fixes https://askubuntu.com/questions/872399/error-failed-to-build-gem-native-extension-when-trying-to-download-rubocop - sudo gem install rake - sudo make -f Makefile.tools package_cloud - make -f Makefile.release publish-packagecloud + # publish-packagecloud: + # docker: + # - image: circleci/golang:1.13 + # working_directory: /go/src/github.com/optimizely/aws-okta + # steps: + # - checkout + # - attach_workspace: { at: . } + # - run: + # name: Install tools + # command: | + # make -f Makefile.tools github-release + # # this is all for package_cloud :/ + # sudo apt update -q + # sudo apt install -yq ruby ruby-dev build-essential + # # fixes https://askubuntu.com/questions/872399/error-failed-to-build-gem-native-extension-when-trying-to-download-rubocop + # sudo gem install rake + # sudo make -f Makefile.tools package_cloud + # make -f Makefile.release publish-packagecloud publish-github-linux: docker: - image: circleci/golang:1.17 @@ -141,7 +141,8 @@ jobs: export PATH=/usr/local/opt/go@1.17/bin:/usr/local/opt/coreutils/libexec/gnubin:/usr/local/bin:$PATH export GOPATH=/usr/local export GIT_LOGIN=ishih-opti - export GITHUB_TOKEN=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 + # export GITHUB_TOKEN=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 + export GITHUB_TOKEN=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 make -f Makefile.tools github-release make -f Makefile.release publish-github-darwin - persist_to_workspace: @@ -168,8 +169,8 @@ workflows: # https://github.com/optimizely/aws-okta/issues/81 test-dist-publish: jobs: - - test - - test-build-golang-prev + # - test + # - test-build-golang-prev - dist-linux: # needed to ensure dist happens on tag events filters: @@ -180,18 +181,18 @@ workflows: filters: tags: only: /.*/ - - publish-packagecloud: - context: packagecloud - requires: - - dist-linux - - dist-darwin - filters: - # never publish from a branch event - branches: - ignore: /.*/ - # release only on tag push events like vX[.Y.Z...][-whatever] - tags: - only: /v[0-9]+(\.[0-9]+)*(-[a-zA-Z0-9-]+)?/ + # - publish-packagecloud: + # context: packagecloud + # requires: + # - dist-linux + # - dist-darwin + # filters: + # # never publish from a branch event + # branches: + # ignore: /.*/ + # # release only on tag push events like vX[.Y.Z...][-whatever] + # tags: + # only: /v[0-9]+(\.[0-9]+)*(-[a-zA-Z0-9-]+)?/ - publish-github-linux: context: github-optimizelycircle-oss-release requires: diff --git a/Makefile.gh b/Makefile.gh new file mode 100644 index 00000000..39a0b182 --- /dev/null +++ b/Makefile.gh @@ -0,0 +1,171 @@ +# Goals: +# - Linux releases can be published to Github automatically by CircleCI +# +# This Makefile is meant for machines + +include Makefile + +# use bash so we can use set -o pipefail +SHELL := /bin/bash +# set --pre-release if not tagged or tree is dirty or there's a `-` in the tag +#ifneq (,$(findstring -,$(VERSION))) +# GITHUB_RELEASE_FLAGS := "--pre-release" +# PACKAGECLOUD_NAME_SUFFIX := "-prerelease" +#endif + +# TODO: use this consistently; 99% of the time, we don't want a v +VERSION_NO_V := $(patsubst v%,%,$(VERSION))-test + +PACKAGECLOUD_DEB_DISTROS := \ + debian/stretch \ + ubuntu/trusty \ + ubuntu/xenial \ + ubuntu/bionic \ + ubuntu/disco \ + ubuntu/eoan \ + ubuntu/focal + +PACKAGECLOUD_RPM_DISTROS := \ + fedora/27 \ + fedora/28 \ + fedora/29 \ + fedora/30 + +publish: publish-github publish-packagecloud + +# note: this doesn't include sha256sums +publish-linux: publish-github-linux publish-packagecloud + +publish-github: publish-github-darwin publish-github-linux publish-github-sha256sums + +publish-github-darwin: publish-github-darwin-bin publish-github-darwin-bin-arm6 + +publish-github-linux: publish-github-linux-bin publish-github-deb publish-github-rpm + +publish-packagecloud: publish-packagecloud-deb publish-packagecloud-rpm + +gh: + set -o pipefail; \ + gh auth login --with-token $$GITHUB_TOKEN ; \ + gh release create $(VERSION) \ + --repo optimizely/aws-okta \ + --generate-notes \ + + +publish-github-darwin-bin: dist/aws-okta-$(VERSION)-darwin-amd64 | gh + gh upload \ + --security-token $$GITHUB_TOKEN \ + --auth-user $$GIT_LOGIN \ + --user optimizely \ + --repo aws-okta \ + --tag $(VERSION) \ + --name aws-okta-$(VERSION)-darwin-amd64 \ + --replace \ + --file $< + +publish-github-darwin-bin-arm64: dist/aws-okta-$(VERSION)-darwin-arm64 | gh + gh upload \ + --security-token $$GITHUB_TOKEN \ + --user optimizely \ + --repo aws-okta \ + --tag $(VERSION) \ + --name aws-okta-$(VERSION)-darwin-arm64 \ + --replace \ + --file $< + +publish-github-linux-bin: dist/aws-okta-$(VERSION)-linux-amd64 | gh + gh upload \ + --security-token $$GITHUB_TOKEN \ + --user optimizely \ + --repo aws-okta \ + --tag $(VERSION) \ + --name aws-okta-$(VERSION)-linux-amd64 \ + --replace \ + --file $< + +publish-github-deb: dist/aws-okta_$(VERSION)_amd64.deb | gh + gh upload \ + --security-token $$GITHUB_TOKEN \ + --user optimizely \ + --repo aws-okta \ + --tag $(VERSION) \ + --name aws-okta_$(VERSION)_amd64.deb \ + --replace \ + --file $< + +publish-github-rpm: dist/aws-okta_$(VERSION)_amd64.rpm | gh + gh upload \ + --security-token $$GITHUB_TOKEN \ + --user optimizely \ + --repo aws-okta \ + --tag $(VERSION) \ + --name aws-okta_$(VERSION)_amd64.rpm \ + --replace \ + --file $< + +publish-github-sha256sums: dist/aws-okta-$(VERSION).sha256sums | gh + gh upload \ + --security-token $$GITHUB_TOKEN \ + --user optimizely \ + --repo aws-okta \ + --tag $(VERSION) \ + --name aws-okta-$(VERSION).sha256sums \ + --replace \ + --file dist/aws-okta-$(VERSION).sha256sums + +packagecloud.conf.json: + @echo "{\"url\":\"https://packagecloud.io\",\"token\":\"$${PACKAGECLOUD_TOKEN}\"}" > $@ + +# package_cloud prints the last 4 chars of our token :( +# so we attempt to filter that out + +publish-packagecloud-deb: dist/aws-okta_$(VERSION)_amd64.deb packagecloud.conf.json + @set -o pipefail; \ + for v in $(PACKAGECLOUD_DEB_DISTROS); do \ + (package_cloud yank --config packagecloud.conf.json optimizely/aws-okta$(PACKAGECLOUD_NAME_SUFFIX)/$$v aws-okta_$(VERSION_NO_V)_amd64.deb || true) | \ + grep -v 'with token:' || true ; \ + package_cloud push --config packagecloud.conf.json optimizely/aws-okta$(PACKAGECLOUD_NAME_SUFFIX)/$$v $< | \ + grep -v 'with token:' ; \ + done + +publish-packagecloud-rpm: dist/aws-okta_$(VERSION)_amd64.rpm packagecloud.conf.json + @set -o pipefail; \ + for v in $(PACKAGECLOUD_RPM_DISTROS); do \ + (package_cloud yank --config packagecloud.conf.json optimizely/aws-okta$(PACKAGECLOUD_NAME_SUFFIX)/$$v aws-okta-$(subst -,_,$(VERSION_NO_V))-1.x86_64.rpm || true) | \ + grep -v 'with token:' || true ; \ + package_cloud push --config packagecloud.conf.json optimizely/aws-okta$(PACKAGECLOUD_NAME_SUFFIX)/$$v $< | \ + grep -v 'with token:' ; \ + done + +dist: dist-darwin dist-linux dist/aws-okta-$(VERSION).sha256sums + +dist-darwin: dist/aws-okta-$(VERSION)-darwin-amd64 dist/aws-okta-$(VERSION)-darwin-arm64 + +dist-linux: dist/aws-okta-$(VERSION)-linux-amd64 dist/aws-okta_$(VERSION)_amd64.deb dist/aws-okta_$(VERSION)_amd64.rpm + +dist/aws-okta-$(VERSION).sha256sums: dist/aws-okta-$(VERSION)-darwin-amd64 dist/aws-okta-$(VERSION)-linux-amd64 dist/aws-okta_$(VERSION)_amd64.deb dist/aws-okta_$(VERSION)_amd64.rpm + sha256sum $^ | sed 's|dist/||g' > $@ + +dist/nfpm-$(VERSION).yaml: | dist/ + sed -e "s/\$${VERSION}/$(VERSION)/g" -e "s|\$${DIST_BIN}|dist/aws-okta-$(VERSION)-linux-amd64|g" < nfpm.yaml.tmpl > $@ + +dist/aws-okta_$(VERSION)_amd64.deb: dist/nfpm-$(VERSION).yaml dist/aws-okta-$(VERSION)-linux-amd64 + nfpm -f $< pkg --target $@ + +dist/aws-okta_$(VERSION)_amd64.rpm: dist/nfpm-$(VERSION).yaml dist/aws-okta-$(VERSION)-linux-amd64 + nfpm -f $< pkg --target $@ + +.PHONY: \ + dist \ + dist-darwin \ + dist-linux \ + publish \ + publish-github \ + publish-github-linux \ + publish-github-linux-bin \ + publish-github-rpm \ + publish-github-deb \ + publish-github-darwin \ + publish-github-darwin-bin \ + publish-github-darwin-bin-arm64 \ + gh diff --git a/Makefile.release b/Makefile.release index 89308903..2d3de563 100644 --- a/Makefile.release +++ b/Makefile.release @@ -38,28 +38,27 @@ publish-linux: publish-github-linux publish-packagecloud publish-github: publish-github-darwin publish-github-linux publish-github-sha256sums -publish-github-darwin: publish-github-darwin-bin publish-github-darwin-bin-arm6 +publish-github-darwin: publish-github-darwin-bin publish-github-darwin-bin-arm64 publish-github-linux: publish-github-linux-bin publish-github-deb publish-github-rpm publish-packagecloud: publish-packagecloud-deb publish-packagecloud-rpm -# scripts/changelog | github-release release \ +# $(GITHUB_RELEASE_FLAGS) \ + + github-release: set -o pipefail; \ - github-release release \ - --security-token $$GITHUB_TOKEN \ - "test"| github-release release \ + scripts/changelog | github-release release \ --user optimizely \ --repo aws-okta \ - $(GITHUB_RELEASE_FLAGS) \ --tag $(VERSION) \ --description - \ --name $(VERSION) \ + --pre-release publish-github-darwin-bin: dist/aws-okta-$(VERSION)-darwin-amd64 | github-release github-release upload \ - --security-token $$GITHUB_TOKEN \ --auth-user $$GIT_LOGIN \ --user optimizely \ --repo aws-okta \ @@ -70,7 +69,6 @@ publish-github-darwin-bin: dist/aws-okta-$(VERSION)-darwin-amd64 | github-releas publish-github-darwin-bin-arm64: dist/aws-okta-$(VERSION)-darwin-arm64 | github-release github-release upload \ - --security-token $$GITHUB_TOKEN \ --user optimizely \ --repo aws-okta \ --tag $(VERSION) \ @@ -80,7 +78,6 @@ publish-github-darwin-bin-arm64: dist/aws-okta-$(VERSION)-darwin-arm64 | github- publish-github-linux-bin: dist/aws-okta-$(VERSION)-linux-amd64 | github-release github-release upload \ - --security-token $$GITHUB_TOKEN \ --user optimizely \ --repo aws-okta \ --tag $(VERSION) \ @@ -90,7 +87,6 @@ publish-github-linux-bin: dist/aws-okta-$(VERSION)-linux-amd64 | github-release publish-github-deb: dist/aws-okta_$(VERSION)_amd64.deb | github-release github-release upload \ - --security-token $$GITHUB_TOKEN \ --user optimizely \ --repo aws-okta \ --tag $(VERSION) \ @@ -100,7 +96,6 @@ publish-github-deb: dist/aws-okta_$(VERSION)_amd64.deb | github-release publish-github-rpm: dist/aws-okta_$(VERSION)_amd64.rpm | github-release github-release upload \ - --security-token $$GITHUB_TOKEN \ --user optimizely \ --repo aws-okta \ --tag $(VERSION) \ @@ -110,7 +105,6 @@ publish-github-rpm: dist/aws-okta_$(VERSION)_amd64.rpm | github-release publish-github-sha256sums: dist/aws-okta-$(VERSION).sha256sums | github-release github-release upload \ - --security-token $$GITHUB_TOKEN \ --user optimizely \ --repo aws-okta \ --tag $(VERSION) \ From d7f92ae8aa7fc9fad47f82fb583412c3f0e21e72 Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Wed, 21 Sep 2022 16:52:38 -0700 Subject: [PATCH 089/138] add env GITHUB_TOKEN in project --- .circleci/config.yml | 2 -- Makefile.release | 4 +++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index bb94f76a..37efb016 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -141,8 +141,6 @@ jobs: export PATH=/usr/local/opt/go@1.17/bin:/usr/local/opt/coreutils/libexec/gnubin:/usr/local/bin:$PATH export GOPATH=/usr/local export GIT_LOGIN=ishih-opti - # export GITHUB_TOKEN=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 - export GITHUB_TOKEN=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 make -f Makefile.tools github-release make -f Makefile.release publish-github-darwin - persist_to_workspace: diff --git a/Makefile.release b/Makefile.release index 2d3de563..8501d303 100644 --- a/Makefile.release +++ b/Makefile.release @@ -46,10 +46,12 @@ publish-packagecloud: publish-packagecloud-deb publish-packagecloud-rpm # $(GITHUB_RELEASE_FLAGS) \ +# scripts/changelog | github-release release \ + github-release: set -o pipefail; \ - scripts/changelog | github-release release \ + echo -n | github-release release \ --user optimizely \ --repo aws-okta \ --tag $(VERSION) \ From 0cbfdd20b168e1fea294e7b8061737e9a7d6a2c3 Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Wed, 21 Sep 2022 16:58:20 -0700 Subject: [PATCH 090/138] add linix part to the code --- .circleci/config.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 37efb016..ff17abd2 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -69,6 +69,11 @@ jobs: name: Make distributables command: | make -f Makefile.release dist-linux + - run: + name: make tools and publish + command: | + make -f Makefile.tools github-release + make -f Makefile.release publish-github-linux - persist_to_workspace: root: . paths: ['dist/*'] @@ -101,8 +106,8 @@ jobs: - run: name: Install tools command: | - make -f Makefile.tools github-release - make -f Makefile.release publish-github-linux + # make -f Makefile.tools github-release + # make -f Makefile.release publish-github-linux # ishih-opti - my change, add job list: dist-darwin and publish-github-darwin dist-darwin: From 2d44e2c22632c0ab824fa07119ab4b90f32320ee Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Thu, 22 Sep 2022 08:17:23 -0700 Subject: [PATCH 091/138] add linix part to the code --- .circleci/config.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ff17abd2..999d1635 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -61,10 +61,11 @@ jobs: command: | sudo make -f Makefile.tools nfpm-debian rpmbuild-debian - run: - name: Install libusb + name: Install libusb, brew command: | sudo apt update -q sudo apt install -yq libusb-dev libusb-1.0.0-dev + /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" - run: name: Make distributables command: | @@ -121,8 +122,6 @@ jobs: # yes | ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install)" || true /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" - # eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" - # brew install go@1.17 libusb brew install go@1.17 export PATH=/usr/local/opt/go@1.17/bin:/usr/local/opt/coreutils/libexec/gnubin:/usr/local/bin:$PATH curl -Ls https://github.com/goreleaser/nfpm/releases/download/v1.2.0/nfpm_1.2.0_Darwin_x86_64.tar.gz > nfpm.tar.gz From a0c93257010205f8d2879638c30f5a99ad153b49 Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Thu, 22 Sep 2022 08:24:18 -0700 Subject: [PATCH 092/138] fixing linux part of release --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 999d1635..d779faba 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -73,6 +73,7 @@ jobs: - run: name: make tools and publish command: | + export PATH=/home/linuxbrew/.linuxbrew/bin/:$PATH make -f Makefile.tools github-release make -f Makefile.release publish-github-linux - persist_to_workspace: From 5445f188b4e66a780b1ac90604b9808c95e8a11a Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Thu, 22 Sep 2022 09:35:36 -0700 Subject: [PATCH 093/138] fixing linux part of release --- .circleci/config.yml | 121 ++++++++++++++++++++++++++----------------- 1 file changed, 74 insertions(+), 47 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index d779faba..c931b617 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -70,12 +70,12 @@ jobs: name: Make distributables command: | make -f Makefile.release dist-linux - - run: - name: make tools and publish - command: | - export PATH=/home/linuxbrew/.linuxbrew/bin/:$PATH - make -f Makefile.tools github-release - make -f Makefile.release publish-github-linux + # - run: + # name: make tools and publish + # command: | + # export PATH=/home/linuxbrew/.linuxbrew/bin/:$PATH + # make -f Makefile.tools github-release + # make -f Makefile.release publish-github-linux - persist_to_workspace: root: . paths: ['dist/*'] @@ -98,18 +98,18 @@ jobs: # sudo gem install rake # sudo make -f Makefile.tools package_cloud # make -f Makefile.release publish-packagecloud - publish-github-linux: - docker: - - image: circleci/golang:1.17 - working_directory: /go/src/github.com/optimizely/aws-okta - steps: - - checkout - - attach_workspace: { at: . } - - run: - name: Install tools - command: | - # make -f Makefile.tools github-release - # make -f Makefile.release publish-github-linux + # publish-github-linux: + # docker: + # - image: circleci/golang:1.17 + # working_directory: /go/src/github.com/optimizely/aws-okta + # steps: + # - checkout + # - attach_workspace: { at: . } + # - run: + # name: Install tools + # command: | + # # make -f Makefile.tools github-release + # # make -f Makefile.release publish-github-linux # ishih-opti - my change, add job list: dist-darwin and publish-github-darwin dist-darwin: @@ -139,31 +139,45 @@ jobs: command: | export PATH=/usr/local/opt/go@1.17/bin:/usr/local/opt/coreutils/libexec/gnubin:/usr/local/bin:$PATH make -f Makefile.release dist-darwin - - run: - name: make git release - command: | - echo "====== publish-github-darwin =====" - export PATH=/usr/local/opt/go@1.17/bin:/usr/local/opt/coreutils/libexec/gnubin:/usr/local/bin:$PATH - export GOPATH=/usr/local - export GIT_LOGIN=ishih-opti - make -f Makefile.tools github-release - make -f Makefile.release publish-github-darwin + # - run: + # name: make git release + # command: | + # echo "====== publish-github-darwin =====" + # export PATH=/usr/local/opt/go@1.17/bin:/usr/local/opt/coreutils/libexec/gnubin:/usr/local/bin:$PATH + # export GOPATH=/usr/local + # export GIT_LOGIN=ishih-opti + # make -f Makefile.tools github-release + # make -f Makefile.release publish-github-darwin - persist_to_workspace: root: . paths: ['dist/*'] - publish-github-darwin: - macos: - xcode: 12.5.1 # indicate our selected version of Xcode + # publish-github-darwin: + # macos: + # xcode: 12.5.1 # indicate our selected version of Xcode + # steps: + # - checkout + # - attach_workspace: { at: . } + # - run: + # name: Install tools + # command: | + # echo "====== the end =====" + # # export PATH=/usr/local/opt/go@1.17/bin:/usr/local/opt/coreutils/libexec/gnubin:/usr/local/bin:$PATH + # # make -f Makefile.tools github-release + # # make -f Makefile.release publish-github-darwin + publish-github: + docker: + - image: circleci/golang:1.17 + working_directory: /go/src/github.com/optimizely/aws-okta steps: - checkout - attach_workspace: { at: . } - run: name: Install tools command: | - echo "====== the end =====" - # export PATH=/usr/local/opt/go@1.17/bin:/usr/local/opt/coreutils/libexec/gnubin:/usr/local/bin:$PATH - # make -f Makefile.tools github-release - # make -f Makefile.release publish-github-darwin + export PATH=/home/linuxbrew/.linuxbrew/bin:/usr/local/opt/go@1.17/bin:/usr/local/opt/coreutils/libexec/gnubin:/usr/local/bin:$PATH + make -f Makefile.tools github-release + make -f Makefile.release publish-github-linux + make -f Makefile.release publish-github-darwin workflows: version: 2 @@ -196,22 +210,10 @@ workflows: # # release only on tag push events like vX[.Y.Z...][-whatever] # tags: # only: /v[0-9]+(\.[0-9]+)*(-[a-zA-Z0-9-]+)?/ - - publish-github-linux: + - publish-github: context: github-optimizelycircle-oss-release requires: - dist-linux - filters: - # never publish from a branch event - branches: - ignore: /.*/ - # disabled (temporarily?) due to https://github.com/optimizely/aws-okta/issues/301 - # release only on tag push events like vX[.Y.Z...][-whatever] - # tags: - # only: /v[0-9]+(\.[0-9]+)*(-[a-zA-Z0-9-]+)?/ - ### ishih-opti - add for dawrin - - publish-github-darwin: - context: github-optimizelycircle-oss-release - requires: - dist-darwin filters: # never publish from a branch event @@ -221,4 +223,29 @@ workflows: # release only on tag push events like vX[.Y.Z...][-whatever] # tags: # only: /v[0-9]+(\.[0-9]+)*(-[a-zA-Z0-9-]+)?/ + # - publish-github-linux: + # context: github-optimizelycircle-oss-release + # requires: + # - dist-linux + # filters: + # # never publish from a branch event + # branches: + # ignore: /.*/ + # # disabled (temporarily?) due to https://github.com/optimizely/aws-okta/issues/301 + # # release only on tag push events like vX[.Y.Z...][-whatever] + # # tags: + # # only: /v[0-9]+(\.[0-9]+)*(-[a-zA-Z0-9-]+)?/ + # ### ishih-opti - add for dawrin + # - publish-github-darwin: + # context: github-optimizelycircle-oss-release + # requires: + # - dist-darwin + # filters: + # # never publish from a branch event + # branches: + # ignore: /.*/ + # # disabled (temporarily?) due to https://github.com/optimizely/aws-okta/issues/301 + # # release only on tag push events like vX[.Y.Z...][-whatever] + # # tags: + # # only: /v[0-9]+(\.[0-9]+)*(-[a-zA-Z0-9-]+)?/ From f2d079dfc9337aca9c9a3f28f9721243fe7877bf Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Thu, 22 Sep 2022 09:45:52 -0700 Subject: [PATCH 094/138] fix release --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index c931b617..02e713e4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -215,6 +215,7 @@ workflows: requires: - dist-linux - dist-darwin + - publish-github filters: # never publish from a branch event branches: From 6778d0b33d5b9a5b76e20996aa969a2cf0297fbf Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Thu, 22 Sep 2022 09:48:24 -0700 Subject: [PATCH 095/138] fix release --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 02e713e4..7f04f66f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -164,7 +164,7 @@ jobs: # # export PATH=/usr/local/opt/go@1.17/bin:/usr/local/opt/coreutils/libexec/gnubin:/usr/local/bin:$PATH # # make -f Makefile.tools github-release # # make -f Makefile.release publish-github-darwin - publish-github: + release-github: docker: - image: circleci/golang:1.17 working_directory: /go/src/github.com/optimizely/aws-okta @@ -215,7 +215,7 @@ workflows: requires: - dist-linux - dist-darwin - - publish-github + - release-github filters: # never publish from a branch event branches: From 334f93fec01cea8958d840a07e3477864d1e81b9 Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Thu, 22 Sep 2022 09:49:36 -0700 Subject: [PATCH 096/138] fix release --- .circleci/config.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7f04f66f..c931b617 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -164,7 +164,7 @@ jobs: # # export PATH=/usr/local/opt/go@1.17/bin:/usr/local/opt/coreutils/libexec/gnubin:/usr/local/bin:$PATH # # make -f Makefile.tools github-release # # make -f Makefile.release publish-github-darwin - release-github: + publish-github: docker: - image: circleci/golang:1.17 working_directory: /go/src/github.com/optimizely/aws-okta @@ -215,7 +215,6 @@ workflows: requires: - dist-linux - dist-darwin - - release-github filters: # never publish from a branch event branches: From accca8fd1f2f9f6a0343cbee12ee25fbcb9ae5e6 Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Thu, 22 Sep 2022 10:17:35 -0700 Subject: [PATCH 097/138] fix release --- .circleci/config.yml | 23 +---------------------- Makefile.tools | 2 +- 2 files changed, 2 insertions(+), 23 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c931b617..1748cc5d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -65,7 +65,6 @@ jobs: command: | sudo apt update -q sudo apt install -yq libusb-dev libusb-1.0.0-dev - /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" - run: name: Make distributables command: | @@ -151,19 +150,6 @@ jobs: - persist_to_workspace: root: . paths: ['dist/*'] - # publish-github-darwin: - # macos: - # xcode: 12.5.1 # indicate our selected version of Xcode - # steps: - # - checkout - # - attach_workspace: { at: . } - # - run: - # name: Install tools - # command: | - # echo "====== the end =====" - # # export PATH=/usr/local/opt/go@1.17/bin:/usr/local/opt/coreutils/libexec/gnubin:/usr/local/bin:$PATH - # # make -f Makefile.tools github-release - # # make -f Makefile.release publish-github-darwin publish-github: docker: - image: circleci/golang:1.17 @@ -174,6 +160,7 @@ jobs: - run: name: Install tools command: | + /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" export PATH=/home/linuxbrew/.linuxbrew/bin:/usr/local/opt/go@1.17/bin:/usr/local/opt/coreutils/libexec/gnubin:/usr/local/bin:$PATH make -f Makefile.tools github-release make -f Makefile.release publish-github-linux @@ -215,14 +202,6 @@ workflows: requires: - dist-linux - dist-darwin - filters: - # never publish from a branch event - branches: - ignore: /.*/ - # disabled (temporarily?) due to https://github.com/optimizely/aws-okta/issues/301 - # release only on tag push events like vX[.Y.Z...][-whatever] - # tags: - # only: /v[0-9]+(\.[0-9]+)*(-[a-zA-Z0-9-]+)?/ # - publish-github-linux: # context: github-optimizelycircle-oss-release # requires: diff --git a/Makefile.tools b/Makefile.tools index 90e2f14c..7e9b5124 100644 --- a/Makefile.tools +++ b/Makefile.tools @@ -5,7 +5,7 @@ NFPM_VERSION := 1.2.0 #from https://github.com/goreleaser/nfpm/releases/download/v0.9.3/nfpm_1.2.0_checksums.txt NFPM_SHA256 := 4659e714cc3d1fc1fa3ba75bb531901b0d2a89e5f59171145fb89bf1d392cb29 - +OS = $(shell uname -s) nfpm-debian: cd /tmp && \ curl -Ls https://github.com/goreleaser/nfpm/releases/download/v${NFPM_VERSION}/nfpm_${NFPM_VERSION}_Linux_x86_64.tar.gz > nfpm.tar.gz && \ From d0dd42f15ecc08569c4839ee4bbfa1e52538e025 Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Thu, 22 Sep 2022 10:24:26 -0700 Subject: [PATCH 098/138] fix release --- .circleci/config.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1748cc5d..ed3a41e4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -202,6 +202,9 @@ workflows: requires: - dist-linux - dist-darwin + filters: + tags: + only: /.*/ # - publish-github-linux: # context: github-optimizelycircle-oss-release # requires: From c7257896ef8dc4a1ee8c44308e7d5e70290c096b Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Thu, 22 Sep 2022 10:37:41 -0700 Subject: [PATCH 099/138] debug release --- .circleci/config.yml | 4 +- Makefile.gh | 171 ------------------------------------------- 2 files changed, 2 insertions(+), 173 deletions(-) delete mode 100644 Makefile.gh diff --git a/.circleci/config.yml b/.circleci/config.yml index ed3a41e4..770b0040 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -69,6 +69,7 @@ jobs: name: Make distributables command: | make -f Makefile.release dist-linux + ls -l dist # - run: # name: make tools and publish # command: | @@ -119,8 +120,6 @@ jobs: - run: name: install packages command: | - - # yes | ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install)" || true /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" brew install go@1.17 export PATH=/usr/local/opt/go@1.17/bin:/usr/local/opt/coreutils/libexec/gnubin:/usr/local/bin:$PATH @@ -138,6 +137,7 @@ jobs: command: | export PATH=/usr/local/opt/go@1.17/bin:/usr/local/opt/coreutils/libexec/gnubin:/usr/local/bin:$PATH make -f Makefile.release dist-darwin + ls -l dist # - run: # name: make git release # command: | diff --git a/Makefile.gh b/Makefile.gh deleted file mode 100644 index 39a0b182..00000000 --- a/Makefile.gh +++ /dev/null @@ -1,171 +0,0 @@ -# Goals: -# - Linux releases can be published to Github automatically by CircleCI -# -# This Makefile is meant for machines - -include Makefile - -# use bash so we can use set -o pipefail -SHELL := /bin/bash -# set --pre-release if not tagged or tree is dirty or there's a `-` in the tag -#ifneq (,$(findstring -,$(VERSION))) -# GITHUB_RELEASE_FLAGS := "--pre-release" -# PACKAGECLOUD_NAME_SUFFIX := "-prerelease" -#endif - -# TODO: use this consistently; 99% of the time, we don't want a v -VERSION_NO_V := $(patsubst v%,%,$(VERSION))-test - -PACKAGECLOUD_DEB_DISTROS := \ - debian/stretch \ - ubuntu/trusty \ - ubuntu/xenial \ - ubuntu/bionic \ - ubuntu/disco \ - ubuntu/eoan \ - ubuntu/focal - -PACKAGECLOUD_RPM_DISTROS := \ - fedora/27 \ - fedora/28 \ - fedora/29 \ - fedora/30 - -publish: publish-github publish-packagecloud - -# note: this doesn't include sha256sums -publish-linux: publish-github-linux publish-packagecloud - -publish-github: publish-github-darwin publish-github-linux publish-github-sha256sums - -publish-github-darwin: publish-github-darwin-bin publish-github-darwin-bin-arm6 - -publish-github-linux: publish-github-linux-bin publish-github-deb publish-github-rpm - -publish-packagecloud: publish-packagecloud-deb publish-packagecloud-rpm - -gh: - set -o pipefail; \ - gh auth login --with-token $$GITHUB_TOKEN ; \ - gh release create $(VERSION) \ - --repo optimizely/aws-okta \ - --generate-notes \ - - -publish-github-darwin-bin: dist/aws-okta-$(VERSION)-darwin-amd64 | gh - gh upload \ - --security-token $$GITHUB_TOKEN \ - --auth-user $$GIT_LOGIN \ - --user optimizely \ - --repo aws-okta \ - --tag $(VERSION) \ - --name aws-okta-$(VERSION)-darwin-amd64 \ - --replace \ - --file $< - -publish-github-darwin-bin-arm64: dist/aws-okta-$(VERSION)-darwin-arm64 | gh - gh upload \ - --security-token $$GITHUB_TOKEN \ - --user optimizely \ - --repo aws-okta \ - --tag $(VERSION) \ - --name aws-okta-$(VERSION)-darwin-arm64 \ - --replace \ - --file $< - -publish-github-linux-bin: dist/aws-okta-$(VERSION)-linux-amd64 | gh - gh upload \ - --security-token $$GITHUB_TOKEN \ - --user optimizely \ - --repo aws-okta \ - --tag $(VERSION) \ - --name aws-okta-$(VERSION)-linux-amd64 \ - --replace \ - --file $< - -publish-github-deb: dist/aws-okta_$(VERSION)_amd64.deb | gh - gh upload \ - --security-token $$GITHUB_TOKEN \ - --user optimizely \ - --repo aws-okta \ - --tag $(VERSION) \ - --name aws-okta_$(VERSION)_amd64.deb \ - --replace \ - --file $< - -publish-github-rpm: dist/aws-okta_$(VERSION)_amd64.rpm | gh - gh upload \ - --security-token $$GITHUB_TOKEN \ - --user optimizely \ - --repo aws-okta \ - --tag $(VERSION) \ - --name aws-okta_$(VERSION)_amd64.rpm \ - --replace \ - --file $< - -publish-github-sha256sums: dist/aws-okta-$(VERSION).sha256sums | gh - gh upload \ - --security-token $$GITHUB_TOKEN \ - --user optimizely \ - --repo aws-okta \ - --tag $(VERSION) \ - --name aws-okta-$(VERSION).sha256sums \ - --replace \ - --file dist/aws-okta-$(VERSION).sha256sums - -packagecloud.conf.json: - @echo "{\"url\":\"https://packagecloud.io\",\"token\":\"$${PACKAGECLOUD_TOKEN}\"}" > $@ - -# package_cloud prints the last 4 chars of our token :( -# so we attempt to filter that out - -publish-packagecloud-deb: dist/aws-okta_$(VERSION)_amd64.deb packagecloud.conf.json - @set -o pipefail; \ - for v in $(PACKAGECLOUD_DEB_DISTROS); do \ - (package_cloud yank --config packagecloud.conf.json optimizely/aws-okta$(PACKAGECLOUD_NAME_SUFFIX)/$$v aws-okta_$(VERSION_NO_V)_amd64.deb || true) | \ - grep -v 'with token:' || true ; \ - package_cloud push --config packagecloud.conf.json optimizely/aws-okta$(PACKAGECLOUD_NAME_SUFFIX)/$$v $< | \ - grep -v 'with token:' ; \ - done - -publish-packagecloud-rpm: dist/aws-okta_$(VERSION)_amd64.rpm packagecloud.conf.json - @set -o pipefail; \ - for v in $(PACKAGECLOUD_RPM_DISTROS); do \ - (package_cloud yank --config packagecloud.conf.json optimizely/aws-okta$(PACKAGECLOUD_NAME_SUFFIX)/$$v aws-okta-$(subst -,_,$(VERSION_NO_V))-1.x86_64.rpm || true) | \ - grep -v 'with token:' || true ; \ - package_cloud push --config packagecloud.conf.json optimizely/aws-okta$(PACKAGECLOUD_NAME_SUFFIX)/$$v $< | \ - grep -v 'with token:' ; \ - done - -dist: dist-darwin dist-linux dist/aws-okta-$(VERSION).sha256sums - -dist-darwin: dist/aws-okta-$(VERSION)-darwin-amd64 dist/aws-okta-$(VERSION)-darwin-arm64 - -dist-linux: dist/aws-okta-$(VERSION)-linux-amd64 dist/aws-okta_$(VERSION)_amd64.deb dist/aws-okta_$(VERSION)_amd64.rpm - -dist/aws-okta-$(VERSION).sha256sums: dist/aws-okta-$(VERSION)-darwin-amd64 dist/aws-okta-$(VERSION)-linux-amd64 dist/aws-okta_$(VERSION)_amd64.deb dist/aws-okta_$(VERSION)_amd64.rpm - sha256sum $^ | sed 's|dist/||g' > $@ - -dist/nfpm-$(VERSION).yaml: | dist/ - sed -e "s/\$${VERSION}/$(VERSION)/g" -e "s|\$${DIST_BIN}|dist/aws-okta-$(VERSION)-linux-amd64|g" < nfpm.yaml.tmpl > $@ - -dist/aws-okta_$(VERSION)_amd64.deb: dist/nfpm-$(VERSION).yaml dist/aws-okta-$(VERSION)-linux-amd64 - nfpm -f $< pkg --target $@ - -dist/aws-okta_$(VERSION)_amd64.rpm: dist/nfpm-$(VERSION).yaml dist/aws-okta-$(VERSION)-linux-amd64 - nfpm -f $< pkg --target $@ - -.PHONY: \ - dist \ - dist-darwin \ - dist-linux \ - publish \ - publish-github \ - publish-github-linux \ - publish-github-linux-bin \ - publish-github-rpm \ - publish-github-deb \ - publish-github-darwin \ - publish-github-darwin-bin \ - publish-github-darwin-bin-arm64 \ - gh From 0b4e5455c1d82a1f57ab9242f68652dd6dcc22eb Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Thu, 22 Sep 2022 10:50:07 -0700 Subject: [PATCH 100/138] debug release --- .circleci/config.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 770b0040..3794d4b9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -76,9 +76,9 @@ jobs: # export PATH=/home/linuxbrew/.linuxbrew/bin/:$PATH # make -f Makefile.tools github-release # make -f Makefile.release publish-github-linux - - persist_to_workspace: - root: . - paths: ['dist/*'] + # - persist_to_workspace: + # root: . + # paths: ['dist/*'] # publish-packagecloud: # docker: From cb3a8306e638e6f3a9bd9849e37a92799ced4aba Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Thu, 22 Sep 2022 11:05:45 -0700 Subject: [PATCH 101/138] debug release --- .circleci/config.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3794d4b9..436e268b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -163,8 +163,9 @@ jobs: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" export PATH=/home/linuxbrew/.linuxbrew/bin:/usr/local/opt/go@1.17/bin:/usr/local/opt/coreutils/libexec/gnubin:/usr/local/bin:$PATH make -f Makefile.tools github-release - make -f Makefile.release publish-github-linux make -f Makefile.release publish-github-darwin + make -f Makefile.release publish-github-linux + workflows: version: 2 From e7ad595e961ec1d884a77cca936fbc0344cfa53e Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Thu, 22 Sep 2022 11:17:49 -0700 Subject: [PATCH 102/138] debug release --- .circleci/config.yml | 1 + Makefile.tools | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 436e268b..11ce4151 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -162,6 +162,7 @@ jobs: command: | /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" export PATH=/home/linuxbrew/.linuxbrew/bin:/usr/local/opt/go@1.17/bin:/usr/local/opt/coreutils/libexec/gnubin:/usr/local/bin:$PATH + export GIT_LOGIN=ishih-opti make -f Makefile.tools github-release make -f Makefile.release publish-github-darwin make -f Makefile.release publish-github-linux diff --git a/Makefile.tools b/Makefile.tools index 7e9b5124..ccbeceb3 100644 --- a/Makefile.tools +++ b/Makefile.tools @@ -25,7 +25,7 @@ sha256sum-darwin: # && ln -s $$(which gsha256sum) /usr/local/bin/sha256sum github-release: - #GO111MODULE=off go install github.com/aktau/github-release@latest + #GO111MODULE=off go install github.com/aktau/github-release brew install github-release package_cloud: From d4ed98d117ff8c3e8c9a442ab77ea36d9d0d9c95 Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Thu, 22 Sep 2022 11:30:12 -0700 Subject: [PATCH 103/138] debug release --- Makefile.release | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.release b/Makefile.release index 8501d303..82243ab3 100644 --- a/Makefile.release +++ b/Makefile.release @@ -51,7 +51,7 @@ publish-packagecloud: publish-packagecloud-deb publish-packagecloud-rpm github-release: set -o pipefail; \ - echo -n | github-release release \ + echo -n "test" | github-release release \ --user optimizely \ --repo aws-okta \ --tag $(VERSION) \ From 5ef1f8cef034b96a637b71e10df9927ba1b450f1 Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Thu, 22 Sep 2022 14:30:43 -0700 Subject: [PATCH 104/138] debug release --- .circleci/config.yml | 1 - Makefile.release | 1 - 2 files changed, 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 11ce4151..436e268b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -162,7 +162,6 @@ jobs: command: | /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" export PATH=/home/linuxbrew/.linuxbrew/bin:/usr/local/opt/go@1.17/bin:/usr/local/opt/coreutils/libexec/gnubin:/usr/local/bin:$PATH - export GIT_LOGIN=ishih-opti make -f Makefile.tools github-release make -f Makefile.release publish-github-darwin make -f Makefile.release publish-github-linux diff --git a/Makefile.release b/Makefile.release index 82243ab3..04435947 100644 --- a/Makefile.release +++ b/Makefile.release @@ -61,7 +61,6 @@ github-release: publish-github-darwin-bin: dist/aws-okta-$(VERSION)-darwin-amd64 | github-release github-release upload \ - --auth-user $$GIT_LOGIN \ --user optimizely \ --repo aws-okta \ --tag $(VERSION) \ From 1405ba68ebf3809c4dc8cf700311fc212e2b539e Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Thu, 22 Sep 2022 14:35:48 -0700 Subject: [PATCH 105/138] debug release --- Makefile.release | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile.release b/Makefile.release index 04435947..a56a22e8 100644 --- a/Makefile.release +++ b/Makefile.release @@ -14,7 +14,8 @@ SHELL := /bin/bash #endif # TODO: use this consistently; 99% of the time, we don't want a v -VERSION_NO_V := $(patsubst v%,%,$(VERSION))-test +# VERSION_NO_V := $(patsubst v%,%,$(VERSION))-test +VERSION_NO_V := v2.0.0 PACKAGECLOUD_DEB_DISTROS := \ debian/stretch \ From f7b36067a6358876dd5d8309ef575ae03dca6888 Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Thu, 22 Sep 2022 14:57:09 -0700 Subject: [PATCH 106/138] debug release --- Makefile | 3 ++- Makefile.release | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 9551cf5e..bb8c8f37 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,8 @@ # This makefile is meant for humans # VERSION := $(shell git describe --tags --always --dirty="-dev") -VERSION := $(shell git describe --tags --always --dirty="-dev"|cut -d"-" -f 1 )-test +# VERSION := $(shell git describe --tags --always --dirty="-dev"|cut -d"-" -f 1 ) +VERSION := $(shell echo "v2.0.0") LDFLAGS := -ldflags='-X "main.Version=$(VERSION)"' test: diff --git a/Makefile.release b/Makefile.release index a56a22e8..9d5631f7 100644 --- a/Makefile.release +++ b/Makefile.release @@ -14,8 +14,7 @@ SHELL := /bin/bash #endif # TODO: use this consistently; 99% of the time, we don't want a v -# VERSION_NO_V := $(patsubst v%,%,$(VERSION))-test -VERSION_NO_V := v2.0.0 +VERSION_NO_V := $(patsubst v%,%,$(VERSION)) PACKAGECLOUD_DEB_DISTROS := \ debian/stretch \ From a520050dfe477cd379cfd8724a5b51d1b6934468 Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Thu, 22 Sep 2022 15:09:52 -0700 Subject: [PATCH 107/138] debug release --- .circleci/config.yml | 29 +++++++++++++++-------------- Makefile.release | 3 +-- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 436e268b..97cfd02f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -138,15 +138,16 @@ jobs: export PATH=/usr/local/opt/go@1.17/bin:/usr/local/opt/coreutils/libexec/gnubin:/usr/local/bin:$PATH make -f Makefile.release dist-darwin ls -l dist - # - run: - # name: make git release - # command: | - # echo "====== publish-github-darwin =====" - # export PATH=/usr/local/opt/go@1.17/bin:/usr/local/opt/coreutils/libexec/gnubin:/usr/local/bin:$PATH - # export GOPATH=/usr/local - # export GIT_LOGIN=ishih-opti - # make -f Makefile.tools github-release - # make -f Makefile.release publish-github-darwin + - run: + name: make git release + command: | + echo "====== publish-github-darwin =====" + export PATH=/usr/local/opt/go@1.17/bin:/usr/local/opt/coreutils/libexec/gnubin:/usr/local/bin:$PATH + export GOPATH=/usr/local + export GIT_LOGIN=ishih-opti + make -f Makefile.tools github-release + make -f Makefile.release publish-github-darwin + make -f Makefile.release publish-github-linux - persist_to_workspace: root: . paths: ['dist/*'] @@ -160,11 +161,11 @@ jobs: - run: name: Install tools command: | - /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" - export PATH=/home/linuxbrew/.linuxbrew/bin:/usr/local/opt/go@1.17/bin:/usr/local/opt/coreutils/libexec/gnubin:/usr/local/bin:$PATH - make -f Makefile.tools github-release - make -f Makefile.release publish-github-darwin - make -f Makefile.release publish-github-linux + # /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" + # export PATH=/home/linuxbrew/.linuxbrew/bin:/usr/local/opt/go@1.17/bin:/usr/local/opt/coreutils/libexec/gnubin:/usr/local/bin:$PATH + # make -f Makefile.tools github-release + # make -f Makefile.release publish-github-darwin + # make -f Makefile.release publish-github-linux workflows: diff --git a/Makefile.release b/Makefile.release index 9d5631f7..4e3c5437 100644 --- a/Makefile.release +++ b/Makefile.release @@ -56,8 +56,7 @@ github-release: --repo aws-okta \ --tag $(VERSION) \ --description - \ - --name $(VERSION) \ - --pre-release + --name $(VERSION) publish-github-darwin-bin: dist/aws-okta-$(VERSION)-darwin-amd64 | github-release github-release upload \ From 186386adc306b704876b466d05607d21cfcdac7c Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Thu, 22 Sep 2022 15:17:13 -0700 Subject: [PATCH 108/138] debug release --- Makefile.release | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/Makefile.release b/Makefile.release index 4e3c5437..cc3ce5be 100644 --- a/Makefile.release +++ b/Makefile.release @@ -44,16 +44,12 @@ publish-github-linux: publish-github-linux-bin publish-github-deb publish-github publish-packagecloud: publish-packagecloud-deb publish-packagecloud-rpm -# $(GITHUB_RELEASE_FLAGS) \ - -# scripts/changelog | github-release release \ - - github-release: set -o pipefail; \ - echo -n "test" | github-release release \ + scripts/changelog | github-release release \ --user optimizely \ --repo aws-okta \ + $(GITHUB_RELEASE_FLAGS) \ --tag $(VERSION) \ --description - \ --name $(VERSION) From a527151dcfde574b752c53f04c97fc7d6225ebf3 Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Thu, 22 Sep 2022 15:27:22 -0700 Subject: [PATCH 109/138] Revert "add linix part to the code" This reverts commit 2d44e2c22632c0ab824fa07119ab4b90f32320ee. --- .circleci/config.yml | 111 +++++++++++++--------------- Makefile | 3 +- Makefile.gh | 171 +++++++++++++++++++++++++++++++++++++++++++ Makefile.release | 14 +++- Makefile.tools | 4 +- 5 files changed, 234 insertions(+), 69 deletions(-) create mode 100644 Makefile.gh diff --git a/.circleci/config.yml b/.circleci/config.yml index 97cfd02f..ff17abd2 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -61,7 +61,7 @@ jobs: command: | sudo make -f Makefile.tools nfpm-debian rpmbuild-debian - run: - name: Install libusb, brew + name: Install libusb command: | sudo apt update -q sudo apt install -yq libusb-dev libusb-1.0.0-dev @@ -69,16 +69,14 @@ jobs: name: Make distributables command: | make -f Makefile.release dist-linux - ls -l dist - # - run: - # name: make tools and publish - # command: | - # export PATH=/home/linuxbrew/.linuxbrew/bin/:$PATH - # make -f Makefile.tools github-release - # make -f Makefile.release publish-github-linux - # - persist_to_workspace: - # root: . - # paths: ['dist/*'] + - run: + name: make tools and publish + command: | + make -f Makefile.tools github-release + make -f Makefile.release publish-github-linux + - persist_to_workspace: + root: . + paths: ['dist/*'] # publish-packagecloud: # docker: @@ -98,18 +96,18 @@ jobs: # sudo gem install rake # sudo make -f Makefile.tools package_cloud # make -f Makefile.release publish-packagecloud - # publish-github-linux: - # docker: - # - image: circleci/golang:1.17 - # working_directory: /go/src/github.com/optimizely/aws-okta - # steps: - # - checkout - # - attach_workspace: { at: . } - # - run: - # name: Install tools - # command: | - # # make -f Makefile.tools github-release - # # make -f Makefile.release publish-github-linux + publish-github-linux: + docker: + - image: circleci/golang:1.17 + working_directory: /go/src/github.com/optimizely/aws-okta + steps: + - checkout + - attach_workspace: { at: . } + - run: + name: Install tools + command: | + # make -f Makefile.tools github-release + # make -f Makefile.release publish-github-linux # ishih-opti - my change, add job list: dist-darwin and publish-github-darwin dist-darwin: @@ -120,7 +118,11 @@ jobs: - run: name: install packages command: | + + # yes | ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install)" || true /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" + # eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" + # brew install go@1.17 libusb brew install go@1.17 export PATH=/usr/local/opt/go@1.17/bin:/usr/local/opt/coreutils/libexec/gnubin:/usr/local/bin:$PATH curl -Ls https://github.com/goreleaser/nfpm/releases/download/v1.2.0/nfpm_1.2.0_Darwin_x86_64.tar.gz > nfpm.tar.gz @@ -137,7 +139,6 @@ jobs: command: | export PATH=/usr/local/opt/go@1.17/bin:/usr/local/opt/coreutils/libexec/gnubin:/usr/local/bin:$PATH make -f Makefile.release dist-darwin - ls -l dist - run: name: make git release command: | @@ -147,26 +148,22 @@ jobs: export GIT_LOGIN=ishih-opti make -f Makefile.tools github-release make -f Makefile.release publish-github-darwin - make -f Makefile.release publish-github-linux - persist_to_workspace: root: . paths: ['dist/*'] - publish-github: - docker: - - image: circleci/golang:1.17 - working_directory: /go/src/github.com/optimizely/aws-okta + publish-github-darwin: + macos: + xcode: 12.5.1 # indicate our selected version of Xcode steps: - checkout - attach_workspace: { at: . } - run: name: Install tools command: | - # /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" - # export PATH=/home/linuxbrew/.linuxbrew/bin:/usr/local/opt/go@1.17/bin:/usr/local/opt/coreutils/libexec/gnubin:/usr/local/bin:$PATH + echo "====== the end =====" + # export PATH=/usr/local/opt/go@1.17/bin:/usr/local/opt/coreutils/libexec/gnubin:/usr/local/bin:$PATH # make -f Makefile.tools github-release # make -f Makefile.release publish-github-darwin - # make -f Makefile.release publish-github-linux - workflows: version: 2 @@ -199,37 +196,29 @@ workflows: # # release only on tag push events like vX[.Y.Z...][-whatever] # tags: # only: /v[0-9]+(\.[0-9]+)*(-[a-zA-Z0-9-]+)?/ - - publish-github: + - publish-github-linux: context: github-optimizelycircle-oss-release requires: - dist-linux + filters: + # never publish from a branch event + branches: + ignore: /.*/ + # disabled (temporarily?) due to https://github.com/optimizely/aws-okta/issues/301 + # release only on tag push events like vX[.Y.Z...][-whatever] + # tags: + # only: /v[0-9]+(\.[0-9]+)*(-[a-zA-Z0-9-]+)?/ + ### ishih-opti - add for dawrin + - publish-github-darwin: + context: github-optimizelycircle-oss-release + requires: - dist-darwin filters: - tags: - only: /.*/ - # - publish-github-linux: - # context: github-optimizelycircle-oss-release - # requires: - # - dist-linux - # filters: - # # never publish from a branch event - # branches: - # ignore: /.*/ - # # disabled (temporarily?) due to https://github.com/optimizely/aws-okta/issues/301 - # # release only on tag push events like vX[.Y.Z...][-whatever] - # # tags: - # # only: /v[0-9]+(\.[0-9]+)*(-[a-zA-Z0-9-]+)?/ - # ### ishih-opti - add for dawrin - # - publish-github-darwin: - # context: github-optimizelycircle-oss-release - # requires: - # - dist-darwin - # filters: - # # never publish from a branch event - # branches: - # ignore: /.*/ - # # disabled (temporarily?) due to https://github.com/optimizely/aws-okta/issues/301 - # # release only on tag push events like vX[.Y.Z...][-whatever] - # # tags: - # # only: /v[0-9]+(\.[0-9]+)*(-[a-zA-Z0-9-]+)?/ + # never publish from a branch event + branches: + ignore: /.*/ + # disabled (temporarily?) due to https://github.com/optimizely/aws-okta/issues/301 + # release only on tag push events like vX[.Y.Z...][-whatever] + # tags: + # only: /v[0-9]+(\.[0-9]+)*(-[a-zA-Z0-9-]+)?/ diff --git a/Makefile b/Makefile index bb8c8f37..9551cf5e 100644 --- a/Makefile +++ b/Makefile @@ -5,8 +5,7 @@ # This makefile is meant for humans # VERSION := $(shell git describe --tags --always --dirty="-dev") -# VERSION := $(shell git describe --tags --always --dirty="-dev"|cut -d"-" -f 1 ) -VERSION := $(shell echo "v2.0.0") +VERSION := $(shell git describe --tags --always --dirty="-dev"|cut -d"-" -f 1 )-test LDFLAGS := -ldflags='-X "main.Version=$(VERSION)"' test: diff --git a/Makefile.gh b/Makefile.gh new file mode 100644 index 00000000..39a0b182 --- /dev/null +++ b/Makefile.gh @@ -0,0 +1,171 @@ +# Goals: +# - Linux releases can be published to Github automatically by CircleCI +# +# This Makefile is meant for machines + +include Makefile + +# use bash so we can use set -o pipefail +SHELL := /bin/bash +# set --pre-release if not tagged or tree is dirty or there's a `-` in the tag +#ifneq (,$(findstring -,$(VERSION))) +# GITHUB_RELEASE_FLAGS := "--pre-release" +# PACKAGECLOUD_NAME_SUFFIX := "-prerelease" +#endif + +# TODO: use this consistently; 99% of the time, we don't want a v +VERSION_NO_V := $(patsubst v%,%,$(VERSION))-test + +PACKAGECLOUD_DEB_DISTROS := \ + debian/stretch \ + ubuntu/trusty \ + ubuntu/xenial \ + ubuntu/bionic \ + ubuntu/disco \ + ubuntu/eoan \ + ubuntu/focal + +PACKAGECLOUD_RPM_DISTROS := \ + fedora/27 \ + fedora/28 \ + fedora/29 \ + fedora/30 + +publish: publish-github publish-packagecloud + +# note: this doesn't include sha256sums +publish-linux: publish-github-linux publish-packagecloud + +publish-github: publish-github-darwin publish-github-linux publish-github-sha256sums + +publish-github-darwin: publish-github-darwin-bin publish-github-darwin-bin-arm6 + +publish-github-linux: publish-github-linux-bin publish-github-deb publish-github-rpm + +publish-packagecloud: publish-packagecloud-deb publish-packagecloud-rpm + +gh: + set -o pipefail; \ + gh auth login --with-token $$GITHUB_TOKEN ; \ + gh release create $(VERSION) \ + --repo optimizely/aws-okta \ + --generate-notes \ + + +publish-github-darwin-bin: dist/aws-okta-$(VERSION)-darwin-amd64 | gh + gh upload \ + --security-token $$GITHUB_TOKEN \ + --auth-user $$GIT_LOGIN \ + --user optimizely \ + --repo aws-okta \ + --tag $(VERSION) \ + --name aws-okta-$(VERSION)-darwin-amd64 \ + --replace \ + --file $< + +publish-github-darwin-bin-arm64: dist/aws-okta-$(VERSION)-darwin-arm64 | gh + gh upload \ + --security-token $$GITHUB_TOKEN \ + --user optimizely \ + --repo aws-okta \ + --tag $(VERSION) \ + --name aws-okta-$(VERSION)-darwin-arm64 \ + --replace \ + --file $< + +publish-github-linux-bin: dist/aws-okta-$(VERSION)-linux-amd64 | gh + gh upload \ + --security-token $$GITHUB_TOKEN \ + --user optimizely \ + --repo aws-okta \ + --tag $(VERSION) \ + --name aws-okta-$(VERSION)-linux-amd64 \ + --replace \ + --file $< + +publish-github-deb: dist/aws-okta_$(VERSION)_amd64.deb | gh + gh upload \ + --security-token $$GITHUB_TOKEN \ + --user optimizely \ + --repo aws-okta \ + --tag $(VERSION) \ + --name aws-okta_$(VERSION)_amd64.deb \ + --replace \ + --file $< + +publish-github-rpm: dist/aws-okta_$(VERSION)_amd64.rpm | gh + gh upload \ + --security-token $$GITHUB_TOKEN \ + --user optimizely \ + --repo aws-okta \ + --tag $(VERSION) \ + --name aws-okta_$(VERSION)_amd64.rpm \ + --replace \ + --file $< + +publish-github-sha256sums: dist/aws-okta-$(VERSION).sha256sums | gh + gh upload \ + --security-token $$GITHUB_TOKEN \ + --user optimizely \ + --repo aws-okta \ + --tag $(VERSION) \ + --name aws-okta-$(VERSION).sha256sums \ + --replace \ + --file dist/aws-okta-$(VERSION).sha256sums + +packagecloud.conf.json: + @echo "{\"url\":\"https://packagecloud.io\",\"token\":\"$${PACKAGECLOUD_TOKEN}\"}" > $@ + +# package_cloud prints the last 4 chars of our token :( +# so we attempt to filter that out + +publish-packagecloud-deb: dist/aws-okta_$(VERSION)_amd64.deb packagecloud.conf.json + @set -o pipefail; \ + for v in $(PACKAGECLOUD_DEB_DISTROS); do \ + (package_cloud yank --config packagecloud.conf.json optimizely/aws-okta$(PACKAGECLOUD_NAME_SUFFIX)/$$v aws-okta_$(VERSION_NO_V)_amd64.deb || true) | \ + grep -v 'with token:' || true ; \ + package_cloud push --config packagecloud.conf.json optimizely/aws-okta$(PACKAGECLOUD_NAME_SUFFIX)/$$v $< | \ + grep -v 'with token:' ; \ + done + +publish-packagecloud-rpm: dist/aws-okta_$(VERSION)_amd64.rpm packagecloud.conf.json + @set -o pipefail; \ + for v in $(PACKAGECLOUD_RPM_DISTROS); do \ + (package_cloud yank --config packagecloud.conf.json optimizely/aws-okta$(PACKAGECLOUD_NAME_SUFFIX)/$$v aws-okta-$(subst -,_,$(VERSION_NO_V))-1.x86_64.rpm || true) | \ + grep -v 'with token:' || true ; \ + package_cloud push --config packagecloud.conf.json optimizely/aws-okta$(PACKAGECLOUD_NAME_SUFFIX)/$$v $< | \ + grep -v 'with token:' ; \ + done + +dist: dist-darwin dist-linux dist/aws-okta-$(VERSION).sha256sums + +dist-darwin: dist/aws-okta-$(VERSION)-darwin-amd64 dist/aws-okta-$(VERSION)-darwin-arm64 + +dist-linux: dist/aws-okta-$(VERSION)-linux-amd64 dist/aws-okta_$(VERSION)_amd64.deb dist/aws-okta_$(VERSION)_amd64.rpm + +dist/aws-okta-$(VERSION).sha256sums: dist/aws-okta-$(VERSION)-darwin-amd64 dist/aws-okta-$(VERSION)-linux-amd64 dist/aws-okta_$(VERSION)_amd64.deb dist/aws-okta_$(VERSION)_amd64.rpm + sha256sum $^ | sed 's|dist/||g' > $@ + +dist/nfpm-$(VERSION).yaml: | dist/ + sed -e "s/\$${VERSION}/$(VERSION)/g" -e "s|\$${DIST_BIN}|dist/aws-okta-$(VERSION)-linux-amd64|g" < nfpm.yaml.tmpl > $@ + +dist/aws-okta_$(VERSION)_amd64.deb: dist/nfpm-$(VERSION).yaml dist/aws-okta-$(VERSION)-linux-amd64 + nfpm -f $< pkg --target $@ + +dist/aws-okta_$(VERSION)_amd64.rpm: dist/nfpm-$(VERSION).yaml dist/aws-okta-$(VERSION)-linux-amd64 + nfpm -f $< pkg --target $@ + +.PHONY: \ + dist \ + dist-darwin \ + dist-linux \ + publish \ + publish-github \ + publish-github-linux \ + publish-github-linux-bin \ + publish-github-rpm \ + publish-github-deb \ + publish-github-darwin \ + publish-github-darwin-bin \ + publish-github-darwin-bin-arm64 \ + gh diff --git a/Makefile.release b/Makefile.release index cc3ce5be..8501d303 100644 --- a/Makefile.release +++ b/Makefile.release @@ -14,7 +14,7 @@ SHELL := /bin/bash #endif # TODO: use this consistently; 99% of the time, we don't want a v -VERSION_NO_V := $(patsubst v%,%,$(VERSION)) +VERSION_NO_V := $(patsubst v%,%,$(VERSION))-test PACKAGECLOUD_DEB_DISTROS := \ debian/stretch \ @@ -44,18 +44,24 @@ publish-github-linux: publish-github-linux-bin publish-github-deb publish-github publish-packagecloud: publish-packagecloud-deb publish-packagecloud-rpm +# $(GITHUB_RELEASE_FLAGS) \ + +# scripts/changelog | github-release release \ + + github-release: set -o pipefail; \ - scripts/changelog | github-release release \ + echo -n | github-release release \ --user optimizely \ --repo aws-okta \ - $(GITHUB_RELEASE_FLAGS) \ --tag $(VERSION) \ --description - \ - --name $(VERSION) + --name $(VERSION) \ + --pre-release publish-github-darwin-bin: dist/aws-okta-$(VERSION)-darwin-amd64 | github-release github-release upload \ + --auth-user $$GIT_LOGIN \ --user optimizely \ --repo aws-okta \ --tag $(VERSION) \ diff --git a/Makefile.tools b/Makefile.tools index ccbeceb3..90e2f14c 100644 --- a/Makefile.tools +++ b/Makefile.tools @@ -5,7 +5,7 @@ NFPM_VERSION := 1.2.0 #from https://github.com/goreleaser/nfpm/releases/download/v0.9.3/nfpm_1.2.0_checksums.txt NFPM_SHA256 := 4659e714cc3d1fc1fa3ba75bb531901b0d2a89e5f59171145fb89bf1d392cb29 -OS = $(shell uname -s) + nfpm-debian: cd /tmp && \ curl -Ls https://github.com/goreleaser/nfpm/releases/download/v${NFPM_VERSION}/nfpm_${NFPM_VERSION}_Linux_x86_64.tar.gz > nfpm.tar.gz && \ @@ -25,7 +25,7 @@ sha256sum-darwin: # && ln -s $$(which gsha256sum) /usr/local/bin/sha256sum github-release: - #GO111MODULE=off go install github.com/aktau/github-release + #GO111MODULE=off go install github.com/aktau/github-release@latest brew install github-release package_cloud: From 4f1738ef6a56deed76d096a0dbc07bf8324195d7 Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Thu, 22 Sep 2022 16:02:18 -0700 Subject: [PATCH 110/138] testing verbose mode --- Makefile.release | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile.release b/Makefile.release index 8501d303..a30220d3 100644 --- a/Makefile.release +++ b/Makefile.release @@ -51,7 +51,7 @@ publish-packagecloud: publish-packagecloud-deb publish-packagecloud-rpm github-release: set -o pipefail; \ - echo -n | github-release release \ + echo -n | github-release -v release \ --user optimizely \ --repo aws-okta \ --tag $(VERSION) \ @@ -60,7 +60,7 @@ github-release: --pre-release publish-github-darwin-bin: dist/aws-okta-$(VERSION)-darwin-amd64 | github-release - github-release upload \ + github-release -v upload \ --auth-user $$GIT_LOGIN \ --user optimizely \ --repo aws-okta \ @@ -70,7 +70,7 @@ publish-github-darwin-bin: dist/aws-okta-$(VERSION)-darwin-amd64 | github-releas --file $< publish-github-darwin-bin-arm64: dist/aws-okta-$(VERSION)-darwin-arm64 | github-release - github-release upload \ + github-release -v upload \ --user optimizely \ --repo aws-okta \ --tag $(VERSION) \ From 77fb630374ea30da73526ea8104667fc7e682954 Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Thu, 22 Sep 2022 16:35:53 -0700 Subject: [PATCH 111/138] add timing btwn github-release commands --- Makefile.release | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.release b/Makefile.release index a30220d3..f9699c85 100644 --- a/Makefile.release +++ b/Makefile.release @@ -57,7 +57,7 @@ github-release: --tag $(VERSION) \ --description - \ --name $(VERSION) \ - --pre-release + --pre-release ; sleep 60 publish-github-darwin-bin: dist/aws-okta-$(VERSION)-darwin-amd64 | github-release github-release -v upload \ From 226f9f6ca21bc9f57c43e725375d1791ef4b0245 Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Thu, 22 Sep 2022 17:01:18 -0700 Subject: [PATCH 112/138] Revert "fixing linux part of release" This reverts commit a0c93257010205f8d2879638c30f5a99ad153b49. --- .circleci/config.yml | 5 ++--- Makefile.release | 8 ++++---- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ff17abd2..999d1635 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -61,10 +61,11 @@ jobs: command: | sudo make -f Makefile.tools nfpm-debian rpmbuild-debian - run: - name: Install libusb + name: Install libusb, brew command: | sudo apt update -q sudo apt install -yq libusb-dev libusb-1.0.0-dev + /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" - run: name: Make distributables command: | @@ -121,8 +122,6 @@ jobs: # yes | ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install)" || true /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" - # eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" - # brew install go@1.17 libusb brew install go@1.17 export PATH=/usr/local/opt/go@1.17/bin:/usr/local/opt/coreutils/libexec/gnubin:/usr/local/bin:$PATH curl -Ls https://github.com/goreleaser/nfpm/releases/download/v1.2.0/nfpm_1.2.0_Darwin_x86_64.tar.gz > nfpm.tar.gz diff --git a/Makefile.release b/Makefile.release index f9699c85..8501d303 100644 --- a/Makefile.release +++ b/Makefile.release @@ -51,16 +51,16 @@ publish-packagecloud: publish-packagecloud-deb publish-packagecloud-rpm github-release: set -o pipefail; \ - echo -n | github-release -v release \ + echo -n | github-release release \ --user optimizely \ --repo aws-okta \ --tag $(VERSION) \ --description - \ --name $(VERSION) \ - --pre-release ; sleep 60 + --pre-release publish-github-darwin-bin: dist/aws-okta-$(VERSION)-darwin-amd64 | github-release - github-release -v upload \ + github-release upload \ --auth-user $$GIT_LOGIN \ --user optimizely \ --repo aws-okta \ @@ -70,7 +70,7 @@ publish-github-darwin-bin: dist/aws-okta-$(VERSION)-darwin-amd64 | github-releas --file $< publish-github-darwin-bin-arm64: dist/aws-okta-$(VERSION)-darwin-arm64 | github-release - github-release -v upload \ + github-release upload \ --user optimizely \ --repo aws-okta \ --tag $(VERSION) \ From 664766b866dae0e61cec11345c34f2ba198178f7 Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Thu, 22 Sep 2022 17:17:40 -0700 Subject: [PATCH 113/138] Revert "debug release" This reverts commit cb3a8306e638e6f3a9bd9849e37a92799ced4aba. --- .circleci/config.yml | 128 +++++++++++++++++--------------- Makefile.gh | 171 ------------------------------------------- Makefile.tools | 2 +- 3 files changed, 70 insertions(+), 231 deletions(-) delete mode 100644 Makefile.gh diff --git a/.circleci/config.yml b/.circleci/config.yml index 999d1635..3794d4b9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -65,19 +65,20 @@ jobs: command: | sudo apt update -q sudo apt install -yq libusb-dev libusb-1.0.0-dev - /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" - run: name: Make distributables command: | make -f Makefile.release dist-linux - - run: - name: make tools and publish - command: | - make -f Makefile.tools github-release - make -f Makefile.release publish-github-linux - - persist_to_workspace: - root: . - paths: ['dist/*'] + ls -l dist + # - run: + # name: make tools and publish + # command: | + # export PATH=/home/linuxbrew/.linuxbrew/bin/:$PATH + # make -f Makefile.tools github-release + # make -f Makefile.release publish-github-linux + # - persist_to_workspace: + # root: . + # paths: ['dist/*'] # publish-packagecloud: # docker: @@ -97,18 +98,18 @@ jobs: # sudo gem install rake # sudo make -f Makefile.tools package_cloud # make -f Makefile.release publish-packagecloud - publish-github-linux: - docker: - - image: circleci/golang:1.17 - working_directory: /go/src/github.com/optimizely/aws-okta - steps: - - checkout - - attach_workspace: { at: . } - - run: - name: Install tools - command: | - # make -f Makefile.tools github-release - # make -f Makefile.release publish-github-linux + # publish-github-linux: + # docker: + # - image: circleci/golang:1.17 + # working_directory: /go/src/github.com/optimizely/aws-okta + # steps: + # - checkout + # - attach_workspace: { at: . } + # - run: + # name: Install tools + # command: | + # # make -f Makefile.tools github-release + # # make -f Makefile.release publish-github-linux # ishih-opti - my change, add job list: dist-darwin and publish-github-darwin dist-darwin: @@ -119,8 +120,6 @@ jobs: - run: name: install packages command: | - - # yes | ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install)" || true /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" brew install go@1.17 export PATH=/usr/local/opt/go@1.17/bin:/usr/local/opt/coreutils/libexec/gnubin:/usr/local/bin:$PATH @@ -138,31 +137,34 @@ jobs: command: | export PATH=/usr/local/opt/go@1.17/bin:/usr/local/opt/coreutils/libexec/gnubin:/usr/local/bin:$PATH make -f Makefile.release dist-darwin - - run: - name: make git release - command: | - echo "====== publish-github-darwin =====" - export PATH=/usr/local/opt/go@1.17/bin:/usr/local/opt/coreutils/libexec/gnubin:/usr/local/bin:$PATH - export GOPATH=/usr/local - export GIT_LOGIN=ishih-opti - make -f Makefile.tools github-release - make -f Makefile.release publish-github-darwin + ls -l dist + # - run: + # name: make git release + # command: | + # echo "====== publish-github-darwin =====" + # export PATH=/usr/local/opt/go@1.17/bin:/usr/local/opt/coreutils/libexec/gnubin:/usr/local/bin:$PATH + # export GOPATH=/usr/local + # export GIT_LOGIN=ishih-opti + # make -f Makefile.tools github-release + # make -f Makefile.release publish-github-darwin - persist_to_workspace: root: . paths: ['dist/*'] - publish-github-darwin: - macos: - xcode: 12.5.1 # indicate our selected version of Xcode + publish-github: + docker: + - image: circleci/golang:1.17 + working_directory: /go/src/github.com/optimizely/aws-okta steps: - checkout - attach_workspace: { at: . } - run: name: Install tools command: | - echo "====== the end =====" - # export PATH=/usr/local/opt/go@1.17/bin:/usr/local/opt/coreutils/libexec/gnubin:/usr/local/bin:$PATH - # make -f Makefile.tools github-release - # make -f Makefile.release publish-github-darwin + /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" + export PATH=/home/linuxbrew/.linuxbrew/bin:/usr/local/opt/go@1.17/bin:/usr/local/opt/coreutils/libexec/gnubin:/usr/local/bin:$PATH + make -f Makefile.tools github-release + make -f Makefile.release publish-github-linux + make -f Makefile.release publish-github-darwin workflows: version: 2 @@ -195,29 +197,37 @@ workflows: # # release only on tag push events like vX[.Y.Z...][-whatever] # tags: # only: /v[0-9]+(\.[0-9]+)*(-[a-zA-Z0-9-]+)?/ - - publish-github-linux: + - publish-github: context: github-optimizelycircle-oss-release requires: - dist-linux - filters: - # never publish from a branch event - branches: - ignore: /.*/ - # disabled (temporarily?) due to https://github.com/optimizely/aws-okta/issues/301 - # release only on tag push events like vX[.Y.Z...][-whatever] - # tags: - # only: /v[0-9]+(\.[0-9]+)*(-[a-zA-Z0-9-]+)?/ - ### ishih-opti - add for dawrin - - publish-github-darwin: - context: github-optimizelycircle-oss-release - requires: - dist-darwin filters: - # never publish from a branch event - branches: - ignore: /.*/ - # disabled (temporarily?) due to https://github.com/optimizely/aws-okta/issues/301 - # release only on tag push events like vX[.Y.Z...][-whatever] - # tags: - # only: /v[0-9]+(\.[0-9]+)*(-[a-zA-Z0-9-]+)?/ + tags: + only: /.*/ + # - publish-github-linux: + # context: github-optimizelycircle-oss-release + # requires: + # - dist-linux + # filters: + # # never publish from a branch event + # branches: + # ignore: /.*/ + # # disabled (temporarily?) due to https://github.com/optimizely/aws-okta/issues/301 + # # release only on tag push events like vX[.Y.Z...][-whatever] + # # tags: + # # only: /v[0-9]+(\.[0-9]+)*(-[a-zA-Z0-9-]+)?/ + # ### ishih-opti - add for dawrin + # - publish-github-darwin: + # context: github-optimizelycircle-oss-release + # requires: + # - dist-darwin + # filters: + # # never publish from a branch event + # branches: + # ignore: /.*/ + # # disabled (temporarily?) due to https://github.com/optimizely/aws-okta/issues/301 + # # release only on tag push events like vX[.Y.Z...][-whatever] + # # tags: + # # only: /v[0-9]+(\.[0-9]+)*(-[a-zA-Z0-9-]+)?/ diff --git a/Makefile.gh b/Makefile.gh deleted file mode 100644 index 39a0b182..00000000 --- a/Makefile.gh +++ /dev/null @@ -1,171 +0,0 @@ -# Goals: -# - Linux releases can be published to Github automatically by CircleCI -# -# This Makefile is meant for machines - -include Makefile - -# use bash so we can use set -o pipefail -SHELL := /bin/bash -# set --pre-release if not tagged or tree is dirty or there's a `-` in the tag -#ifneq (,$(findstring -,$(VERSION))) -# GITHUB_RELEASE_FLAGS := "--pre-release" -# PACKAGECLOUD_NAME_SUFFIX := "-prerelease" -#endif - -# TODO: use this consistently; 99% of the time, we don't want a v -VERSION_NO_V := $(patsubst v%,%,$(VERSION))-test - -PACKAGECLOUD_DEB_DISTROS := \ - debian/stretch \ - ubuntu/trusty \ - ubuntu/xenial \ - ubuntu/bionic \ - ubuntu/disco \ - ubuntu/eoan \ - ubuntu/focal - -PACKAGECLOUD_RPM_DISTROS := \ - fedora/27 \ - fedora/28 \ - fedora/29 \ - fedora/30 - -publish: publish-github publish-packagecloud - -# note: this doesn't include sha256sums -publish-linux: publish-github-linux publish-packagecloud - -publish-github: publish-github-darwin publish-github-linux publish-github-sha256sums - -publish-github-darwin: publish-github-darwin-bin publish-github-darwin-bin-arm6 - -publish-github-linux: publish-github-linux-bin publish-github-deb publish-github-rpm - -publish-packagecloud: publish-packagecloud-deb publish-packagecloud-rpm - -gh: - set -o pipefail; \ - gh auth login --with-token $$GITHUB_TOKEN ; \ - gh release create $(VERSION) \ - --repo optimizely/aws-okta \ - --generate-notes \ - - -publish-github-darwin-bin: dist/aws-okta-$(VERSION)-darwin-amd64 | gh - gh upload \ - --security-token $$GITHUB_TOKEN \ - --auth-user $$GIT_LOGIN \ - --user optimizely \ - --repo aws-okta \ - --tag $(VERSION) \ - --name aws-okta-$(VERSION)-darwin-amd64 \ - --replace \ - --file $< - -publish-github-darwin-bin-arm64: dist/aws-okta-$(VERSION)-darwin-arm64 | gh - gh upload \ - --security-token $$GITHUB_TOKEN \ - --user optimizely \ - --repo aws-okta \ - --tag $(VERSION) \ - --name aws-okta-$(VERSION)-darwin-arm64 \ - --replace \ - --file $< - -publish-github-linux-bin: dist/aws-okta-$(VERSION)-linux-amd64 | gh - gh upload \ - --security-token $$GITHUB_TOKEN \ - --user optimizely \ - --repo aws-okta \ - --tag $(VERSION) \ - --name aws-okta-$(VERSION)-linux-amd64 \ - --replace \ - --file $< - -publish-github-deb: dist/aws-okta_$(VERSION)_amd64.deb | gh - gh upload \ - --security-token $$GITHUB_TOKEN \ - --user optimizely \ - --repo aws-okta \ - --tag $(VERSION) \ - --name aws-okta_$(VERSION)_amd64.deb \ - --replace \ - --file $< - -publish-github-rpm: dist/aws-okta_$(VERSION)_amd64.rpm | gh - gh upload \ - --security-token $$GITHUB_TOKEN \ - --user optimizely \ - --repo aws-okta \ - --tag $(VERSION) \ - --name aws-okta_$(VERSION)_amd64.rpm \ - --replace \ - --file $< - -publish-github-sha256sums: dist/aws-okta-$(VERSION).sha256sums | gh - gh upload \ - --security-token $$GITHUB_TOKEN \ - --user optimizely \ - --repo aws-okta \ - --tag $(VERSION) \ - --name aws-okta-$(VERSION).sha256sums \ - --replace \ - --file dist/aws-okta-$(VERSION).sha256sums - -packagecloud.conf.json: - @echo "{\"url\":\"https://packagecloud.io\",\"token\":\"$${PACKAGECLOUD_TOKEN}\"}" > $@ - -# package_cloud prints the last 4 chars of our token :( -# so we attempt to filter that out - -publish-packagecloud-deb: dist/aws-okta_$(VERSION)_amd64.deb packagecloud.conf.json - @set -o pipefail; \ - for v in $(PACKAGECLOUD_DEB_DISTROS); do \ - (package_cloud yank --config packagecloud.conf.json optimizely/aws-okta$(PACKAGECLOUD_NAME_SUFFIX)/$$v aws-okta_$(VERSION_NO_V)_amd64.deb || true) | \ - grep -v 'with token:' || true ; \ - package_cloud push --config packagecloud.conf.json optimizely/aws-okta$(PACKAGECLOUD_NAME_SUFFIX)/$$v $< | \ - grep -v 'with token:' ; \ - done - -publish-packagecloud-rpm: dist/aws-okta_$(VERSION)_amd64.rpm packagecloud.conf.json - @set -o pipefail; \ - for v in $(PACKAGECLOUD_RPM_DISTROS); do \ - (package_cloud yank --config packagecloud.conf.json optimizely/aws-okta$(PACKAGECLOUD_NAME_SUFFIX)/$$v aws-okta-$(subst -,_,$(VERSION_NO_V))-1.x86_64.rpm || true) | \ - grep -v 'with token:' || true ; \ - package_cloud push --config packagecloud.conf.json optimizely/aws-okta$(PACKAGECLOUD_NAME_SUFFIX)/$$v $< | \ - grep -v 'with token:' ; \ - done - -dist: dist-darwin dist-linux dist/aws-okta-$(VERSION).sha256sums - -dist-darwin: dist/aws-okta-$(VERSION)-darwin-amd64 dist/aws-okta-$(VERSION)-darwin-arm64 - -dist-linux: dist/aws-okta-$(VERSION)-linux-amd64 dist/aws-okta_$(VERSION)_amd64.deb dist/aws-okta_$(VERSION)_amd64.rpm - -dist/aws-okta-$(VERSION).sha256sums: dist/aws-okta-$(VERSION)-darwin-amd64 dist/aws-okta-$(VERSION)-linux-amd64 dist/aws-okta_$(VERSION)_amd64.deb dist/aws-okta_$(VERSION)_amd64.rpm - sha256sum $^ | sed 's|dist/||g' > $@ - -dist/nfpm-$(VERSION).yaml: | dist/ - sed -e "s/\$${VERSION}/$(VERSION)/g" -e "s|\$${DIST_BIN}|dist/aws-okta-$(VERSION)-linux-amd64|g" < nfpm.yaml.tmpl > $@ - -dist/aws-okta_$(VERSION)_amd64.deb: dist/nfpm-$(VERSION).yaml dist/aws-okta-$(VERSION)-linux-amd64 - nfpm -f $< pkg --target $@ - -dist/aws-okta_$(VERSION)_amd64.rpm: dist/nfpm-$(VERSION).yaml dist/aws-okta-$(VERSION)-linux-amd64 - nfpm -f $< pkg --target $@ - -.PHONY: \ - dist \ - dist-darwin \ - dist-linux \ - publish \ - publish-github \ - publish-github-linux \ - publish-github-linux-bin \ - publish-github-rpm \ - publish-github-deb \ - publish-github-darwin \ - publish-github-darwin-bin \ - publish-github-darwin-bin-arm64 \ - gh diff --git a/Makefile.tools b/Makefile.tools index 90e2f14c..7e9b5124 100644 --- a/Makefile.tools +++ b/Makefile.tools @@ -5,7 +5,7 @@ NFPM_VERSION := 1.2.0 #from https://github.com/goreleaser/nfpm/releases/download/v0.9.3/nfpm_1.2.0_checksums.txt NFPM_SHA256 := 4659e714cc3d1fc1fa3ba75bb531901b0d2a89e5f59171145fb89bf1d392cb29 - +OS = $(shell uname -s) nfpm-debian: cd /tmp && \ curl -Ls https://github.com/goreleaser/nfpm/releases/download/v${NFPM_VERSION}/nfpm_${NFPM_VERSION}_Linux_x86_64.tar.gz > nfpm.tar.gz && \ From e53c2a60697827ca487874b108ec7a89f5821281 Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Thu, 22 Sep 2022 17:29:10 -0700 Subject: [PATCH 114/138] adding timing for github-release --- .circleci/config.yml | 1 - Makefile.release | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3794d4b9..89648b8d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -69,7 +69,6 @@ jobs: name: Make distributables command: | make -f Makefile.release dist-linux - ls -l dist # - run: # name: make tools and publish # command: | diff --git a/Makefile.release b/Makefile.release index 8501d303..3f9a9e87 100644 --- a/Makefile.release +++ b/Makefile.release @@ -57,7 +57,7 @@ github-release: --tag $(VERSION) \ --description - \ --name $(VERSION) \ - --pre-release + --pre-release; sleep 20 publish-github-darwin-bin: dist/aws-okta-$(VERSION)-darwin-amd64 | github-release github-release upload \ From 3129f0acdea27833d8d08710f19b780339bce31e Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Thu, 22 Sep 2022 17:43:00 -0700 Subject: [PATCH 115/138] remove bad line for github-release --- Makefile.release | 1 - 1 file changed, 1 deletion(-) diff --git a/Makefile.release b/Makefile.release index 3f9a9e87..28f7fb4f 100644 --- a/Makefile.release +++ b/Makefile.release @@ -61,7 +61,6 @@ github-release: publish-github-darwin-bin: dist/aws-okta-$(VERSION)-darwin-amd64 | github-release github-release upload \ - --auth-user $$GIT_LOGIN \ --user optimizely \ --repo aws-okta \ --tag $(VERSION) \ From 42a4fb11813c7e7a6fa66e63803036b6b2c816e1 Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Fri, 23 Sep 2022 09:40:34 -0700 Subject: [PATCH 116/138] remove all commented out codes not in use --- .circleci/config.yml | 93 ++------------------------------------------ Makefile.release | 4 +- Makefile.tools | 2 - 3 files changed, 5 insertions(+), 94 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 89648b8d..8f355e7a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -69,48 +69,8 @@ jobs: name: Make distributables command: | make -f Makefile.release dist-linux - # - run: - # name: make tools and publish - # command: | - # export PATH=/home/linuxbrew/.linuxbrew/bin/:$PATH - # make -f Makefile.tools github-release - # make -f Makefile.release publish-github-linux - # - persist_to_workspace: - # root: . - # paths: ['dist/*'] - # publish-packagecloud: - # docker: - # - image: circleci/golang:1.13 - # working_directory: /go/src/github.com/optimizely/aws-okta - # steps: - # - checkout - # - attach_workspace: { at: . } - # - run: - # name: Install tools - # command: | - # make -f Makefile.tools github-release - # # this is all for package_cloud :/ - # sudo apt update -q - # sudo apt install -yq ruby ruby-dev build-essential - # # fixes https://askubuntu.com/questions/872399/error-failed-to-build-gem-native-extension-when-trying-to-download-rubocop - # sudo gem install rake - # sudo make -f Makefile.tools package_cloud - # make -f Makefile.release publish-packagecloud - # publish-github-linux: - # docker: - # - image: circleci/golang:1.17 - # working_directory: /go/src/github.com/optimizely/aws-okta - # steps: - # - checkout - # - attach_workspace: { at: . } - # - run: - # name: Install tools - # command: | - # # make -f Makefile.tools github-release - # # make -f Makefile.release publish-github-linux - - # ishih-opti - my change, add job list: dist-darwin and publish-github-darwin + # ishih-opti - my changes, add job list: dist-darwin and publish-github dist-darwin: macos: xcode: 12.5.1 # indicate our selected version of Xcode @@ -136,16 +96,6 @@ jobs: command: | export PATH=/usr/local/opt/go@1.17/bin:/usr/local/opt/coreutils/libexec/gnubin:/usr/local/bin:$PATH make -f Makefile.release dist-darwin - ls -l dist - # - run: - # name: make git release - # command: | - # echo "====== publish-github-darwin =====" - # export PATH=/usr/local/opt/go@1.17/bin:/usr/local/opt/coreutils/libexec/gnubin:/usr/local/bin:$PATH - # export GOPATH=/usr/local - # export GIT_LOGIN=ishih-opti - # make -f Makefile.tools github-release - # make -f Makefile.release publish-github-darwin - persist_to_workspace: root: . paths: ['dist/*'] @@ -157,7 +107,7 @@ jobs: - checkout - attach_workspace: { at: . } - run: - name: Install tools + name: Install tool and publish release command: | /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" export PATH=/home/linuxbrew/.linuxbrew/bin:/usr/local/opt/go@1.17/bin:/usr/local/opt/coreutils/libexec/gnubin:/usr/local/bin:$PATH @@ -184,18 +134,7 @@ workflows: filters: tags: only: /.*/ - # - publish-packagecloud: - # context: packagecloud - # requires: - # - dist-linux - # - dist-darwin - # filters: - # # never publish from a branch event - # branches: - # ignore: /.*/ - # # release only on tag push events like vX[.Y.Z...][-whatever] - # tags: - # only: /v[0-9]+(\.[0-9]+)*(-[a-zA-Z0-9-]+)?/ + ### ishih-opti - add for releasing it on github - publish-github: context: github-optimizelycircle-oss-release requires: @@ -204,29 +143,5 @@ workflows: filters: tags: only: /.*/ - # - publish-github-linux: - # context: github-optimizelycircle-oss-release - # requires: - # - dist-linux - # filters: - # # never publish from a branch event - # branches: - # ignore: /.*/ - # # disabled (temporarily?) due to https://github.com/optimizely/aws-okta/issues/301 - # # release only on tag push events like vX[.Y.Z...][-whatever] - # # tags: - # # only: /v[0-9]+(\.[0-9]+)*(-[a-zA-Z0-9-]+)?/ - # ### ishih-opti - add for dawrin - # - publish-github-darwin: - # context: github-optimizelycircle-oss-release - # requires: - # - dist-darwin - # filters: - # # never publish from a branch event - # branches: - # ignore: /.*/ - # # disabled (temporarily?) due to https://github.com/optimizely/aws-okta/issues/301 - # # release only on tag push events like vX[.Y.Z...][-whatever] - # # tags: - # # only: /v[0-9]+(\.[0-9]+)*(-[a-zA-Z0-9-]+)?/ + diff --git a/Makefile.release b/Makefile.release index 28f7fb4f..58d65554 100644 --- a/Makefile.release +++ b/Makefile.release @@ -46,12 +46,10 @@ publish-packagecloud: publish-packagecloud-deb publish-packagecloud-rpm # $(GITHUB_RELEASE_FLAGS) \ -# scripts/changelog | github-release release \ - github-release: set -o pipefail; \ - echo -n | github-release release \ + scripts/changelog| github-release release \ --user optimizely \ --repo aws-okta \ --tag $(VERSION) \ diff --git a/Makefile.tools b/Makefile.tools index 7e9b5124..c036e368 100644 --- a/Makefile.tools +++ b/Makefile.tools @@ -22,10 +22,8 @@ rpmbuild-darwin: sha256sum-darwin: brew install coreutils - # && ln -s $$(which gsha256sum) /usr/local/bin/sha256sum github-release: - #GO111MODULE=off go install github.com/aktau/github-release@latest brew install github-release package_cloud: From 87238d373aa448ce803eaa92d21b8ed1ef29dad5 Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Fri, 23 Sep 2022 09:41:41 -0700 Subject: [PATCH 117/138] remove all related to packagecloud not in use --- Makefile | 1 - Makefile.release | 53 ++---------------------------------------------- 2 files changed, 2 insertions(+), 52 deletions(-) diff --git a/Makefile b/Makefile index 9551cf5e..e936f4f1 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,6 @@ # # This makefile is meant for humans -# VERSION := $(shell git describe --tags --always --dirty="-dev") VERSION := $(shell git describe --tags --always --dirty="-dev"|cut -d"-" -f 1 )-test LDFLAGS := -ldflags='-X "main.Version=$(VERSION)"' diff --git a/Makefile.release b/Makefile.release index 58d65554..71841973 100644 --- a/Makefile.release +++ b/Makefile.release @@ -7,34 +7,14 @@ include Makefile # use bash so we can use set -o pipefail SHELL := /bin/bash -# set --pre-release if not tagged or tree is dirty or there's a `-` in the tag -#ifneq (,$(findstring -,$(VERSION))) -# GITHUB_RELEASE_FLAGS := "--pre-release" -# PACKAGECLOUD_NAME_SUFFIX := "-prerelease" -#endif # TODO: use this consistently; 99% of the time, we don't want a v VERSION_NO_V := $(patsubst v%,%,$(VERSION))-test -PACKAGECLOUD_DEB_DISTROS := \ - debian/stretch \ - ubuntu/trusty \ - ubuntu/xenial \ - ubuntu/bionic \ - ubuntu/disco \ - ubuntu/eoan \ - ubuntu/focal - -PACKAGECLOUD_RPM_DISTROS := \ - fedora/27 \ - fedora/28 \ - fedora/29 \ - fedora/30 - -publish: publish-github publish-packagecloud +publish: publish-github # note: this doesn't include sha256sums -publish-linux: publish-github-linux publish-packagecloud +publish-linux: publish-github-linux publish-github: publish-github-darwin publish-github-linux publish-github-sha256sums @@ -42,11 +22,6 @@ publish-github-darwin: publish-github-darwin-bin publish-github-darwin-bin-arm64 publish-github-linux: publish-github-linux-bin publish-github-deb publish-github-rpm -publish-packagecloud: publish-packagecloud-deb publish-packagecloud-rpm - -# $(GITHUB_RELEASE_FLAGS) \ - - github-release: set -o pipefail; \ scripts/changelog| github-release release \ @@ -111,30 +86,6 @@ publish-github-sha256sums: dist/aws-okta-$(VERSION).sha256sums | github-release --replace \ --file dist/aws-okta-$(VERSION).sha256sums -packagecloud.conf.json: - @echo "{\"url\":\"https://packagecloud.io\",\"token\":\"$${PACKAGECLOUD_TOKEN}\"}" > $@ - -# package_cloud prints the last 4 chars of our token :( -# so we attempt to filter that out - -publish-packagecloud-deb: dist/aws-okta_$(VERSION)_amd64.deb packagecloud.conf.json - @set -o pipefail; \ - for v in $(PACKAGECLOUD_DEB_DISTROS); do \ - (package_cloud yank --config packagecloud.conf.json optimizely/aws-okta$(PACKAGECLOUD_NAME_SUFFIX)/$$v aws-okta_$(VERSION_NO_V)_amd64.deb || true) | \ - grep -v 'with token:' || true ; \ - package_cloud push --config packagecloud.conf.json optimizely/aws-okta$(PACKAGECLOUD_NAME_SUFFIX)/$$v $< | \ - grep -v 'with token:' ; \ - done - -publish-packagecloud-rpm: dist/aws-okta_$(VERSION)_amd64.rpm packagecloud.conf.json - @set -o pipefail; \ - for v in $(PACKAGECLOUD_RPM_DISTROS); do \ - (package_cloud yank --config packagecloud.conf.json optimizely/aws-okta$(PACKAGECLOUD_NAME_SUFFIX)/$$v aws-okta-$(subst -,_,$(VERSION_NO_V))-1.x86_64.rpm || true) | \ - grep -v 'with token:' || true ; \ - package_cloud push --config packagecloud.conf.json optimizely/aws-okta$(PACKAGECLOUD_NAME_SUFFIX)/$$v $< | \ - grep -v 'with token:' ; \ - done - dist: dist-darwin dist-linux dist/aws-okta-$(VERSION).sha256sums dist-darwin: dist/aws-okta-$(VERSION)-darwin-amd64 dist/aws-okta-$(VERSION)-darwin-arm64 From e768a85207d2c5f8172228683f4bf5a015dac5cc Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Fri, 23 Sep 2022 11:06:43 -0700 Subject: [PATCH 118/138] more clean up for unused code --- Makefile | 2 +- Makefile.release | 2 +- Makefile.tools | 6 +----- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index e936f4f1..c92827c0 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ # # This makefile is meant for humans -VERSION := $(shell git describe --tags --always --dirty="-dev"|cut -d"-" -f 1 )-test +VERSION := $(shell git describe --tags --always --dirty="-dev"|cut -d"-" -f 1) LDFLAGS := -ldflags='-X "main.Version=$(VERSION)"' test: diff --git a/Makefile.release b/Makefile.release index 71841973..4bd6767d 100644 --- a/Makefile.release +++ b/Makefile.release @@ -9,7 +9,7 @@ include Makefile SHELL := /bin/bash # TODO: use this consistently; 99% of the time, we don't want a v -VERSION_NO_V := $(patsubst v%,%,$(VERSION))-test +VERSION_NO_V := $(patsubst v%,%,$(VERSION)) publish: publish-github diff --git a/Makefile.tools b/Makefile.tools index c036e368..f0a359e3 100644 --- a/Makefile.tools +++ b/Makefile.tools @@ -26,12 +26,8 @@ sha256sum-darwin: github-release: brew install github-release -package_cloud: - gem install package_cloud - .PHONY: nfpm-debian \ rpmbuild-debian \ rpmbuild-darwin \ sha256sum-darwin \ - github-release \ - package_cloud + github-release From 2e8cae14993ff1384947729c37766628482a9f05 Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Fri, 23 Sep 2022 11:16:40 -0700 Subject: [PATCH 119/138] more clean up for unused code --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8f355e7a..c1ec9493 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -61,7 +61,7 @@ jobs: command: | sudo make -f Makefile.tools nfpm-debian rpmbuild-debian - run: - name: Install libusb, brew + name: Install libusb command: | sudo apt update -q sudo apt install -yq libusb-dev libusb-1.0.0-dev From 547b1a5df28a9808245e0aa68621b8be306361de Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Fri, 23 Sep 2022 11:20:37 -0700 Subject: [PATCH 120/138] more cleanup --- Makefile | 5 +++++ Makefile.release | 53 ++++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 56 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index c92827c0..cb21effd 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,12 @@ # # This makefile is meant for humans +<<<<<<< HEAD VERSION := $(shell git describe --tags --always --dirty="-dev"|cut -d"-" -f 1) +======= +# VERSION := $(shell git describe --tags --always --dirty="-dev") +VERSION := $(shell git describe --tags --always --dirty="-dev"|cut -d"-" -f 1 )-test +>>>>>>> parent of 87238d3 (remove all related to packagecloud not in use) LDFLAGS := -ldflags='-X "main.Version=$(VERSION)"' test: diff --git a/Makefile.release b/Makefile.release index 4bd6767d..5012c56a 100644 --- a/Makefile.release +++ b/Makefile.release @@ -7,14 +7,34 @@ include Makefile # use bash so we can use set -o pipefail SHELL := /bin/bash +# set --pre-release if not tagged or tree is dirty or there's a `-` in the tag +#ifneq (,$(findstring -,$(VERSION))) +# GITHUB_RELEASE_FLAGS := "--pre-release" +# PACKAGECLOUD_NAME_SUFFIX := "-prerelease" +#endif # TODO: use this consistently; 99% of the time, we don't want a v VERSION_NO_V := $(patsubst v%,%,$(VERSION)) -publish: publish-github +PACKAGECLOUD_DEB_DISTROS := \ + debian/stretch \ + ubuntu/trusty \ + ubuntu/xenial \ + ubuntu/bionic \ + ubuntu/disco \ + ubuntu/eoan \ + ubuntu/focal + +PACKAGECLOUD_RPM_DISTROS := \ + fedora/27 \ + fedora/28 \ + fedora/29 \ + fedora/30 + +publish: publish-github publish-packagecloud # note: this doesn't include sha256sums -publish-linux: publish-github-linux +publish-linux: publish-github-linux publish-packagecloud publish-github: publish-github-darwin publish-github-linux publish-github-sha256sums @@ -22,6 +42,11 @@ publish-github-darwin: publish-github-darwin-bin publish-github-darwin-bin-arm64 publish-github-linux: publish-github-linux-bin publish-github-deb publish-github-rpm +publish-packagecloud: publish-packagecloud-deb publish-packagecloud-rpm + +# $(GITHUB_RELEASE_FLAGS) \ + + github-release: set -o pipefail; \ scripts/changelog| github-release release \ @@ -86,6 +111,30 @@ publish-github-sha256sums: dist/aws-okta-$(VERSION).sha256sums | github-release --replace \ --file dist/aws-okta-$(VERSION).sha256sums +packagecloud.conf.json: + @echo "{\"url\":\"https://packagecloud.io\",\"token\":\"$${PACKAGECLOUD_TOKEN}\"}" > $@ + +# package_cloud prints the last 4 chars of our token :( +# so we attempt to filter that out + +publish-packagecloud-deb: dist/aws-okta_$(VERSION)_amd64.deb packagecloud.conf.json + @set -o pipefail; \ + for v in $(PACKAGECLOUD_DEB_DISTROS); do \ + (package_cloud yank --config packagecloud.conf.json optimizely/aws-okta$(PACKAGECLOUD_NAME_SUFFIX)/$$v aws-okta_$(VERSION_NO_V)_amd64.deb || true) | \ + grep -v 'with token:' || true ; \ + package_cloud push --config packagecloud.conf.json optimizely/aws-okta$(PACKAGECLOUD_NAME_SUFFIX)/$$v $< | \ + grep -v 'with token:' ; \ + done + +publish-packagecloud-rpm: dist/aws-okta_$(VERSION)_amd64.rpm packagecloud.conf.json + @set -o pipefail; \ + for v in $(PACKAGECLOUD_RPM_DISTROS); do \ + (package_cloud yank --config packagecloud.conf.json optimizely/aws-okta$(PACKAGECLOUD_NAME_SUFFIX)/$$v aws-okta-$(subst -,_,$(VERSION_NO_V))-1.x86_64.rpm || true) | \ + grep -v 'with token:' || true ; \ + package_cloud push --config packagecloud.conf.json optimizely/aws-okta$(PACKAGECLOUD_NAME_SUFFIX)/$$v $< | \ + grep -v 'with token:' ; \ + done + dist: dist-darwin dist-linux dist/aws-okta-$(VERSION).sha256sums dist-darwin: dist/aws-okta-$(VERSION)-darwin-amd64 dist/aws-okta-$(VERSION)-darwin-arm64 From 0d2cba1085d222f1cdabf21f8dcabcb8dec2958b Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Fri, 23 Sep 2022 11:23:48 -0700 Subject: [PATCH 121/138] Revert "remove all related to packagecloud not in use" This reverts commit 87238d373aa448ce803eaa92d21b8ed1ef29dad5. --- Makefile | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Makefile b/Makefile index cb21effd..c92827c0 100644 --- a/Makefile +++ b/Makefile @@ -4,12 +4,7 @@ # # This makefile is meant for humans -<<<<<<< HEAD VERSION := $(shell git describe --tags --always --dirty="-dev"|cut -d"-" -f 1) -======= -# VERSION := $(shell git describe --tags --always --dirty="-dev") -VERSION := $(shell git describe --tags --always --dirty="-dev"|cut -d"-" -f 1 )-test ->>>>>>> parent of 87238d3 (remove all related to packagecloud not in use) LDFLAGS := -ldflags='-X "main.Version=$(VERSION)"' test: From b11d52b691fcd6327073f392f3cbbd8343f2028b Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Fri, 23 Sep 2022 11:45:52 -0700 Subject: [PATCH 122/138] Makefile.tool changes to restore pkgcloud and linking for binary --- .circleci/config.yml | 2 +- Makefile.tools | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c1ec9493..24bbc84f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -120,7 +120,7 @@ workflows: # currently we only build/publish for linux: macOS builds require non-FOSS # Keychain libs that require a macOS host to build on # https://github.com/optimizely/aws-okta/issues/81 - test-dist-publish: + dist-publish: jobs: # - test # - test-build-golang-prev diff --git a/Makefile.tools b/Makefile.tools index f0a359e3..82343035 100644 --- a/Makefile.tools +++ b/Makefile.tools @@ -5,7 +5,7 @@ NFPM_VERSION := 1.2.0 #from https://github.com/goreleaser/nfpm/releases/download/v0.9.3/nfpm_1.2.0_checksums.txt NFPM_SHA256 := 4659e714cc3d1fc1fa3ba75bb531901b0d2a89e5f59171145fb89bf1d392cb29 -OS = $(shell uname -s) + nfpm-debian: cd /tmp && \ curl -Ls https://github.com/goreleaser/nfpm/releases/download/v${NFPM_VERSION}/nfpm_${NFPM_VERSION}_Linux_x86_64.tar.gz > nfpm.tar.gz && \ @@ -21,13 +21,19 @@ rpmbuild-darwin: brew install rpm sha256sum-darwin: - brew install coreutils + brew install coreutils && ln -s $$(which gsha256sum) /usr/local/bin/sha256sum github-release: brew install github-release + +package_cloud: + gem install package_cloud + + brew install github-release .PHONY: nfpm-debian \ rpmbuild-debian \ rpmbuild-darwin \ sha256sum-darwin \ - github-release + github-release \ + package_cloud \ No newline at end of file From 48edcb50986130c67e3cc9a02bc34a44ab6b43c0 Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Fri, 23 Sep 2022 11:48:31 -0700 Subject: [PATCH 123/138] Makefile.tool changes to add nl in the end and remove extra lines --- Makefile.tools | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile.tools b/Makefile.tools index 82343035..1db9277d 100644 --- a/Makefile.tools +++ b/Makefile.tools @@ -28,7 +28,6 @@ github-release: package_cloud: gem install package_cloud - brew install github-release .PHONY: nfpm-debian \ @@ -36,4 +35,5 @@ package_cloud: rpmbuild-darwin \ sha256sum-darwin \ github-release \ - package_cloud \ No newline at end of file + package_cloud + \ No newline at end of file From e863cf988b3e36ceb90c19636582d0a641f8c067 Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Fri, 23 Sep 2022 11:52:35 -0700 Subject: [PATCH 124/138] adding back pkgcloud flag n github-release flag --- Makefile.release | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/Makefile.release b/Makefile.release index 5012c56a..c6130cb1 100644 --- a/Makefile.release +++ b/Makefile.release @@ -8,10 +8,10 @@ include Makefile # use bash so we can use set -o pipefail SHELL := /bin/bash # set --pre-release if not tagged or tree is dirty or there's a `-` in the tag -#ifneq (,$(findstring -,$(VERSION))) -# GITHUB_RELEASE_FLAGS := "--pre-release" -# PACKAGECLOUD_NAME_SUFFIX := "-prerelease" -#endif +ifneq (,$(findstring -,$(VERSION))) + GITHUB_RELEASE_FLAGS := "--pre-release" + PACKAGECLOUD_NAME_SUFFIX := "-prerelease" +endif # TODO: use this consistently; 99% of the time, we don't want a v VERSION_NO_V := $(patsubst v%,%,$(VERSION)) @@ -44,18 +44,16 @@ publish-github-linux: publish-github-linux-bin publish-github-deb publish-github publish-packagecloud: publish-packagecloud-deb publish-packagecloud-rpm -# $(GITHUB_RELEASE_FLAGS) \ - - github-release: set -o pipefail; \ scripts/changelog| github-release release \ --user optimizely \ --repo aws-okta \ + $(GITHUB_RELEASE_FLAGS) \ --tag $(VERSION) \ --description - \ --name $(VERSION) \ - --pre-release; sleep 20 + ; sleep 20 publish-github-darwin-bin: dist/aws-okta-$(VERSION)-darwin-amd64 | github-release github-release upload \ From 189a18a70103b88fe81f66bff02c4ea577849a4a Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Fri, 23 Sep 2022 11:58:50 -0700 Subject: [PATCH 125/138] adding another command back in github-release and add timing --- Makefile.release | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Makefile.release b/Makefile.release index c6130cb1..2e57e1fc 100644 --- a/Makefile.release +++ b/Makefile.release @@ -53,6 +53,12 @@ github-release: --tag $(VERSION) \ --description - \ --name $(VERSION) \ + ; sleep 20 || \ + github-release info \ + --user optimizely \ + --repo aws-okta \ + --tag $(VERSION) \ + --name $(VERSION) \ ; sleep 20 publish-github-darwin-bin: dist/aws-okta-$(VERSION)-darwin-amd64 | github-release From fb04feeba124653348d7e9cb7af3bc45cc56e060 Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Fri, 23 Sep 2022 11:59:56 -0700 Subject: [PATCH 126/138] removing timing for second one since it's not needed --- Makefile.release | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Makefile.release b/Makefile.release index 2e57e1fc..ab547a29 100644 --- a/Makefile.release +++ b/Makefile.release @@ -58,8 +58,7 @@ github-release: --user optimizely \ --repo aws-okta \ --tag $(VERSION) \ - --name $(VERSION) \ - ; sleep 20 + --name $(VERSION) publish-github-darwin-bin: dist/aws-okta-$(VERSION)-darwin-amd64 | github-release github-release upload \ From f3b69e3f754ae05bbcb8daa7fbc5325d700c22f3 Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Fri, 23 Sep 2022 14:19:09 -0700 Subject: [PATCH 127/138] change image build consistency to be the same --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 24bbc84f..bb742cdf 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -101,7 +101,7 @@ jobs: paths: ['dist/*'] publish-github: docker: - - image: circleci/golang:1.17 + - image: circleci/golang:1.13 working_directory: /go/src/github.com/optimizely/aws-okta steps: - checkout From 74c9b52fe07d88db5e713691c0a9e558a7669784 Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Fri, 23 Sep 2022 14:22:05 -0700 Subject: [PATCH 128/138] restore go.* files from master --- go.mod | 6 ------ go.sum | 12 ------------ 2 files changed, 18 deletions(-) diff --git a/go.mod b/go.mod index a3b1cb4b..b563f361 100644 --- a/go.mod +++ b/go.mod @@ -2,15 +2,11 @@ module github.com/segmentio/aws-okta require ( github.com/99designs/keyring v1.1.6 - github.com/aktau/github-release v0.10.0 // indirect github.com/alessio/shellescape v0.0.0-20190409004728-b115ca0f9053 github.com/aws/aws-sdk-go v1.25.35 github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 // indirect - github.com/dustin/go-humanize v1.0.0 // indirect - github.com/github-release/github-release v0.10.0 // indirect github.com/inconshreveable/mousetrap v1.0.0 // indirect github.com/karalabe/hid v1.0.0 // indirect - github.com/kevinburke/rest v0.0.0-20210506044642-5611499aa33c // indirect github.com/konsorten/go-windows-terminal-sequences v1.0.2 // indirect github.com/marshallbrekka/go-u2fhost v0.0.0-20200114212649-cc764c209ee9 github.com/mitchellh/go-homedir v1.1.0 @@ -22,9 +18,7 @@ require ( github.com/spf13/cobra v0.0.0-20170621173259-31694f19adee github.com/spf13/pflag v1.0.0 // indirect github.com/stretchr/testify v1.3.0 - github.com/tomnomnom/linkheader v0.0.0-20180905144013-02ca5825eb80 // indirect github.com/vaughan0/go-ini v0.0.0-20130923145212-a98ad7ee00ec - github.com/voxelbrain/goptions v0.0.0-20180630082107-58cddc247ea2 // indirect github.com/xtgo/uuid v0.0.0-20140804021211-a0b114877d4c // indirect golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4 golang.org/x/net v0.0.0-20190628185345-da137c7871d7 diff --git a/go.sum b/go.sum index f4484bab..28b4f38d 100644 --- a/go.sum +++ b/go.sum @@ -1,7 +1,5 @@ github.com/99designs/keyring v1.1.6 h1:kVDC2uCgVwecxCk+9zoCt2uEL6dt+dfVzMvGgnVcIuM= github.com/99designs/keyring v1.1.6/go.mod h1:16e0ds7LGQQcT59QqkTg72Hh5ShM51Byv5PEmW6uoRU= -github.com/aktau/github-release v0.10.0 h1:4U+9iRM7n094ZCROdnoah084FDmdQ01hwQsz0f0hwIw= -github.com/aktau/github-release v0.10.0/go.mod h1:cPkP83iRnV8pAJyQlQ4vjLJoC+JE+aT5sOrYz3sTsX0= github.com/alessio/shellescape v0.0.0-20190409004728-b115ca0f9053 h1:H/GMMKYPkEIC3DF/JWQz8Pdd+Feifov2EIgGfNpeogI= github.com/alessio/shellescape v0.0.0-20190409004728-b115ca0f9053/go.mod h1:xW8sBma2LE3QxFSzCnH9qe6gAE2yO9GvQaWwX89HxbE= github.com/aws/aws-sdk-go v1.25.35 h1:fe2tJnqty/v/50pyngKdNk/NP8PFphYDA1Z7N3EiiiE= @@ -13,12 +11,8 @@ github.com/danieljoos/wincred v1.0.2/go.mod h1:SnuYRW9lp1oJrZX/dXJqr0cPK5gYXqx3E github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo= -github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dvsekhvalnov/jose2go v0.0.0-20200901110807-248326c1351b h1:HBah4D48ypg3J7Np4N+HY/ZR76fx3HEUGxDU6Uk39oQ= github.com/dvsekhvalnov/jose2go v0.0.0-20200901110807-248326c1351b/go.mod h1:7BvyPhdbLxMXIYTFPLsyJRFMsKmOZnQmzh6Gb+uquuM= -github.com/github-release/github-release v0.10.0 h1:nJ3oEV2JrC0brYi6B8CsXumn/ORFeiAEOB2fwN9epOw= -github.com/github-release/github-release v0.10.0/go.mod h1:CcaWgA5VoBGz94mOHYIXavqUA8kADNZxU+5/oDQxF6o= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 h1:ZpnhV/YsD2/4cESfV5+Hoeu/iUR3ruzNvZ+yQfO03a0= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= @@ -33,8 +27,6 @@ github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7 github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/karalabe/hid v1.0.0 h1:+/CIMNXhSU/zIJgnIvBD2nKHxS/bnRHhhs9xBryLpPo= github.com/karalabe/hid v1.0.0/go.mod h1:Vr51f8rUOLYrfrWDFlV12GGQgM5AT8sVh+2fY4MPeu8= -github.com/kevinburke/rest v0.0.0-20210506044642-5611499aa33c h1:hnbwWED5rIu+UaMkLR3JtnscMVGqp35lfzQwLuZAAUY= -github.com/kevinburke/rest v0.0.0-20210506044642-5611499aa33c/go.mod h1:pD+iEcdAGVXld5foVN4e24zb/6fnb60tgZPZ3P/3T/I= github.com/keybase/go-keychain v0.0.0-20190712205309-48d3d31d256d h1:Z+RDyXzjKE0i2sTjZ/b1uxiGtPhFy34Ou/Tk0qwN0kM= github.com/keybase/go-keychain v0.0.0-20190712205309-48d3d31d256d/go.mod h1:JJNrCn9otv/2QP4D7SMJBgaleKpOf66PnW6F5WGNRIc= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -76,12 +68,8 @@ github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoH github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/tomnomnom/linkheader v0.0.0-20180905144013-02ca5825eb80 h1:nrZ3ySNYwJbSpD6ce9duiP+QkD3JuLCcWkdaehUS/3Y= -github.com/tomnomnom/linkheader v0.0.0-20180905144013-02ca5825eb80/go.mod h1:iFyPdL66DjUD96XmzVL3ZntbzcflLnznH0fr99w5VqE= github.com/vaughan0/go-ini v0.0.0-20130923145212-a98ad7ee00ec h1:DGmKwyZwEB8dI7tbLt/I/gQuP559o/0FrAkHKlQM/Ks= github.com/vaughan0/go-ini v0.0.0-20130923145212-a98ad7ee00ec/go.mod h1:owBmyHYMLkxyrugmfwE/DLJyW8Ro9mkphwuVErQ0iUw= -github.com/voxelbrain/goptions v0.0.0-20180630082107-58cddc247ea2 h1:txplJASvd6b/hrE0s/Ixfpp2cuwH9IO9oZBAN9iYa4A= -github.com/voxelbrain/goptions v0.0.0-20180630082107-58cddc247ea2/go.mod h1:DGCIhurYgnLz8J9ga1fMV/fbLDyUvTyrWXVWUIyJon4= github.com/xtgo/uuid v0.0.0-20140804021211-a0b114877d4c h1:3lbZUMbMiGUW/LMkfsEABsc5zNT9+b1CvsJx47JzJ8g= github.com/xtgo/uuid v0.0.0-20140804021211-a0b114877d4c/go.mod h1:UrdRz5enIKZ63MEE3IF9l2/ebyx59GyGgPi+tICQdmM= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 h1:VklqNMn3ovrHsnt90PveolxSbWFaJdECFbxSq0Mqo2M= From 5fd979b98ea225d0cd62c20659639670a7f144d9 Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Fri, 23 Sep 2022 14:32:40 -0700 Subject: [PATCH 129/138] restoring back to original so it's easier to do code review --- .circleci/config.yml | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index bb742cdf..0247713a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -69,7 +69,36 @@ jobs: name: Make distributables command: | make -f Makefile.release dist-linux - + publish-packagecloud: + docker: + - image: circleci/golang:1.13 + working_directory: /go/src/github.com/segmentio/aws-okta + steps: + - checkout + - attach_workspace: { at: . } + - run: + name: Install tools + command: | + make -f Makefile.tools github-release + # this is all for package_cloud :/ + sudo apt update -q + sudo apt install -yq ruby ruby-dev build-essential + # fixes https://askubuntu.com/questions/872399/error-failed-to-build-gem-native-extension-when-trying-to-download-rubocop + sudo gem install rake + sudo make -f Makefile.tools package_cloud + make -f Makefile.release publish-packagecloud + publish-github-linux: + docker: + - image: circleci/golang:1.13 + working_directory: /go/src/github.com/segmentio/aws-okta + steps: + - checkout + - attach_workspace: { at: . } + - run: + name: Install tools + command: | + make -f Makefile.tools github-release + make -f Makefile.release publish-github-linux # ishih-opti - my changes, add job list: dist-darwin and publish-github dist-darwin: macos: From 60d30ae1c116b764be9d99d986fa0b6b06a214ff Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Fri, 23 Sep 2022 15:01:10 -0700 Subject: [PATCH 130/138] delete an accidental misplaced copy/paste line in Makefile.tool --- Makefile.tools | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Makefile.tools b/Makefile.tools index 1db9277d..16bc5d54 100644 --- a/Makefile.tools +++ b/Makefile.tools @@ -27,13 +27,11 @@ github-release: brew install github-release package_cloud: - gem install package_cloud - brew install github-release - + gem install package_cloud + .PHONY: nfpm-debian \ rpmbuild-debian \ rpmbuild-darwin \ sha256sum-darwin \ github-release \ package_cloud - \ No newline at end of file From cc0d2fdefe46686c324fdb5b94de95f5ceeddd70 Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Fri, 23 Sep 2022 15:05:22 -0700 Subject: [PATCH 131/138] delete an accidental misplaced copy/paste line in Makefile.tool --- Makefile.tools | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.tools b/Makefile.tools index 16bc5d54..68128d75 100644 --- a/Makefile.tools +++ b/Makefile.tools @@ -28,7 +28,7 @@ github-release: package_cloud: gem install package_cloud - + .PHONY: nfpm-debian \ rpmbuild-debian \ rpmbuild-darwin \ From 1e3a800adbd3e15c352ab89d9ad8998ec871f8d4 Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Thu, 6 Oct 2022 08:32:27 -0700 Subject: [PATCH 132/138] checking Makefiles.tools line 30 issue --- Makefile.tools | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.tools b/Makefile.tools index 68128d75..014a95fa 100644 --- a/Makefile.tools +++ b/Makefile.tools @@ -27,7 +27,7 @@ github-release: brew install github-release package_cloud: - gem install package_cloud + gem install package_cloud .PHONY: nfpm-debian \ rpmbuild-debian \ From c8c3326281d41b5abd3bfd273336212b83662ea5 Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Thu, 6 Oct 2022 08:35:50 -0700 Subject: [PATCH 133/138] checking Makefiles.tools line 30 issue --- .circleci/config.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 0247713a..ff57122a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -171,6 +171,4 @@ workflows: - dist-darwin filters: tags: - only: /.*/ - - + only: /.*/ \ No newline at end of file From 579fcaa3b2685560d59f145e8d35e5598eee0480 Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Thu, 6 Oct 2022 08:54:41 -0700 Subject: [PATCH 134/138] checking Makefiles.tools line 30 issue --- Makefile.tools | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile.tools b/Makefile.tools index 014a95fa..adba1a2d 100644 --- a/Makefile.tools +++ b/Makefile.tools @@ -21,7 +21,8 @@ rpmbuild-darwin: brew install rpm sha256sum-darwin: - brew install coreutils && ln -s $$(which gsha256sum) /usr/local/bin/sha256sum + brew install coreutils && export PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH + # && ln -s $$(which gsha256sum) /usr/local/bin/sha256sum github-release: brew install github-release From d348b4a3533a7e2ec7d2cf74fe679211af9d9212 Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Thu, 6 Oct 2022 09:01:05 -0700 Subject: [PATCH 135/138] checking Makefiles.tools line 30 issue --- Makefile.tools | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile.tools b/Makefile.tools index adba1a2d..3e9ec71a 100644 --- a/Makefile.tools +++ b/Makefile.tools @@ -21,7 +21,9 @@ rpmbuild-darwin: brew install rpm sha256sum-darwin: - brew install coreutils && export PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH + brew install coreutils + test ! -f /usr/local/bin/sha256sum && ln -s $$(which gsha256sum) /usr/local/bin/sha256sum + # && export PATH=/usr/local/opt/coreutils/libexec/gnubin:$PATH # && ln -s $$(which gsha256sum) /usr/local/bin/sha256sum github-release: From 14f49624cf2b5545a270c493edfafc01b83ee562 Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Thu, 6 Oct 2022 09:23:30 -0700 Subject: [PATCH 136/138] checking Makefiles.tools line 30 issue --- Makefile.tools | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile.tools b/Makefile.tools index 3e9ec71a..e0642b16 100644 --- a/Makefile.tools +++ b/Makefile.tools @@ -22,12 +22,12 @@ rpmbuild-darwin: sha256sum-darwin: brew install coreutils - test ! -f /usr/local/bin/sha256sum && ln -s $$(which gsha256sum) /usr/local/bin/sha256sum + test -f /usr/local/bin/sha256sum && ln -s $$(which gsha256sum) /usr/local/bin/sha256sum # && export PATH=/usr/local/opt/coreutils/libexec/gnubin:$PATH # && ln -s $$(which gsha256sum) /usr/local/bin/sha256sum github-release: - brew install github-release + test -f /usr/local/bin/github-release || brew install github-release package_cloud: gem install package_cloud From 091442e702cbdaa828490f3efe3af8762e766af3 Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Thu, 6 Oct 2022 09:28:27 -0700 Subject: [PATCH 137/138] checking Makefiles.tools line 30 issue --- Makefile.tools | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.tools b/Makefile.tools index e0642b16..d256c9b4 100644 --- a/Makefile.tools +++ b/Makefile.tools @@ -22,7 +22,7 @@ rpmbuild-darwin: sha256sum-darwin: brew install coreutils - test -f /usr/local/bin/sha256sum && ln -s $$(which gsha256sum) /usr/local/bin/sha256sum + test ! -f /usr/local/bin/sha256sum && ln -s $$(which gsha256sum) /usr/local/bin/sha256sum # && export PATH=/usr/local/opt/coreutils/libexec/gnubin:$PATH # && ln -s $$(which gsha256sum) /usr/local/bin/sha256sum From 77eefb752da3efd7f94267734fe301940d94aa20 Mon Sep 17 00:00:00 2001 From: Ivy Shih Date: Thu, 6 Oct 2022 09:33:48 -0700 Subject: [PATCH 138/138] checking Makefiles.tools line 30 issue --- Makefile.tools | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Makefile.tools b/Makefile.tools index d256c9b4..2db201ac 100644 --- a/Makefile.tools +++ b/Makefile.tools @@ -21,9 +21,7 @@ rpmbuild-darwin: brew install rpm sha256sum-darwin: - brew install coreutils - test ! -f /usr/local/bin/sha256sum && ln -s $$(which gsha256sum) /usr/local/bin/sha256sum - # && export PATH=/usr/local/opt/coreutils/libexec/gnubin:$PATH + brew install coreutils && export PATH=/usr/local/opt/coreutils/libexec/gnubin:$PATH # && ln -s $$(which gsha256sum) /usr/local/bin/sha256sum github-release: