From 8958da16df270dc88402f2b5a4b1817cd5655cab Mon Sep 17 00:00:00 2001 From: Charlie Moog Date: Sat, 26 Dec 2020 15:35:33 -0600 Subject: [PATCH 01/16] feat: add action workflow for bumping coder-cli --- .github/workflows/bump-coder-cli.yaml | 21 +++++++++++++++++ ci/scripts/bump-coder-cli.sh | 33 +++++++++++++++++++++++++++ ci/templates/coder-cli.rb | 21 +++++++++++++++++ 3 files changed, 75 insertions(+) create mode 100644 .github/workflows/bump-coder-cli.yaml create mode 100755 ci/scripts/bump-coder-cli.sh create mode 100644 ci/templates/coder-cli.rb diff --git a/.github/workflows/bump-coder-cli.yaml b/.github/workflows/bump-coder-cli.yaml new file mode 100644 index 0000000..f2a3b10 --- /dev/null +++ b/.github/workflows/bump-coder-cli.yaml @@ -0,0 +1,21 @@ +name: bump_version +on: + workflow_dispatch: + inputs: + version: + default: "" + required: true + description: "unprefixed version number (ex: '1.14.2')" +jobs: + bump: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - run: | + ./ci/scripts/bump-coder-cli.sh ${{ github.event.inputs.version }} + git diff + git checkout -b bump-coder-cli-${{ github.event.inputs.version }} + git add coder-cli.rb + git remote add origin "https://$GITHUB_ACTOR:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY.git" + git commit -m "feat: bump coder-cli version to v$version" + git push --set-upstream origin "$branch" diff --git a/ci/scripts/bump-coder-cli.sh b/ci/scripts/bump-coder-cli.sh new file mode 100755 index 0000000..ccfd4cd --- /dev/null +++ b/ci/scripts/bump-coder-cli.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +set -eu + +cd "$(dirname "$0")" +cd "$(git rev-parse --show-toplevel)" + +version="$1" + +sha() { + sha256sum | awk '{ print $1 }' +} + +linux_url="https://github.com/cdr/coder-cli/releases/download/v$version/coder-cli-linux-amd64.tar.gz" +macos_url="https://github.com/cdr/coder-cli/releases/download/v$version/coder-cli-darwin-amd64.zip" + +linux_sha="$(curl -sL "$linux_url" | sha)" +macos_sha="$(curl -sL "$macos_url" | sha)" + +echo $macos_sha +echo $linux_sha + +template=$(cat ./ci/templates/coder-cli.rb) + +template="${template//\{\{MACOS_SHA\}\}/$macos_sha}" +template="${template//\{\{LINUX_SHA\}\}/$linux_sha}" + +template="${template//\{\{MACOS_URL\}\}/$macos_url}" +template="${template//\{\{LINUX_URL\}\}/$linux_url}" + +template="${template//\{\{VERSION\}\}/$version}" + +echo "$template" > ./coder-cli.rb diff --git a/ci/templates/coder-cli.rb b/ci/templates/coder-cli.rb new file mode 100644 index 0000000..a384696 --- /dev/null +++ b/ci/templates/coder-cli.rb @@ -0,0 +1,21 @@ +class CoderCli < Formula + desc "Command-line tool for the Coder remote development platform" + homepage "https://github.com/cdr/coder-cli" + version "{{VERSION}}" + bottle :unneeded + + if OS.mac? + url "{{MACOS_URL}}" + sha256 "{{MACOS_SHA}}" + else + url "{{LINUX_URL}}" + sha256 "{{LINUX_SHA}}" + end + + def install + bin.install "coder" + end + test do + system "#{bin}/coder", "--version" + end +end From b3e9eac3309b2e980772d02381f35946d9e96091 Mon Sep 17 00:00:00 2001 From: Charlie Moog Date: Sat, 26 Dec 2020 15:37:41 -0600 Subject: [PATCH 02/16] fixup! feat: add action workflow for bumping coder-cli --- .github/workflows/bump-coder-cli.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/bump-coder-cli.yaml b/.github/workflows/bump-coder-cli.yaml index f2a3b10..407388e 100644 --- a/.github/workflows/bump-coder-cli.yaml +++ b/.github/workflows/bump-coder-cli.yaml @@ -18,4 +18,4 @@ jobs: git add coder-cli.rb git remote add origin "https://$GITHUB_ACTOR:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY.git" git commit -m "feat: bump coder-cli version to v$version" - git push --set-upstream origin "$branch" + git push --set-upstream origin bump-coder-cli-${{ github.event.inputs.version }} From 4ce7c14899fc62c9e1b2905f627462eb9e7dc0d4 Mon Sep 17 00:00:00 2001 From: Charlie Moog Date: Sat, 26 Dec 2020 15:41:07 -0600 Subject: [PATCH 03/16] fixup! feat: add action workflow for bumping coder-cli --- .github/workflows/bump-coder-cli.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/bump-coder-cli.yaml b/.github/workflows/bump-coder-cli.yaml index 407388e..795f7af 100644 --- a/.github/workflows/bump-coder-cli.yaml +++ b/.github/workflows/bump-coder-cli.yaml @@ -19,3 +19,4 @@ jobs: git remote add origin "https://$GITHUB_ACTOR:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY.git" git commit -m "feat: bump coder-cli version to v$version" git push --set-upstream origin bump-coder-cli-${{ github.event.inputs.version }} + gh pr create --fill --reviewer cmoog From 76782cf98f31e1f81988277efeb43196106ef4a5 Mon Sep 17 00:00:00 2001 From: Charlie Moog Date: Sat, 26 Dec 2020 15:55:49 -0600 Subject: [PATCH 04/16] fixup! feat: add action workflow for bumping coder-cli --- .github/workflows/bump-coder-cli.yaml | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/workflows/bump-coder-cli.yaml b/.github/workflows/bump-coder-cli.yaml index 795f7af..d4919e1 100644 --- a/.github/workflows/bump-coder-cli.yaml +++ b/.github/workflows/bump-coder-cli.yaml @@ -1,22 +1,23 @@ name: bump_version on: - workflow_dispatch: - inputs: - version: - default: "" - required: true - description: "unprefixed version number (ex: '1.14.2')" + push + # workflow_dispatch: + # inputs: + # version: + # default: "" + # required: true + # description: "unprefixed version number (ex: '1.14.2')" jobs: bump: runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 - run: | - ./ci/scripts/bump-coder-cli.sh ${{ github.event.inputs.version }} + ./ci/scripts/bump-coder-cli.sh 1.14.1 git diff - git checkout -b bump-coder-cli-${{ github.event.inputs.version }} + git checkout -b bump-coder-cli-1.14.1 git add coder-cli.rb git remote add origin "https://$GITHUB_ACTOR:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY.git" git commit -m "feat: bump coder-cli version to v$version" - git push --set-upstream origin bump-coder-cli-${{ github.event.inputs.version }} + git push --set-upstream origin bump-coder-cli-1.14.1 gh pr create --fill --reviewer cmoog From aea4ed921287f7b5e951e43dd985799ffbf2e8c6 Mon Sep 17 00:00:00 2001 From: Charlie Moog Date: Sat, 26 Dec 2020 15:58:11 -0600 Subject: [PATCH 05/16] fixup! feat: add action workflow for bumping coder-cli --- .github/workflows/bump-coder-cli.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/bump-coder-cli.yaml b/.github/workflows/bump-coder-cli.yaml index d4919e1..097775b 100644 --- a/.github/workflows/bump-coder-cli.yaml +++ b/.github/workflows/bump-coder-cli.yaml @@ -17,7 +17,6 @@ jobs: git diff git checkout -b bump-coder-cli-1.14.1 git add coder-cli.rb - git remote add origin "https://$GITHUB_ACTOR:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY.git" git commit -m "feat: bump coder-cli version to v$version" git push --set-upstream origin bump-coder-cli-1.14.1 gh pr create --fill --reviewer cmoog From b8bff81e45566d6585ce23b5394af1eb43284ad2 Mon Sep 17 00:00:00 2001 From: Charlie Moog Date: Sat, 26 Dec 2020 15:59:57 -0600 Subject: [PATCH 06/16] fixup! feat: add action workflow for bumping coder-cli --- .github/workflows/bump-coder-cli.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/bump-coder-cli.yaml b/.github/workflows/bump-coder-cli.yaml index 097775b..c9c48b4 100644 --- a/.github/workflows/bump-coder-cli.yaml +++ b/.github/workflows/bump-coder-cli.yaml @@ -12,6 +12,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 + - name: Configure git + run: | + git config --global user.email "bot@coder.com" + git config --global user.name "Coder Bot" - run: | ./ci/scripts/bump-coder-cli.sh 1.14.1 git diff From be4509c3c9c4a143290ce7ef35c74aa8b5004200 Mon Sep 17 00:00:00 2001 From: Charlie Moog Date: Sat, 26 Dec 2020 16:04:55 -0600 Subject: [PATCH 07/16] fixup! feat: add action workflow for bumping coder-cli --- .github/workflows/bump-coder-cli.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/bump-coder-cli.yaml b/.github/workflows/bump-coder-cli.yaml index c9c48b4..eeabd10 100644 --- a/.github/workflows/bump-coder-cli.yaml +++ b/.github/workflows/bump-coder-cli.yaml @@ -16,11 +16,12 @@ jobs: run: | git config --global user.email "bot@coder.com" git config --global user.name "Coder Bot" + git remote add github "https://$GITHUB_ACTOR:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY.git" - run: | ./ci/scripts/bump-coder-cli.sh 1.14.1 git diff git checkout -b bump-coder-cli-1.14.1 git add coder-cli.rb git commit -m "feat: bump coder-cli version to v$version" - git push --set-upstream origin bump-coder-cli-1.14.1 + git push --set-upstream github bump-coder-cli-1.14.1 gh pr create --fill --reviewer cmoog From 05ba494e37097a9e6b0723d43e180aa8ddf12863 Mon Sep 17 00:00:00 2001 From: Charlie Moog Date: Sat, 26 Dec 2020 16:09:15 -0600 Subject: [PATCH 08/16] fixup! feat: add action workflow for bumping coder-cli --- .github/workflows/bump-coder-cli.yaml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/bump-coder-cli.yaml b/.github/workflows/bump-coder-cli.yaml index eeabd10..6b8d544 100644 --- a/.github/workflows/bump-coder-cli.yaml +++ b/.github/workflows/bump-coder-cli.yaml @@ -11,17 +11,16 @@ jobs: bump: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 - - name: Configure git - run: | - git config --global user.email "bot@coder.com" - git config --global user.name "Coder Bot" - git remote add github "https://$GITHUB_ACTOR:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY.git" + - uses: actions/checkout@v2 + # - name: Configure git + # run: | + # git config --global user.email "bot@coder.com" + # git config --global user.name "Coder Bot" - run: | ./ci/scripts/bump-coder-cli.sh 1.14.1 git diff git checkout -b bump-coder-cli-1.14.1 git add coder-cli.rb - git commit -m "feat: bump coder-cli version to v$version" + git commit -m "feat: bump coder-cli version to v1.14.1" git push --set-upstream github bump-coder-cli-1.14.1 gh pr create --fill --reviewer cmoog From 12473569fe2852ce005d4be14360952b6676350b Mon Sep 17 00:00:00 2001 From: Charlie Moog Date: Sat, 26 Dec 2020 16:11:28 -0600 Subject: [PATCH 09/16] fixup! feat: add action workflow for bumping coder-cli --- .github/workflows/bump-coder-cli.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/bump-coder-cli.yaml b/.github/workflows/bump-coder-cli.yaml index 6b8d544..e30b7e1 100644 --- a/.github/workflows/bump-coder-cli.yaml +++ b/.github/workflows/bump-coder-cli.yaml @@ -12,10 +12,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - # - name: Configure git - # run: | - # git config --global user.email "bot@coder.com" - # git config --global user.name "Coder Bot" + - name: Configure git + run: | + git config --global user.email "bot@coder.com" + git config --global user.name "Coder Bot" - run: | ./ci/scripts/bump-coder-cli.sh 1.14.1 git diff From 9225327a69c7939ec0dd2d0d9f1b9d1645325799 Mon Sep 17 00:00:00 2001 From: Charlie Moog Date: Sat, 26 Dec 2020 16:12:09 -0600 Subject: [PATCH 10/16] fixup! feat: add action workflow for bumping coder-cli --- .github/workflows/bump-coder-cli.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/bump-coder-cli.yaml b/.github/workflows/bump-coder-cli.yaml index e30b7e1..7047363 100644 --- a/.github/workflows/bump-coder-cli.yaml +++ b/.github/workflows/bump-coder-cli.yaml @@ -22,5 +22,5 @@ jobs: git checkout -b bump-coder-cli-1.14.1 git add coder-cli.rb git commit -m "feat: bump coder-cli version to v1.14.1" - git push --set-upstream github bump-coder-cli-1.14.1 + git push --set-upstream origin bump-coder-cli-1.14.1 gh pr create --fill --reviewer cmoog From 961f7892b6d3658d1e8479f56799320b03dd85f9 Mon Sep 17 00:00:00 2001 From: Charlie Moog Date: Sat, 26 Dec 2020 16:17:36 -0600 Subject: [PATCH 11/16] fixup! feat: add action workflow for bumping coder-cli --- .github/workflows/bump-coder-cli.yaml | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/.github/workflows/bump-coder-cli.yaml b/.github/workflows/bump-coder-cli.yaml index 7047363..bb59472 100644 --- a/.github/workflows/bump-coder-cli.yaml +++ b/.github/workflows/bump-coder-cli.yaml @@ -16,11 +16,14 @@ jobs: run: | git config --global user.email "bot@coder.com" git config --global user.name "Coder Bot" - - run: | - ./ci/scripts/bump-coder-cli.sh 1.14.1 - git diff - git checkout -b bump-coder-cli-1.14.1 - git add coder-cli.rb - git commit -m "feat: bump coder-cli version to v1.14.1" - git push --set-upstream origin bump-coder-cli-1.14.1 - gh pr create --fill --reviewer cmoog + - name: Open PR to bump coder-cli version + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + ./ci/scripts/bump-coder-cli.sh 1.14.1 + git diff + git checkout -b bump-coder-cli-1.14.1 + git add coder-cli.rb + git commit -m "feat: bump coder-cli version to v1.14.1" + git push --set-upstream origin bump-coder-cli-1.14.1 + gh pr create --fill --reviewer cmoog From a7835bf67a6a3aead052d4813067518e7d536d07 Mon Sep 17 00:00:00 2001 From: Charlie Moog Date: Sat, 26 Dec 2020 16:20:04 -0600 Subject: [PATCH 12/16] fixup! feat: add action workflow for bumping coder-cli --- .github/workflows/bump-coder-cli.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/bump-coder-cli.yaml b/.github/workflows/bump-coder-cli.yaml index bb59472..2357e53 100644 --- a/.github/workflows/bump-coder-cli.yaml +++ b/.github/workflows/bump-coder-cli.yaml @@ -26,4 +26,4 @@ jobs: git add coder-cli.rb git commit -m "feat: bump coder-cli version to v1.14.1" git push --set-upstream origin bump-coder-cli-1.14.1 - gh pr create --fill --reviewer cmoog + gh pr create --title="bump coder-cli version to v1.14.1" --reviewer cmoog From 52ecc5310322ad2ccf8dcdebd223f2dc40121119 Mon Sep 17 00:00:00 2001 From: Charlie Moog Date: Sat, 26 Dec 2020 16:22:34 -0600 Subject: [PATCH 13/16] fixup! feat: add action workflow for bumping coder-cli --- .github/workflows/bump-coder-cli.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/bump-coder-cli.yaml b/.github/workflows/bump-coder-cli.yaml index 2357e53..2e087f3 100644 --- a/.github/workflows/bump-coder-cli.yaml +++ b/.github/workflows/bump-coder-cli.yaml @@ -26,4 +26,7 @@ jobs: git add coder-cli.rb git commit -m "feat: bump coder-cli version to v1.14.1" git push --set-upstream origin bump-coder-cli-1.14.1 - gh pr create --title="bump coder-cli version to v1.14.1" --reviewer cmoog + gh pr create \ + --title="bump coder-cli version to v1.14.1" \ + --body="" \ + --reviewer cmoog From 7aec6792791cc9518bde18325af6cf23312580c6 Mon Sep 17 00:00:00 2001 From: Charlie Moog Date: Sat, 26 Dec 2020 16:27:56 -0600 Subject: [PATCH 14/16] fixup! feat: add action workflow for bumping coder-cli --- .github/workflows/bump-coder-cli.yaml | 29 +++++++++++++-------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/.github/workflows/bump-coder-cli.yaml b/.github/workflows/bump-coder-cli.yaml index 2e087f3..6eae735 100644 --- a/.github/workflows/bump-coder-cli.yaml +++ b/.github/workflows/bump-coder-cli.yaml @@ -1,32 +1,31 @@ name: bump_version on: - push - # workflow_dispatch: - # inputs: - # version: - # default: "" - # required: true - # description: "unprefixed version number (ex: '1.14.2')" + workflow_dispatch: + inputs: + version: + default: "" + required: true + description: "unprefixed version number (ex: '1.14.2')" jobs: - bump: + coder-cli: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Configure git run: | - git config --global user.email "bot@coder.com" - git config --global user.name "Coder Bot" + git config user.name github-actions + git config user.email github-actions@github.com - name: Open PR to bump coder-cli version env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - ./ci/scripts/bump-coder-cli.sh 1.14.1 + ./ci/scripts/bump-coder-cli.sh ${{ github.event.inputs.version }} git diff - git checkout -b bump-coder-cli-1.14.1 + git checkout -b bump-coder-cli-${{ github.event.inputs.version }} git add coder-cli.rb - git commit -m "feat: bump coder-cli version to v1.14.1" - git push --set-upstream origin bump-coder-cli-1.14.1 + git commit -m "feat: bump coder-cli version to v${{ github.event.inputs.version }}" + git push --set-upstream origin bump-coder-cli-${{ github.event.inputs.version }} gh pr create \ - --title="bump coder-cli version to v1.14.1" \ + --title="bump coder-cli version to v${{ github.event.inputs.version }}" \ --body="" \ --reviewer cmoog From b0120d275bfcc2416bc7aeb46807617c03bae060 Mon Sep 17 00:00:00 2001 From: Charlie Moog Date: Sat, 26 Dec 2020 16:28:56 -0600 Subject: [PATCH 15/16] fixup! feat: add action workflow for bumping coder-cli --- .github/workflows/bump-coder-cli.yaml | 2 +- ci/scripts/{bump-coder-cli.sh => gen-coder-cli-formula.sh} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename ci/scripts/{bump-coder-cli.sh => gen-coder-cli-formula.sh} (100%) diff --git a/.github/workflows/bump-coder-cli.yaml b/.github/workflows/bump-coder-cli.yaml index 6eae735..3c69d8e 100644 --- a/.github/workflows/bump-coder-cli.yaml +++ b/.github/workflows/bump-coder-cli.yaml @@ -19,7 +19,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - ./ci/scripts/bump-coder-cli.sh ${{ github.event.inputs.version }} + ./ci/scripts/gen-coder-cli-formula.sh ${{ github.event.inputs.version }} git diff git checkout -b bump-coder-cli-${{ github.event.inputs.version }} git add coder-cli.rb diff --git a/ci/scripts/bump-coder-cli.sh b/ci/scripts/gen-coder-cli-formula.sh similarity index 100% rename from ci/scripts/bump-coder-cli.sh rename to ci/scripts/gen-coder-cli-formula.sh From 633fe945792249efa8f24e857888f41706bcf99a Mon Sep 17 00:00:00 2001 From: Charlie Moog Date: Sat, 26 Dec 2020 16:31:14 -0600 Subject: [PATCH 16/16] fixup! feat: add action workflow for bumping coder-cli --- ci/scripts/gen-coder-cli-formula.sh | 4 ---- 1 file changed, 4 deletions(-) diff --git a/ci/scripts/gen-coder-cli-formula.sh b/ci/scripts/gen-coder-cli-formula.sh index ccfd4cd..2eb8eaf 100755 --- a/ci/scripts/gen-coder-cli-formula.sh +++ b/ci/scripts/gen-coder-cli-formula.sh @@ -16,10 +16,6 @@ macos_url="https://github.com/cdr/coder-cli/releases/download/v$version/coder-cl linux_sha="$(curl -sL "$linux_url" | sha)" macos_sha="$(curl -sL "$macos_url" | sha)" - -echo $macos_sha -echo $linux_sha - template=$(cat ./ci/templates/coder-cli.rb) template="${template//\{\{MACOS_SHA\}\}/$macos_sha}"