From 88cc5c050c4db769eb5764fca1f3b7113882bbb7 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Wed, 6 Jan 2021 19:35:25 +0000 Subject: [PATCH 01/82] changing the build workflow name and changing the exp environment to actually be windows --- .github/workflows/build.yml | 2 +- .github/workflows/exp.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 77d4ee9f14..b853d10fdf 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,4 @@ -name: build & publish +name: "Build & Publish" on: workflow_dispatch: diff --git a/.github/workflows/exp.yml b/.github/workflows/exp.yml index 1f6e1244ea..10b9422edc 100644 --- a/.github/workflows/exp.yml +++ b/.github/workflows/exp.yml @@ -5,7 +5,7 @@ on: jobs: exp: - runs-on: ubuntu-latest + runs-on: windows-latest steps: - name: Test pkg run: pkg --help From 509a71ef08548b9739e2752395fe540655c9cf7b Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Wed, 6 Jan 2021 19:48:08 +0000 Subject: [PATCH 02/82] installing pkg --- .github/workflows/exp.yml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/exp.yml b/.github/workflows/exp.yml index 10b9422edc..5cc9d3807b 100644 --- a/.github/workflows/exp.yml +++ b/.github/workflows/exp.yml @@ -7,5 +7,16 @@ jobs: exp: runs-on: windows-latest steps: - - name: Test pkg - run: pkg --help + - name: Set up Node + uses: actions/setup-node@v1 + with: + node-version: '10.x' + + - name: Set Node options + run: echo "NODE_OPTIONS=--max_old_space_size=4096" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + shell: pwsh + + - name: Install & Test pkg + run: | + npm install -g pkg + pkg --help From 4e9167e831999bc6a4d7bf9eee8ba5eb196529df Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Wed, 6 Jan 2021 20:48:11 +0000 Subject: [PATCH 03/82] adding debugging step --- .github/workflows/exp.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/exp.yml b/.github/workflows/exp.yml index 5cc9d3807b..4c9d034394 100644 --- a/.github/workflows/exp.yml +++ b/.github/workflows/exp.yml @@ -16,6 +16,9 @@ jobs: run: echo "NODE_OPTIONS=--max_old_space_size=4096" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append shell: pwsh + - name: Dir + run: dir C:\Users + - name: Install & Test pkg run: | npm install -g pkg From 1b61c6aa1a16b409365e2dab039154af33291e92 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Wed, 6 Jan 2021 20:52:27 +0000 Subject: [PATCH 04/82] debugging runneradmin directory --- .github/workflows/exp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/exp.yml b/.github/workflows/exp.yml index 4c9d034394..9b7f6fc041 100644 --- a/.github/workflows/exp.yml +++ b/.github/workflows/exp.yml @@ -17,7 +17,7 @@ jobs: shell: pwsh - name: Dir - run: dir C:\Users + run: dir C:\Users\runneradmin\.pkg-cache - name: Install & Test pkg run: | From 5da485933d900a8c342fcbac583bc5e4e8e169a1 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Wed, 6 Jan 2021 21:03:37 +0000 Subject: [PATCH 05/82] search for fetched --- .github/workflows/exp.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/exp.yml b/.github/workflows/exp.yml index 9b7f6fc041..feb2da6010 100644 --- a/.github/workflows/exp.yml +++ b/.github/workflows/exp.yml @@ -17,9 +17,12 @@ jobs: shell: pwsh - name: Dir - run: dir C:\Users\runneradmin\.pkg-cache + run: dir C:\Users\runneradmin - name: Install & Test pkg run: | npm install -g pkg pkg --help + + - name: Search for fetchd + run: dir \*fetched-\*-win-x64 /s From bbe4690677c694687ca7ffe2517ac984fce92289 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Wed, 6 Jan 2021 21:09:28 +0000 Subject: [PATCH 06/82] throwing wet spaghetti for cmd commands --- .github/workflows/exp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/exp.yml b/.github/workflows/exp.yml index feb2da6010..e14d67412a 100644 --- a/.github/workflows/exp.yml +++ b/.github/workflows/exp.yml @@ -25,4 +25,4 @@ jobs: pkg --help - name: Search for fetchd - run: dir \*fetched-\*-win-x64 /s + run: dir \*fetched-*-win-x64 /s From d3f330e41f4e32eeaf3785defe686effaeedcfb5 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Wed, 6 Jan 2021 21:11:41 +0000 Subject: [PATCH 07/82] more wet spaghetti! --- .github/workflows/exp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/exp.yml b/.github/workflows/exp.yml index e14d67412a..c9bf44d431 100644 --- a/.github/workflows/exp.yml +++ b/.github/workflows/exp.yml @@ -25,4 +25,4 @@ jobs: pkg --help - name: Search for fetchd - run: dir \*fetched-*-win-x64 /s + run: dir \*fetched* /s From 25b978b9d3d21abcd5199218dff4ee088567f588 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Wed, 6 Jan 2021 21:18:30 +0000 Subject: [PATCH 08/82] switching to powershell for the search --- .github/workflows/exp.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/exp.yml b/.github/workflows/exp.yml index c9bf44d431..38c3467d36 100644 --- a/.github/workflows/exp.yml +++ b/.github/workflows/exp.yml @@ -25,4 +25,5 @@ jobs: pkg --help - name: Search for fetchd - run: dir \*fetched* /s + shell: pwsh + run: Get-ChildItem C:\*fetched*win-x64 -recurse From ef4109b927649f4b8af50d8bfd7527b47976c0ad Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Wed, 6 Jan 2021 23:19:40 +0000 Subject: [PATCH 09/82] seeing if ResourceHacker is installed by default --- .github/workflows/exp.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/exp.yml b/.github/workflows/exp.yml index 38c3467d36..247b74d150 100644 --- a/.github/workflows/exp.yml +++ b/.github/workflows/exp.yml @@ -24,6 +24,5 @@ jobs: npm install -g pkg pkg --help - - name: Search for fetchd - shell: pwsh - run: Get-ChildItem C:\*fetched*win-x64 -recurse + - name: ResourceHacker Test + run: ResoureHacker -help From dd4825da1639ae82bf553c251bded978bafae3da Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Wed, 6 Jan 2021 23:27:20 +0000 Subject: [PATCH 10/82] testing RH download --- .github/workflows/exp.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/exp.yml b/.github/workflows/exp.yml index 247b74d150..7b4c31a5e5 100644 --- a/.github/workflows/exp.yml +++ b/.github/workflows/exp.yml @@ -16,13 +16,17 @@ jobs: run: echo "NODE_OPTIONS=--max_old_space_size=4096" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append shell: pwsh - - name: Dir - run: dir C:\Users\runneradmin - - name: Install & Test pkg run: | npm install -g pkg pkg --help + - name: Download RH + shell: bash + run: wget http://www.angusj.com/resourcehacker/#download + + - name: List RH + run: dir + - name: ResourceHacker Test run: ResoureHacker -help From f014bc66f04bdc2caffce4a3497d51823c722580 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Wed, 6 Jan 2021 23:40:04 +0000 Subject: [PATCH 11/82] switch from bash shell to pwsh shell --- .github/workflows/exp.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/exp.yml b/.github/workflows/exp.yml index 7b4c31a5e5..3258b1fe2b 100644 --- a/.github/workflows/exp.yml +++ b/.github/workflows/exp.yml @@ -22,8 +22,8 @@ jobs: pkg --help - name: Download RH - shell: bash - run: wget http://www.angusj.com/resourcehacker/#download + shell: pwsh + run: Invoke-WebRequest -Uri http://www.angusj.com/resourcehacker/#download -OutFile "RH" - name: List RH run: dir From 2bb30d3300fa3d46e1fef9e832d779d9b683e72a Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Wed, 6 Jan 2021 23:44:01 +0000 Subject: [PATCH 12/82] changing download file name --- .github/workflows/exp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/exp.yml b/.github/workflows/exp.yml index 3258b1fe2b..93ad58cf5c 100644 --- a/.github/workflows/exp.yml +++ b/.github/workflows/exp.yml @@ -23,7 +23,7 @@ jobs: - name: Download RH shell: pwsh - run: Invoke-WebRequest -Uri http://www.angusj.com/resourcehacker/#download -OutFile "RH" + run: Invoke-WebRequest -Uri http://www.angusj.com/resourcehacker/#download -OutFile "ResourceHacker" - name: List RH run: dir From f4394559c10a06fbe0a73c8a0dff5b47390d4d94 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Thu, 7 Jan 2021 16:05:44 +0000 Subject: [PATCH 13/82] trying to install ResourceHacker --- .github/workflows/exp.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/exp.yml b/.github/workflows/exp.yml index 93ad58cf5c..0dd746aff3 100644 --- a/.github/workflows/exp.yml +++ b/.github/workflows/exp.yml @@ -23,10 +23,12 @@ jobs: - name: Download RH shell: pwsh - run: Invoke-WebRequest -Uri http://www.angusj.com/resourcehacker/#download -OutFile "ResourceHacker" + run: | + Invoke-WebRequest -Uri http://www.angusj.com/resourcehacker/resource_hacker.zip -OutFile "resource_hacker.zip" + Expand-Archive -Path resource_hacker.zip -DestinationPath resource_hacker - name: List RH - run: dir + run: dir resource_hacker - name: ResourceHacker Test run: ResoureHacker -help From a117b114781678a027c5f0b4c89114005aca3649 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Thu, 7 Jan 2021 16:12:29 +0000 Subject: [PATCH 14/82] adding RH to path --- .github/workflows/exp.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/exp.yml b/.github/workflows/exp.yml index 0dd746aff3..8a5ac68313 100644 --- a/.github/workflows/exp.yml +++ b/.github/workflows/exp.yml @@ -30,5 +30,12 @@ jobs: - name: List RH run: dir resource_hacker + - name: Adding RH path to dir + run: setx path "%path%;d:\\a\\cli\\cli\\resource_hacker" + + - name: Debugging Path + shell: pwsh + run: echo $env:path + - name: ResourceHacker Test run: ResoureHacker -help From 75eb064015fe9512a22ad7764ce125254bd1873e Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Thu, 7 Jan 2021 16:23:03 +0000 Subject: [PATCH 15/82] switching over to using GITHUB_PATH --- .github/workflows/exp.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/exp.yml b/.github/workflows/exp.yml index 8a5ac68313..a46cced270 100644 --- a/.github/workflows/exp.yml +++ b/.github/workflows/exp.yml @@ -35,7 +35,9 @@ jobs: - name: Debugging Path shell: pwsh - run: echo $env:path + run: | + echo "d:\a\cli\cli\resource_hacker" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + echo $env:GITHUB_PATH - name: ResourceHacker Test run: ResoureHacker -help From 110c9ce4b5ec547b8f98cc76fb69d3177e26c577 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Thu, 7 Jan 2021 16:26:02 +0000 Subject: [PATCH 16/82] fixing syntax problem --- .github/workflows/exp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/exp.yml b/.github/workflows/exp.yml index a46cced270..84ae09bfe2 100644 --- a/.github/workflows/exp.yml +++ b/.github/workflows/exp.yml @@ -37,7 +37,7 @@ jobs: shell: pwsh run: | echo "d:\a\cli\cli\resource_hacker" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - echo $env:GITHUB_PATH + echo $env:GITHUB_PATH - name: ResourceHacker Test run: ResoureHacker -help From ec4107820044791b1521494e0418603e9b9f539a Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Thu, 7 Jan 2021 16:30:20 +0000 Subject: [PATCH 17/82] changing case of drive letter --- .github/workflows/exp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/exp.yml b/.github/workflows/exp.yml index 84ae09bfe2..c1dcd08ae7 100644 --- a/.github/workflows/exp.yml +++ b/.github/workflows/exp.yml @@ -36,7 +36,7 @@ jobs: - name: Debugging Path shell: pwsh run: | - echo "d:\a\cli\cli\resource_hacker" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + echo "D:\a\cli\cli\resource_hacker" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append echo $env:GITHUB_PATH - name: ResourceHacker Test From 8d37a1a11add5384a3bbffd8f8de70707e755f24 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Thu, 7 Jan 2021 16:48:17 +0000 Subject: [PATCH 18/82] adding pwsh PWD --- .github/workflows/exp.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/exp.yml b/.github/workflows/exp.yml index c1dcd08ae7..958d51fa6b 100644 --- a/.github/workflows/exp.yml +++ b/.github/workflows/exp.yml @@ -30,8 +30,9 @@ jobs: - name: List RH run: dir resource_hacker - - name: Adding RH path to dir - run: setx path "%path%;d:\\a\\cli\\cli\\resource_hacker" + - name: Get Current Directory + shell: pwsh + run: Get-Location - name: Debugging Path shell: pwsh From 56fe20c96dd3f2d176d316df4d4180e7e4a30e35 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Thu, 7 Jan 2021 16:57:20 +0000 Subject: [PATCH 19/82] trying the .exe --- .github/workflows/exp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/exp.yml b/.github/workflows/exp.yml index 958d51fa6b..61c3c362e8 100644 --- a/.github/workflows/exp.yml +++ b/.github/workflows/exp.yml @@ -41,4 +41,4 @@ jobs: echo $env:GITHUB_PATH - name: ResourceHacker Test - run: ResoureHacker -help + run: ResoureHacker.exe -help From c7155afbe75fa1fd795f5e3f3314ac94ca47b40e Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Thu, 7 Jan 2021 17:56:48 +0000 Subject: [PATCH 20/82] testing without adding it to a path --- .github/workflows/exp.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/exp.yml b/.github/workflows/exp.yml index 61c3c362e8..ade9022327 100644 --- a/.github/workflows/exp.yml +++ b/.github/workflows/exp.yml @@ -40,5 +40,9 @@ jobs: echo "D:\a\cli\cli\resource_hacker" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append echo $env:GITHUB_PATH + - name: ResourceHacker Test + shell: pwsh + run: .\resoure_hacker\ResourceHacker.exe -help + - name: ResourceHacker Test run: ResoureHacker.exe -help From b577263bb36de0e0a1302bc8895c589d478bcc09 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Thu, 7 Jan 2021 18:02:39 +0000 Subject: [PATCH 21/82] starting to throw wet spaghetti --- .github/workflows/exp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/exp.yml b/.github/workflows/exp.yml index ade9022327..046bccc7d4 100644 --- a/.github/workflows/exp.yml +++ b/.github/workflows/exp.yml @@ -42,7 +42,7 @@ jobs: - name: ResourceHacker Test shell: pwsh - run: .\resoure_hacker\ResourceHacker.exe -help + run: start-process -filepath "resoure_hacker\ResourceHacker.exe" -help - name: ResourceHacker Test run: ResoureHacker.exe -help From 40f31f5b0ed408b1d87d00328b9179fc3c654a49 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Thu, 7 Jan 2021 18:14:47 +0000 Subject: [PATCH 22/82] redoing the arg list --- .github/workflows/exp.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/exp.yml b/.github/workflows/exp.yml index 046bccc7d4..9a2585e608 100644 --- a/.github/workflows/exp.yml +++ b/.github/workflows/exp.yml @@ -42,7 +42,9 @@ jobs: - name: ResourceHacker Test shell: pwsh - run: start-process -filepath "resoure_hacker\ResourceHacker.exe" -help + run: | + $args = "-help" + start-process -filepath "resoure_hacker\ResourceHacker.exe" -argumentlist $args - name: ResourceHacker Test run: ResoureHacker.exe -help From 344c58011eaaedda2ea488dfe53552c242ea9bf5 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Thu, 7 Jan 2021 18:18:54 +0000 Subject: [PATCH 23/82] seeing if the github_path worked --- .github/workflows/exp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/exp.yml b/.github/workflows/exp.yml index 9a2585e608..6dba589256 100644 --- a/.github/workflows/exp.yml +++ b/.github/workflows/exp.yml @@ -44,7 +44,7 @@ jobs: shell: pwsh run: | $args = "-help" - start-process -filepath "resoure_hacker\ResourceHacker.exe" -argumentlist $args + start-process -filepath "ResourceHacker.exe" -argumentlist $args - name: ResourceHacker Test run: ResoureHacker.exe -help From 28f92d10b98d5982cf92bb515a535bbeb5fe018c Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Thu, 7 Jan 2021 18:25:15 +0000 Subject: [PATCH 24/82] trying to cd into resource_hacker --- .github/workflows/exp.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/exp.yml b/.github/workflows/exp.yml index 6dba589256..712c6a759d 100644 --- a/.github/workflows/exp.yml +++ b/.github/workflows/exp.yml @@ -46,5 +46,8 @@ jobs: $args = "-help" start-process -filepath "ResourceHacker.exe" -argumentlist $args + - name: ResourceHacker Test - run: ResoureHacker.exe -help + run: | + cd resource_hacker + ResoureHacker.exe -help From 9659b6bd819e2b2727bb485ca490ee751c66c2c2 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Thu, 7 Jan 2021 18:28:46 +0000 Subject: [PATCH 25/82] debugging RH --- .github/workflows/exp.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/exp.yml b/.github/workflows/exp.yml index 712c6a759d..8443acdcf3 100644 --- a/.github/workflows/exp.yml +++ b/.github/workflows/exp.yml @@ -50,4 +50,5 @@ jobs: - name: ResourceHacker Test run: | cd resource_hacker + dir ResoureHacker.exe -help From 987556db30af61d13924f70a1ed18046843558f5 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Thu, 7 Jan 2021 18:34:43 +0000 Subject: [PATCH 26/82] trying start --- .github/workflows/exp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/exp.yml b/.github/workflows/exp.yml index 8443acdcf3..af1db0951b 100644 --- a/.github/workflows/exp.yml +++ b/.github/workflows/exp.yml @@ -51,4 +51,4 @@ jobs: run: | cd resource_hacker dir - ResoureHacker.exe -help + start ResoureHacker.exe -help From 5d92d65e481a63a3095c4af4e6dd4c10ba16eabb Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Thu, 7 Jan 2021 18:43:50 +0000 Subject: [PATCH 27/82] trying cmd flag typo --- .github/workflows/exp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/exp.yml b/.github/workflows/exp.yml index af1db0951b..b87d16e050 100644 --- a/.github/workflows/exp.yml +++ b/.github/workflows/exp.yml @@ -51,4 +51,4 @@ jobs: run: | cd resource_hacker dir - start ResoureHacker.exe -help + start ResoureHacker.exe /help From 5a43ae2018b485e30cd5bbbbe309bbe4d565e785 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Thu, 7 Jan 2021 18:48:39 +0000 Subject: [PATCH 28/82] fixing typo............... --- .github/workflows/exp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/exp.yml b/.github/workflows/exp.yml index b87d16e050..c40f91fdc1 100644 --- a/.github/workflows/exp.yml +++ b/.github/workflows/exp.yml @@ -51,4 +51,4 @@ jobs: run: | cd resource_hacker dir - start ResoureHacker.exe /help + start ResourceHacker.exe /help From 36c9154c40b6331f9ef3fa3b69b51f15a102aa0f Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Thu, 7 Jan 2021 18:56:19 +0000 Subject: [PATCH 29/82] trying without changing directories --- .github/workflows/exp.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/exp.yml b/.github/workflows/exp.yml index c40f91fdc1..a97bd3c460 100644 --- a/.github/workflows/exp.yml +++ b/.github/workflows/exp.yml @@ -49,6 +49,4 @@ jobs: - name: ResourceHacker Test run: | - cd resource_hacker - dir start ResourceHacker.exe /help From 3869654b44a0f126314a4b6577db3657dad992b6 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Thu, 7 Jan 2021 19:06:10 +0000 Subject: [PATCH 30/82] trying a pwsh -Wait --- .github/workflows/exp.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/exp.yml b/.github/workflows/exp.yml index a97bd3c460..34a89b516a 100644 --- a/.github/workflows/exp.yml +++ b/.github/workflows/exp.yml @@ -43,9 +43,7 @@ jobs: - name: ResourceHacker Test shell: pwsh run: | - $args = "-help" - start-process -filepath "ResourceHacker.exe" -argumentlist $args - + start-process -filepath "ResourceHacker.exe" -argumentlist "-help" -Wait - name: ResourceHacker Test run: | From 1400a02c6926ecbfff9ca0c0c37a003fb6f25a43 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Thu, 7 Jan 2021 19:18:59 +0000 Subject: [PATCH 31/82] trying original with correct filename --- .github/workflows/exp.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/exp.yml b/.github/workflows/exp.yml index 34a89b516a..6f074bd621 100644 --- a/.github/workflows/exp.yml +++ b/.github/workflows/exp.yml @@ -16,11 +16,6 @@ jobs: run: echo "NODE_OPTIONS=--max_old_space_size=4096" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append shell: pwsh - - name: Install & Test pkg - run: | - npm install -g pkg - pkg --help - - name: Download RH shell: pwsh run: | @@ -47,4 +42,4 @@ jobs: - name: ResourceHacker Test run: | - start ResourceHacker.exe /help + ResourceHacker -help From dec58cc78c61fa4b47f1a14cac0b858ac888870e Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Thu, 7 Jan 2021 19:30:25 +0000 Subject: [PATCH 32/82] moving the downloads into the scripts directory --- .github/workflows/build.yml | 12 ++++++++++++ .github/workflows/exp.yml | 13 +++---------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b853d10fdf..7cd33b20d8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -41,6 +41,18 @@ jobs: with: node-version: '10.x' + - name: Download RH + shell: pwsh + run: | + Invoke-WebRequest -Uri http://www.angusj.com/resourcehacker/resource_hacker.zip -OutFile "resource_hacker.zip" + Expand-Archive -Path resource_hacker.zip -DestinationPath scripts/resource_hacker + + - name: Debugging Path + shell: pwsh + run: | + echo "D:\a\cli\cli\scripts\resource_hacker" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + echo $env:GITHUB_PATH + - name: Set PACKAGE_VERSION & VER_INFO run: | $env:pkgVersion = (Get-Content -Raw -Path .\package.json | ConvertFrom-Json).version diff --git a/.github/workflows/exp.yml b/.github/workflows/exp.yml index 6f074bd621..00f48eb178 100644 --- a/.github/workflows/exp.yml +++ b/.github/workflows/exp.yml @@ -19,20 +19,13 @@ jobs: - name: Download RH shell: pwsh run: | - Invoke-WebRequest -Uri http://www.angusj.com/resourcehacker/resource_hacker.zip -OutFile "resource_hacker.zip" - Expand-Archive -Path resource_hacker.zip -DestinationPath resource_hacker - - - name: List RH - run: dir resource_hacker - - - name: Get Current Directory - shell: pwsh - run: Get-Location + Invoke-WebRequest -Uri http://www.angusj.com/resourcehacker/resource_hacker.zip -OutFile "scripts\resource_hacker.zip" + Expand-Archive -Path "scripts\resource_hacker.zip" -DestinationPath scripts\resource_hacker - name: Debugging Path shell: pwsh run: | - echo "D:\a\cli\cli\resource_hacker" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + echo "D:\a\cli\cli\scripts\resource_hacker" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append echo $env:GITHUB_PATH - name: ResourceHacker Test From de76d31e691dd1bdfc5bc8f3a99aaceed23ec1d9 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Thu, 7 Jan 2021 19:38:49 +0000 Subject: [PATCH 33/82] debugging where I am --- .github/workflows/exp.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/exp.yml b/.github/workflows/exp.yml index 00f48eb178..8a5512be5b 100644 --- a/.github/workflows/exp.yml +++ b/.github/workflows/exp.yml @@ -7,6 +7,9 @@ jobs: exp: runs-on: windows-latest steps: + - name: Checkout repo + uses: actions/checkout@v2 + - name: Set up Node uses: actions/setup-node@v1 with: @@ -16,16 +19,19 @@ jobs: run: echo "NODE_OPTIONS=--max_old_space_size=4096" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append shell: pwsh + - name: Where am I? + run: dir + - name: Download RH shell: pwsh run: | - Invoke-WebRequest -Uri http://www.angusj.com/resourcehacker/resource_hacker.zip -OutFile "scripts\resource_hacker.zip" - Expand-Archive -Path "scripts\resource_hacker.zip" -DestinationPath scripts\resource_hacker + Invoke-WebRequest -Uri http://www.angusj.com/resourcehacker/resource_hacker.zip -OutFile "resource_hacker.zip" + Expand-Archive -Path resource_hacker.zip -DestinationPath scripts\resource_hacker - name: Debugging Path shell: pwsh run: | - echo "D:\a\cli\cli\scripts\resource_hacker" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + echo "D:\a\cli\cli\resource_hacker" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append echo $env:GITHUB_PATH - name: ResourceHacker Test From b7e0a998ad9013a70de0e58482eed51bce60ba3f Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Thu, 7 Jan 2021 19:41:07 +0000 Subject: [PATCH 34/82] trying to get the scripts directory thing to work --- .github/workflows/exp.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/exp.yml b/.github/workflows/exp.yml index 8a5512be5b..6cb8ae786a 100644 --- a/.github/workflows/exp.yml +++ b/.github/workflows/exp.yml @@ -25,13 +25,14 @@ jobs: - name: Download RH shell: pwsh run: | + cd scripts Invoke-WebRequest -Uri http://www.angusj.com/resourcehacker/resource_hacker.zip -OutFile "resource_hacker.zip" - Expand-Archive -Path resource_hacker.zip -DestinationPath scripts\resource_hacker + Expand-Archive -Path resource_hacker.zip -DestinationPath resource_hacker - name: Debugging Path shell: pwsh run: | - echo "D:\a\cli\cli\resource_hacker" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + echo "D:\a\cli\cli\scripts\resource_hacker" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append echo $env:GITHUB_PATH - name: ResourceHacker Test From 1f8404e92b787bb075a221b51840ba37aa12b7f2 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Thu, 7 Jan 2021 19:49:22 +0000 Subject: [PATCH 35/82] Fixing typo in build workflow --- .github/workflows/build.yml | 2 -- .github/workflows/exp.yml | 5 ----- 2 files changed, 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7cd33b20d8..018753b4db 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -73,8 +73,6 @@ jobs: Throw "test env failed." } - - name: - - name: ResourceHacker run: | if defined VER_INFO ResourceHacker -open %WIN_PKG% -save %WIN_PKG% -action delete -mask ICONGROUP,1, diff --git a/.github/workflows/exp.yml b/.github/workflows/exp.yml index 6cb8ae786a..e5c437d039 100644 --- a/.github/workflows/exp.yml +++ b/.github/workflows/exp.yml @@ -35,11 +35,6 @@ jobs: echo "D:\a\cli\cli\scripts\resource_hacker" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append echo $env:GITHUB_PATH - - name: ResourceHacker Test - shell: pwsh - run: | - start-process -filepath "ResourceHacker.exe" -argumentlist "-help" -Wait - - name: ResourceHacker Test run: | ResourceHacker -help From 95921566635023915ffc0a2cdf2a3302677581e8 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Thu, 7 Jan 2021 20:52:43 +0000 Subject: [PATCH 36/82] trying to specify cmd --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 018753b4db..807f27b1c4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -74,6 +74,7 @@ jobs: } - name: ResourceHacker + shell: cmd run: | if defined VER_INFO ResourceHacker -open %WIN_PKG% -save %WIN_PKG% -action delete -mask ICONGROUP,1, if defined VER_INFO ResourceHacker -open version-info.rc -save version-info.res -action compile From 26bbd90cf2789ebe1769c3723c774cd39c986175 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Thu, 7 Jan 2021 21:20:11 +0000 Subject: [PATCH 37/82] removing the experimental workflow --- .github/workflows/exp.yml | 40 --------------------------------------- 1 file changed, 40 deletions(-) delete mode 100644 .github/workflows/exp.yml diff --git a/.github/workflows/exp.yml b/.github/workflows/exp.yml deleted file mode 100644 index e5c437d039..0000000000 --- a/.github/workflows/exp.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: Windows Environment Exploration - -on: - workflow_dispatch: - -jobs: - exp: - runs-on: windows-latest - steps: - - name: Checkout repo - uses: actions/checkout@v2 - - - name: Set up Node - uses: actions/setup-node@v1 - with: - node-version: '10.x' - - - name: Set Node options - run: echo "NODE_OPTIONS=--max_old_space_size=4096" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - shell: pwsh - - - name: Where am I? - run: dir - - - name: Download RH - shell: pwsh - run: | - cd scripts - Invoke-WebRequest -Uri http://www.angusj.com/resourcehacker/resource_hacker.zip -OutFile "resource_hacker.zip" - Expand-Archive -Path resource_hacker.zip -DestinationPath resource_hacker - - - name: Debugging Path - shell: pwsh - run: | - echo "D:\a\cli\cli\scripts\resource_hacker" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - echo $env:GITHUB_PATH - - - name: ResourceHacker Test - run: | - ResourceHacker -help From 44cfa52d9af39ee7b09722d33a215a88f8b5d23c Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Thu, 7 Jan 2021 23:06:52 +0000 Subject: [PATCH 38/82] testing GH Action cache --- .github/workflows/build.yml | 29 ++++++++++++++--------------- .github/workflows/exp.yml | 24 ++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 15 deletions(-) create mode 100644 .github/workflows/exp.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 807f27b1c4..9df1e2361b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,15 +1,12 @@ name: "Build & Publish" on: - workflow_dispatch: - -#on: -# push: -# branches-ignore: -# - 'l10n_master' -# release: -# types: -# - published + push: + branches-ignore: + - 'l10n_master' + release: + types: + - published jobs: cloc: @@ -33,6 +30,13 @@ jobs: - name: Checkout repo uses: actions/checkout@v2 + - name: Cache Dist + id: cached-dist + uses: actions/cache@v2 + with: + path: dist + key: ${{ runner.os }}-${{ hashFiles('dist/') }} + - name: Setup Windows builder run: choco install checksum --no-progress @@ -41,17 +45,12 @@ jobs: with: node-version: '10.x' - - name: Download RH + - name: Download & Install RH shell: pwsh run: | Invoke-WebRequest -Uri http://www.angusj.com/resourcehacker/resource_hacker.zip -OutFile "resource_hacker.zip" Expand-Archive -Path resource_hacker.zip -DestinationPath scripts/resource_hacker - - - name: Debugging Path - shell: pwsh - run: | echo "D:\a\cli\cli\scripts\resource_hacker" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - echo $env:GITHUB_PATH - name: Set PACKAGE_VERSION & VER_INFO run: | diff --git a/.github/workflows/exp.yml b/.github/workflows/exp.yml new file mode 100644 index 0000000000..436b308dcd --- /dev/null +++ b/.github/workflows/exp.yml @@ -0,0 +1,24 @@ +name: Windows Environment Exploration + +on: + workflow_dispatch: + +jobs: + exp: + runs-on: windows-latest + steps: + - name: Checkout repo + uses: actions/checkout@v2 + + - name: Cache Dist + id: cached-dist + uses: actions/cache@v2 + with: + path: dist + key: ${{ runner.os }}-${{ hashFiles('dist/') }} + + - name: Creating test cache + shell: bash + run: | + [ -f dist/test.txt ] && echo "File exists!" + [ ! -f dist/test.txt ] && mkdir dist && echo "this is a test" > dist/test.txt From c6e0af757f31b2d6d03b557eed849e1d359e5bdd Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Thu, 7 Jan 2021 23:07:26 +0000 Subject: [PATCH 39/82] changing name of workflow --- .github/workflows/exp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/exp.yml b/.github/workflows/exp.yml index 436b308dcd..f08c469ec4 100644 --- a/.github/workflows/exp.yml +++ b/.github/workflows/exp.yml @@ -1,4 +1,4 @@ -name: Windows Environment Exploration +name: Experiment on: workflow_dispatch: From c609a913145773e6dfb9e2ef4892be668beb6403 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Fri, 8 Jan 2021 19:19:52 +0000 Subject: [PATCH 40/82] testing building and packaging before moving on to publishing --- .github/workflows/build.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9df1e2361b..c26d205ba8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,13 +30,6 @@ jobs: - name: Checkout repo uses: actions/checkout@v2 - - name: Cache Dist - id: cached-dist - uses: actions/cache@v2 - with: - path: dist - key: ${{ runner.os }}-${{ hashFiles('dist/') }} - - name: Setup Windows builder run: choco install checksum --no-progress @@ -100,6 +93,9 @@ jobs: - name: Package Linux run: npm run package:lin + - name: Package Chocolatey + run: .\scripts\choco-pack.ps1 + - name: Zip shell: cmd run: | @@ -119,10 +115,8 @@ jobs: Throw "Version test failed." } - - name: Package & Create checksums + - name: Create checksums run: | - .\scripts\choco-pack.ps1 - checksum -f="./dist/bw-windows-${env:PACKAGE_VERSION}.zip" ` -t sha256 | Out-File -Encoding ASCII ./dist/bw-windows-sha256-${env:PACKAGE_VERSION}.txt checksum -f="./dist/bw-macos-${env:PACKAGE_VERSION}.zip" ` @@ -179,6 +173,9 @@ jobs: needs: build if: github.event_name == 'release' steps: + - name: Checkout repo + uses: actions/checkout@v2 + - name: Setup Chocolatey run: choco apikey --key $env:CHOCO_API_KEY --source https://push.chocolatey.org/ env: @@ -251,6 +248,9 @@ jobs: needs: build if: github.event_name == 'release' steps: + - name: Checkout repo + uses: actions/checkout@v2 + - name: Setup NPM shell: pwsh run: | From bc88785eb850f361a82865a8620469961b9e6551 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Fri, 8 Jan 2021 20:16:35 +0000 Subject: [PATCH 41/82] trying to deconstruct a script --- .github/workflows/build.yml | 34 +++++++++++++++++++++++++++------- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c26d205ba8..41e4bfc20c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -94,7 +94,7 @@ jobs: run: npm run package:lin - name: Package Chocolatey - run: .\scripts\choco-pack.ps1 + run: .\scripts\choco-pack.ps1 # DO NOT USE PUSH SWITCH! - name: Zip shell: cmd @@ -171,19 +171,39 @@ jobs: name: Publish Windows runs-on: windows-latest needs: build - if: github.event_name == 'release' + #if: github.event_name == 'release' steps: - name: Checkout repo uses: actions/checkout@v2 - - name: Setup Chocolatey - run: choco apikey --key $env:CHOCO_API_KEY --source https://push.chocolatey.org/ - env: - CHOCO_API_KEY: ${{ secrets.CHOCO_API_KEY }} + #- name: Setup Chocolatey + # run: choco apikey --key $env:CHOCO_API_KEY --source https://push.chocolatey.org/ + # env: + # CHOCO_API_KEY: ${{ secrets.CHOCO_API_KEY }} + + #- name: Publish + # run: | + # .\scripts\choco-update.ps1 -version $env:PACKAGE_VERSION - name: Publish + shell: pwsh run: | - .\scripts\choco-update.ps1 -version $env:PACKAGE_VERSION + $dir = Split-Path -Parent $MyInvocation.MyCommand.Path + $rootDir = $dir + $distDir = $rootDir + "\dist" + $distChocoDir = $distDir + "\chocolatey" + + New-Item -ItemType directory -Path $distChocoDir | Out-Null + + $nupkg = "bitwarden-cli." + $version + ".nupkg" + $uri = "https://github.com/bitwarden/cli/releases/download/v" + $version + "/" + $nupkg + [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 + Invoke-RestMethod -Uri $uri -OutFile $($distChocoDir + "\\" + $nupkg) + + cd $distChocoDir + #choco push + Write-Host "[+] Intead of pushing with choco, we are testing and writing this out" + Write-Host " Nuget Packge: $env:distChocoDir\\$env:nupkg" # This process seems independent from the others From 90f9095215fea9f62bd359fc12894ecee3e0228b Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Fri, 8 Jan 2021 20:29:28 +0000 Subject: [PATCH 42/82] trying a download action --- .github/workflows/build.yml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 41e4bfc20c..059de1063e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -176,6 +176,12 @@ jobs: - name: Checkout repo uses: actions/checkout@v2 + - name: Download Windows Nuget + uses: actions/download-artifact@v2 + with: + name: bitwarden-cli.${{ env.PACKAGE_VERSION }}.nupkg + path: ./dist/bitwarden-cli.${{ env.PACKAGE_VERSION }}.nupkg + #- name: Setup Chocolatey # run: choco apikey --key $env:CHOCO_API_KEY --source https://push.chocolatey.org/ # env: @@ -191,16 +197,14 @@ jobs: $dir = Split-Path -Parent $MyInvocation.MyCommand.Path $rootDir = $dir $distDir = $rootDir + "\dist" - $distChocoDir = $distDir + "\chocolatey" + $distChocoDir = $distDir - New-Item -ItemType directory -Path $distChocoDir | Out-Null + #New-Item -ItemType directory -Path $distChocoDir | Out-Null $nupkg = "bitwarden-cli." + $version + ".nupkg" - $uri = "https://github.com/bitwarden/cli/releases/download/v" + $version + "/" + $nupkg - [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 - Invoke-RestMethod -Uri $uri -OutFile $($distChocoDir + "\\" + $nupkg) - cd $distChocoDir + cd ./dist + Get-ChildItem #choco push Write-Host "[+] Intead of pushing with choco, we are testing and writing this out" Write-Host " Nuget Packge: $env:distChocoDir\\$env:nupkg" From 1fe4a2f835e8a892b4146dc33b66f603eda2aa84 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Fri, 8 Jan 2021 20:41:15 +0000 Subject: [PATCH 43/82] finding the PACKAGE_VERSION in new job --- .github/workflows/build.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 059de1063e..a5ffb440f1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -176,6 +176,11 @@ jobs: - name: Checkout repo uses: actions/checkout@v2 + - name: Set PACKAGE_VERSION + run: | + $env:pkgVersion = (Get-Content -Raw -Path .\package.json | ConvertFrom-Json).version + echo "PACKAGE_VERSION=$env:pkgVersion" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + - name: Download Windows Nuget uses: actions/download-artifact@v2 with: From 3953de1811986c136a6b64d17e179dd84496aacd Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Fri, 8 Jan 2021 21:08:19 +0000 Subject: [PATCH 44/82] another choco publishing test --- .github/workflows/build.yml | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a5ffb440f1..0e814c2429 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -199,20 +199,12 @@ jobs: - name: Publish shell: pwsh run: | - $dir = Split-Path -Parent $MyInvocation.MyCommand.Path - $rootDir = $dir - $distDir = $rootDir + "\dist" - $distChocoDir = $distDir - - #New-Item -ItemType directory -Path $distChocoDir | Out-Null - - $nupkg = "bitwarden-cli." + $version + ".nupkg" - + # In place of ./scripts/choco-update.ps1 cd ./dist Get-ChildItem - #choco push Write-Host "[+] Intead of pushing with choco, we are testing and writing this out" - Write-Host " Nuget Packge: $env:distChocoDir\\$env:nupkg" + Write-Host " Nuget Packge: bitwarden-cli.${{ env.PACKAGE_VERSION }}.nupkg" + #choco push # This process seems independent from the others From 634eb7e9d1849dbaf9f13a2a0b263bd08e1ed74b Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Fri, 8 Jan 2021 22:32:16 +0000 Subject: [PATCH 45/82] experimenting with moving the choco-pack script --- .github/workflows/build.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0e814c2429..1a652494e7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -94,7 +94,16 @@ jobs: run: npm run package:lin - name: Package Chocolatey - run: .\scripts\choco-pack.ps1 # DO NOT USE PUSH SWITCH! + shell: pwsh + run: | + #.\scripts\choco-pack.ps1 # DO NOT USE PUSH SWITCH! + Copy-Item -Path stores\chocolatey -Destination dist\chocolatey -Recurse + Copy-Item dist\windows\bw.exe -Destination dist\chocolatey\tools + Copy-Item LICENSE.exe -Destination dist\chocolatey\tools + + choco pack dist\chocolatey\bitwarden-cli.nuspec --version ${{ env:PACKAGE_VERSION }} --out dist\chocolatey + + Get-ChildItem - name: Zip shell: cmd From d761cf9a9eb4844e8ecc1a58aa7f977cd30237e1 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Fri, 8 Jan 2021 22:33:20 +0000 Subject: [PATCH 46/82] fixing a typo --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1a652494e7..f1e72e640e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -101,7 +101,7 @@ jobs: Copy-Item dist\windows\bw.exe -Destination dist\chocolatey\tools Copy-Item LICENSE.exe -Destination dist\chocolatey\tools - choco pack dist\chocolatey\bitwarden-cli.nuspec --version ${{ env:PACKAGE_VERSION }} --out dist\chocolatey + choco pack dist\chocolatey\bitwarden-cli.nuspec --version ${{ env.PACKAGE_VERSION }} --out dist\chocolatey Get-ChildItem From 7669b654ce35f1bbce21ff9ffb3b3ff1c4e19540 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Fri, 8 Jan 2021 22:40:34 +0000 Subject: [PATCH 47/82] moved exe to txt --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f1e72e640e..0f0813abf5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -99,7 +99,7 @@ jobs: #.\scripts\choco-pack.ps1 # DO NOT USE PUSH SWITCH! Copy-Item -Path stores\chocolatey -Destination dist\chocolatey -Recurse Copy-Item dist\windows\bw.exe -Destination dist\chocolatey\tools - Copy-Item LICENSE.exe -Destination dist\chocolatey\tools + Copy-Item LICENSE.txt -Destination dist\chocolatey\tools choco pack dist\chocolatey\bitwarden-cli.nuspec --version ${{ env.PACKAGE_VERSION }} --out dist\chocolatey From 20dcfe8ad3a5e25f3e5ee053f6f1af3bb4a0a810 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Fri, 8 Jan 2021 23:28:32 +0000 Subject: [PATCH 48/82] changing out snap build script --- .github/workflows/build.yml | 35 +++++++++++++++++++++++------------ 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0f0813abf5..6e44d16a5d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -96,15 +96,12 @@ jobs: - name: Package Chocolatey shell: pwsh run: | - #.\scripts\choco-pack.ps1 # DO NOT USE PUSH SWITCH! Copy-Item -Path stores\chocolatey -Destination dist\chocolatey -Recurse Copy-Item dist\windows\bw.exe -Destination dist\chocolatey\tools Copy-Item LICENSE.txt -Destination dist\chocolatey\tools choco pack dist\chocolatey\bitwarden-cli.nuspec --version ${{ env.PACKAGE_VERSION }} --out dist\chocolatey - Get-ChildItem - - name: Zip shell: cmd run: | @@ -221,15 +218,20 @@ jobs: name: Publish Snap runs-on: ubuntu-latest needs: build - if: github.event_name == 'release' + #if: github.event_name == 'release' steps: - name: Checkout repo uses: actions/checkout@v2 + - name: Set PACKAGE_VERSION + run: | + $env:pkgVersion = (Get-Content -Raw -Path .\package.json | ConvertFrom-Json).version + echo "PACKAGE_VERSION=$env:pkgVersion" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + - name: Install Snapcraft uses: samuelmeuli/action-snapcraft@v1 - with: - snapcraft_token: ${{ secrets.SNAP_TOKEN }} + #with: + # snapcraft_token: ${{ secrets.SNAP_TOKEN }} - name: Print environment run: | @@ -244,7 +246,16 @@ jobs: - name: Install Snap shell: pwsh run: | - ./scripts/snap-build.ps1 -version $env:PACKAGE_VERSION + #./scripts/snap-build.ps1 -version $env:PACKAGE_VERSION + Copy-Item -Path stores\snap -Destination dist\snap + (Get-Content snap\snapcraft.yaml).replace('__version__', ${{ env.PACKAGE_VERSION }}) | Set-Content snap\snapcraft.yaml + + cd dist\snap + Get-ChildItem + snapcraft + cd ..\.. + Get-ChildItem + snap install ./dist/snap/bw*.snap --dangerous - name: Test Snap @@ -261,11 +272,11 @@ jobs: snap remove bw ./scripts/snap-update.ps1 - - name: Publish - shell: pwsh - run: | - echo "" - echo "./dist/snap/bw_${PACKAGE_VERSION}_amd64.snap" + - name: Publish linux checksum to GitHub + uses: actions/upload-artifact@v2 + with: + name: bw_${{ env.PACKAGE_VERSION }}_amd64.snap + path: ./dist/snap/bw_${{ env.PACKAGE_VERSION }}_amd64.snap - name: Snap Logout run: snapcraft logout From ecaa04cac592a96bc916508d109b60754f2f3969 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Fri, 8 Jan 2021 23:31:39 +0000 Subject: [PATCH 49/82] testing snap publish --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6e44d16a5d..83a5cb2b46 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -270,7 +270,7 @@ jobs: shell: pwsh run: | snap remove bw - ./scripts/snap-update.ps1 + #./scripts/snap-update.ps1 - name: Publish linux checksum to GitHub uses: actions/upload-artifact@v2 @@ -278,8 +278,8 @@ jobs: name: bw_${{ env.PACKAGE_VERSION }}_amd64.snap path: ./dist/snap/bw_${{ env.PACKAGE_VERSION }}_amd64.snap - - name: Snap Logout - run: snapcraft logout + #- name: Snap Logout + # run: snapcraft logout # This job is independent: it reruns 'npm run build:prod' From 1b6d1a52ae9bb8d85b5c0cffc033f8b1ad548d92 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Fri, 8 Jan 2021 23:44:51 +0000 Subject: [PATCH 50/82] switching to powershell --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 83a5cb2b46..1ba8375322 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -224,6 +224,7 @@ jobs: uses: actions/checkout@v2 - name: Set PACKAGE_VERSION + shell: pwsh run: | $env:pkgVersion = (Get-Content -Raw -Path .\package.json | ConvertFrom-Json).version echo "PACKAGE_VERSION=$env:pkgVersion" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append From f68b736531be47ddf60c2ab23aad3f01a1415a2c Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Fri, 8 Jan 2021 23:55:01 +0000 Subject: [PATCH 51/82] fixing the path directory --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1ba8375322..18b387d65b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -249,7 +249,7 @@ jobs: run: | #./scripts/snap-build.ps1 -version $env:PACKAGE_VERSION Copy-Item -Path stores\snap -Destination dist\snap - (Get-Content snap\snapcraft.yaml).replace('__version__', ${{ env.PACKAGE_VERSION }}) | Set-Content snap\snapcraft.yaml + (Get-Content dist\snap\snapcraft.yaml).replace('__version__', ${{ env.PACKAGE_VERSION }}) | Set-Content snap\snapcraft.yaml cd dist\snap Get-ChildItem From 095658dbed1338fbadc80db2e17c9a5dc4608e21 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Sat, 9 Jan 2021 00:07:34 +0000 Subject: [PATCH 52/82] degugging snap dirs --- .github/workflows/build.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 18b387d65b..02a694c743 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -248,6 +248,9 @@ jobs: shell: pwsh run: | #./scripts/snap-build.ps1 -version $env:PACKAGE_VERSION + Get-ChildItem dist + Get-ChildItem dist\snap + Copy-Item -Path stores\snap -Destination dist\snap (Get-Content dist\snap\snapcraft.yaml).replace('__version__', ${{ env.PACKAGE_VERSION }}) | Set-Content snap\snapcraft.yaml From 8eeba9d741c78cfd2259d62fe7faefab89ce6c4b Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Sat, 9 Jan 2021 00:19:25 +0000 Subject: [PATCH 53/82] creating the dist dir --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 02a694c743..bfe9aa67c9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -248,6 +248,7 @@ jobs: shell: pwsh run: | #./scripts/snap-build.ps1 -version $env:PACKAGE_VERSION + New-Item -Path 'dist' -ItemType Directory Get-ChildItem dist Get-ChildItem dist\snap From cd82df05de45d7764feb56a87b8fac6495da23e2 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Sat, 9 Jan 2021 00:29:59 +0000 Subject: [PATCH 54/82] moving around the debugging --- .github/workflows/build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bfe9aa67c9..9ef831b42d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -250,9 +250,10 @@ jobs: #./scripts/snap-build.ps1 -version $env:PACKAGE_VERSION New-Item -Path 'dist' -ItemType Directory Get-ChildItem dist + + Copy-Item -Path stores\snap -Destination dist\snap -Recurse Get-ChildItem dist\snap - Copy-Item -Path stores\snap -Destination dist\snap (Get-Content dist\snap\snapcraft.yaml).replace('__version__', ${{ env.PACKAGE_VERSION }}) | Set-Content snap\snapcraft.yaml cd dist\snap From 05dbef39b08238129cd1e54eecc0d85a1792a2ca Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Sat, 9 Jan 2021 00:37:27 +0000 Subject: [PATCH 55/82] fixing another path --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9ef831b42d..26bd6e4ae9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -254,7 +254,7 @@ jobs: Copy-Item -Path stores\snap -Destination dist\snap -Recurse Get-ChildItem dist\snap - (Get-Content dist\snap\snapcraft.yaml).replace('__version__', ${{ env.PACKAGE_VERSION }}) | Set-Content snap\snapcraft.yaml + (Get-Content dist\snap\snapcraft.yaml).replace('__version__', ${{ env.PACKAGE_VERSION }}) | Set-Content dist\snap\snapcraft.yaml cd dist\snap Get-ChildItem From c8b67c61a447dcaec3d44ba3ede07338ceb18f75 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Sat, 9 Jan 2021 00:47:16 +0000 Subject: [PATCH 56/82] switching around and trying again --- .github/workflows/build.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 26bd6e4ae9..2d4874e5af 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -248,10 +248,11 @@ jobs: shell: pwsh run: | #./scripts/snap-build.ps1 -version $env:PACKAGE_VERSION - New-Item -Path 'dist' -ItemType Directory - Get-ChildItem dist + + #New-Item -Path 'dist' -ItemType Directory Copy-Item -Path stores\snap -Destination dist\snap -Recurse + Get-ChildItem dist Get-ChildItem dist\snap (Get-Content dist\snap\snapcraft.yaml).replace('__version__', ${{ env.PACKAGE_VERSION }}) | Set-Content dist\snap\snapcraft.yaml From 26445857e625266b39c77412cd88168eef6d2867 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Mon, 11 Jan 2021 14:33:13 +0000 Subject: [PATCH 57/82] adding PACKAGE_VERSION to the environment --- .github/workflows/build.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2d4874e5af..2df1de0a92 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -201,6 +201,7 @@ jobs: #- name: Publish # run: | # .\scripts\choco-update.ps1 -version $env:PACKAGE_VERSION + Get-ChildItem dist - name: Publish shell: pwsh @@ -222,6 +223,8 @@ jobs: steps: - name: Checkout repo uses: actions/checkout@v2 + Get-ChildItem dist + Get-ChildItem dist - name: Set PACKAGE_VERSION shell: pwsh @@ -240,11 +243,12 @@ jobs: snapcraft --version echo "GitHub ref: $GITHUB_REF" echo "GitHub event: $GITHUB_EVENT" + echo "BW Package Version: $PACKAGE_VERSION" env: GITHUB_REF: ${{ github.ref }} GITHUB_EVENT: ${{ github.event_name }} - - name: Install Snap + - name: Build Snap Package shell: pwsh run: | #./scripts/snap-build.ps1 -version $env:PACKAGE_VERSION @@ -255,7 +259,7 @@ jobs: Get-ChildItem dist Get-ChildItem dist\snap - (Get-Content dist\snap\snapcraft.yaml).replace('__version__', ${{ env.PACKAGE_VERSION }}) | Set-Content dist\snap\snapcraft.yaml + (Get-Content dist\snap\snapcraft.yaml).replace('__version__', $env:PACKAGE_VERSION) | Set-Content dist\snap\snapcraft.yaml cd dist\snap Get-ChildItem From d903309e3bccd14679014542bb77e04dae269d09 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Mon, 11 Jan 2021 14:34:39 +0000 Subject: [PATCH 58/82] commenting out pesky line --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2df1de0a92..8e68380a79 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -201,7 +201,7 @@ jobs: #- name: Publish # run: | # .\scripts\choco-update.ps1 -version $env:PACKAGE_VERSION - Get-ChildItem dist + # Get-ChildItem dist - name: Publish shell: pwsh From 84c3c0dc8c14a5349ececa16c9048fd134d17a38 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Mon, 11 Jan 2021 14:44:29 +0000 Subject: [PATCH 59/82] some random lines snuck in... --- .github/workflows/build.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8e68380a79..296489201f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -223,8 +223,6 @@ jobs: steps: - name: Checkout repo uses: actions/checkout@v2 - Get-ChildItem dist - Get-ChildItem dist - name: Set PACKAGE_VERSION shell: pwsh From bd0a49d617f6db970fc0fb59a464b0035d897664 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Mon, 11 Jan 2021 15:30:36 +0000 Subject: [PATCH 60/82] switching from pwsh to bash for the snap build --- .github/workflows/build.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 296489201f..c913999e37 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -247,6 +247,23 @@ jobs: GITHUB_EVENT: ${{ github.event_name }} - name: Build Snap Package + run: | + cp -r stores/snap -t /dist/snap + ls -atlh dist + ls -alth dist/snap + + sed -i s/__version__/${{ env.PACKAGE_VERSION }}/g dist/snap/snapcraft.yaml + + cd dist/snap + ls -atlh + snapcraft + cd ../.. + ls -atlh + + snap install ./dist/snap/bw*.snap --dangerous + + - name: Build Snap Package + if: false shell: pwsh run: | #./scripts/snap-build.ps1 -version $env:PACKAGE_VERSION From 7b1604ec41dcd40367fe3f27e0a7e876da7ae313 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Mon, 11 Jan 2021 15:43:37 +0000 Subject: [PATCH 61/82] fixing path --- .github/workflows/build.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c913999e37..9d37405701 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -248,13 +248,13 @@ jobs: - name: Build Snap Package run: | - cp -r stores/snap -t /dist/snap - ls -atlh dist - ls -alth dist/snap + cp -r ./stores/snap -t ./dist/snap + ls -atlh ./dist + ls -alth ./dist/snap - sed -i s/__version__/${{ env.PACKAGE_VERSION }}/g dist/snap/snapcraft.yaml + sed -i s/__version__/${{ env.PACKAGE_VERSION }}/g ./dist/snap/snapcraft.yaml - cd dist/snap + cd ./dist/snap ls -atlh snapcraft cd ../.. From 99e5e5985511a8c19983b97f10ca096617263add Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Mon, 11 Jan 2021 15:52:28 +0000 Subject: [PATCH 62/82] making the dist directory --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9d37405701..4c8df0eaf4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -248,6 +248,7 @@ jobs: - name: Build Snap Package run: | + mkdir ./dist cp -r ./stores/snap -t ./dist/snap ls -atlh ./dist ls -alth ./dist/snap From bb594e6ac5c7d67a1bbddbb3f42c5efd486e9bcb Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Mon, 11 Jan 2021 16:05:33 +0000 Subject: [PATCH 63/82] fixing the path again --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4c8df0eaf4..44ba33a004 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -249,7 +249,7 @@ jobs: - name: Build Snap Package run: | mkdir ./dist - cp -r ./stores/snap -t ./dist/snap + cp -r ./stores/snap -t ./dist ls -atlh ./dist ls -alth ./dist/snap From 0dbfcb1e6bc02d185e891380c57f9267c0d0f16e Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Mon, 11 Jan 2021 16:14:32 +0000 Subject: [PATCH 64/82] Separating the build and install commands --- .github/workflows/build.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 44ba33a004..363c8fb61c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -258,10 +258,9 @@ jobs: cd ./dist/snap ls -atlh snapcraft - cd ../.. - ls -atlh - snap install ./dist/snap/bw*.snap --dangerous + - name: Install Snap + run: sudo snap install ./dist/snap/bw*.snap --dangerous - name: Build Snap Package if: false From c0a6647c7d170661d573e5160c900306bce9728a Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Mon, 11 Jan 2021 16:27:01 +0000 Subject: [PATCH 65/82] adding sudo to cleanup --- .github/workflows/build.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 363c8fb61c..913e6ad680 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -295,8 +295,9 @@ jobs: - name: Cleanup Test & Update Snap for Publish shell: pwsh run: | - snap remove bw - #./scripts/snap-update.ps1 + sudo snap remove bw + + #snapcraft push ./dist/snap/bw*.snap --release stable - name: Publish linux checksum to GitHub uses: actions/upload-artifact@v2 From e9159081ba5a308aabbc366c646d6b2ddc7001ae Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Mon, 11 Jan 2021 18:00:05 +0000 Subject: [PATCH 66/82] splitting the snap build and publish --- .github/workflows/build.yml | 90 +++++++++++++++++++++++-------------- 1 file changed, 56 insertions(+), 34 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 913e6ad680..b7d7c59c96 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -215,10 +215,9 @@ jobs: # This process seems independent from the others - publish_snap: - name: Publish Snap + build_snap: + name: Build Snap runs-on: ubuntu-latest - needs: build #if: github.event_name == 'release' steps: - name: Checkout repo @@ -250,40 +249,17 @@ jobs: run: | mkdir ./dist cp -r ./stores/snap -t ./dist - ls -atlh ./dist - ls -alth ./dist/snap - sed -i s/__version__/${{ env.PACKAGE_VERSION }}/g ./dist/snap/snapcraft.yaml cd ./dist/snap - ls -atlh snapcraft + sha256sum bw_${{ env.PACKAGE_VERSION }}_amd64.snap | \ + awk '{split($0, a); print a[1]}' > bw-snap-sha256-${{ env.PACKAGE_VERSION }}.txt + - name: Install Snap run: sudo snap install ./dist/snap/bw*.snap --dangerous - - name: Build Snap Package - if: false - shell: pwsh - run: | - #./scripts/snap-build.ps1 -version $env:PACKAGE_VERSION - - #New-Item -Path 'dist' -ItemType Directory - - Copy-Item -Path stores\snap -Destination dist\snap -Recurse - Get-ChildItem dist - Get-ChildItem dist\snap - - (Get-Content dist\snap\snapcraft.yaml).replace('__version__', $env:PACKAGE_VERSION) | Set-Content dist\snap\snapcraft.yaml - - cd dist\snap - Get-ChildItem - snapcraft - cd ..\.. - Get-ChildItem - - snap install ./dist/snap/bw*.snap --dangerous - - name: Test Snap shell: pwsh run: | @@ -297,16 +273,62 @@ jobs: run: | sudo snap remove bw - #snapcraft push ./dist/snap/bw*.snap --release stable - - - name: Publish linux checksum to GitHub + - name: Publish snap to GitHub uses: actions/upload-artifact@v2 with: name: bw_${{ env.PACKAGE_VERSION }}_amd64.snap path: ./dist/snap/bw_${{ env.PACKAGE_VERSION }}_amd64.snap - #- name: Snap Logout - # run: snapcraft logout + - name: Publish snap to GitHub + uses: actions/upload-artifact@v2 + with: + name: bw-snap-sha256-${{ env.PACKAGE_VERSION }}.txt + path: ./dist/snap/bw-snap-sha256-${{ env.PACKAGE_VERSION }}.txt + + + # This process seems independent from the others + publish_snap: + name: Publish Snap + runs-on: ubuntu-latest + need: build_snap + if: github.event_name == 'release' + steps: + - name: Checkout repo + uses: actions/checkout@v2 + + - name: Set PACKAGE_VERSION + shell: pwsh + run: | + $env:pkgVersion = (Get-Content -Raw -Path .\package.json | ConvertFrom-Json).version + echo "PACKAGE_VERSION=$env:pkgVersion" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + + - name: Install Snapcraft + uses: samuelmeuli/action-snapcraft@v1 + with: + snapcraft_token: ${{ secrets.SNAP_TOKEN }} + + - name: Download snap + uses: actions/download-artifact@v2 + with: + name: bw_${{ env.PACKAGE_VERSION }}_amd64.snap + path: ./bw_${{ env.PACKAGE_VERSION }}_amd64.snap + + - name: Print environment + run: | + whoami + snapcraft --version + echo "GitHub ref: $GITHUB_REF" + echo "GitHub event: $GITHUB_EVENT" + echo "BW Package Version: $PACKAGE_VERSION" + env: + GITHUB_REF: ${{ github.ref }} + GITHUB_EVENT: ${{ github.event_name }} + + - name: Checksum Snap & Publish Snap + run: snapcraft push ./dist/snap/bw*.snap --release stable + + - name: Snap Logout + run: snapcraft logout # This job is independent: it reruns 'npm run build:prod' From dea6138f90e3e7062b52fde65ccd19941e71bec6 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Mon, 11 Jan 2021 18:01:54 +0000 Subject: [PATCH 67/82] changing snap publish to specific file --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b7d7c59c96..5fc4561f5c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -325,7 +325,7 @@ jobs: GITHUB_EVENT: ${{ github.event_name }} - name: Checksum Snap & Publish Snap - run: snapcraft push ./dist/snap/bw*.snap --release stable + run: snapcraft push ./bw_${{ env.PACKAGE_VERSION }}_amd64.snap --release stable - name: Snap Logout run: snapcraft logout From 94546b89cab24daf498af181949b85f9a4380b4a Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Mon, 11 Jan 2021 18:08:14 +0000 Subject: [PATCH 68/82] fixing a gh typo --- .github/workflows/build.yml | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5fc4561f5c..0143389f81 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -177,7 +177,7 @@ jobs: name: Publish Windows runs-on: windows-latest needs: build - #if: github.event_name == 'release' + if: github.event_name == 'release' steps: - name: Checkout repo uses: actions/checkout@v2 @@ -193,32 +193,28 @@ jobs: name: bitwarden-cli.${{ env.PACKAGE_VERSION }}.nupkg path: ./dist/bitwarden-cli.${{ env.PACKAGE_VERSION }}.nupkg - #- name: Setup Chocolatey - # run: choco apikey --key $env:CHOCO_API_KEY --source https://push.chocolatey.org/ - # env: - # CHOCO_API_KEY: ${{ secrets.CHOCO_API_KEY }} + - name: Setup Chocolatey + run: choco apikey --key $env:CHOCO_API_KEY --source https://push.chocolatey.org/ + env: + CHOCO_API_KEY: ${{ secrets.CHOCO_API_KEY }} - #- name: Publish - # run: | - # .\scripts\choco-update.ps1 -version $env:PACKAGE_VERSION - # Get-ChildItem dist + - name: Publish + run: | + .\scripts\choco-update.ps1 -version $env:PACKAGE_VERSION + Get-ChildItem dist - name: Publish shell: pwsh run: | # In place of ./scripts/choco-update.ps1 cd ./dist - Get-ChildItem - Write-Host "[+] Intead of pushing with choco, we are testing and writing this out" - Write-Host " Nuget Packge: bitwarden-cli.${{ env.PACKAGE_VERSION }}.nupkg" - #choco push + choco push # This process seems independent from the others build_snap: name: Build Snap runs-on: ubuntu-latest - #if: github.event_name == 'release' steps: - name: Checkout repo uses: actions/checkout@v2 @@ -231,8 +227,6 @@ jobs: - name: Install Snapcraft uses: samuelmeuli/action-snapcraft@v1 - #with: - # snapcraft_token: ${{ secrets.SNAP_TOKEN }} - name: Print environment run: | @@ -286,11 +280,10 @@ jobs: path: ./dist/snap/bw-snap-sha256-${{ env.PACKAGE_VERSION }}.txt - # This process seems independent from the others publish_snap: name: Publish Snap runs-on: ubuntu-latest - need: build_snap + needs: build_snap if: github.event_name == 'release' steps: - name: Checkout repo @@ -332,6 +325,7 @@ jobs: # This job is independent: it reruns 'npm run build:prod' + # Could be moved out a level publish_npm: name: Publish NPM runs-on: ubuntu-latest From ffbddc9ddf694537002701d6932bd726f2465eec Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Mon, 11 Jan 2021 18:24:42 +0000 Subject: [PATCH 69/82] removing unneeded workflow --- .github/workflows/exp.yml | 24 ------------------------ 1 file changed, 24 deletions(-) delete mode 100644 .github/workflows/exp.yml diff --git a/.github/workflows/exp.yml b/.github/workflows/exp.yml deleted file mode 100644 index f08c469ec4..0000000000 --- a/.github/workflows/exp.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: Experiment - -on: - workflow_dispatch: - -jobs: - exp: - runs-on: windows-latest - steps: - - name: Checkout repo - uses: actions/checkout@v2 - - - name: Cache Dist - id: cached-dist - uses: actions/cache@v2 - with: - path: dist - key: ${{ runner.os }}-${{ hashFiles('dist/') }} - - - name: Creating test cache - shell: bash - run: | - [ -f dist/test.txt ] && echo "File exists!" - [ ! -f dist/test.txt ] && mkdir dist && echo "this is a test" > dist/test.txt From ac79795e138f142c613d6055db8b8993914c0220 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Mon, 11 Jan 2021 21:16:58 +0000 Subject: [PATCH 70/82] adding the missing execution of the versioninfo script --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0143389f81..70082e5232 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -54,6 +54,7 @@ jobs: if(Test-Path -Path $env:WIN_PKG) { echo "VER_INFO=true" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append } + .\scripts\make-versioninfo.ps1 env: WIN_PKG: C:\Users\appveyor\.pkg-cache\v2.5\fetched-v10.4.1-win-x64 From f65812b52c5994a27c183a76922a8e925a97b68a Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Mon, 11 Jan 2021 21:23:45 +0000 Subject: [PATCH 71/82] adding in missing env var --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 70082e5232..bcb355744b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -49,6 +49,7 @@ jobs: run: | $env:pkgVersion = (Get-Content -Raw -Path .\package.json | ConvertFrom-Json).version echo "PACKAGE_VERSION=$env:pkgVersion" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + echo "WIN_PKG=$env:WIN_PKG" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append echo "version: $env:pkgVersion" if(Test-Path -Path $env:WIN_PKG) { From 65380ea4c560670b251abac6cbfede42488fd0dc Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Tue, 12 Jan 2021 22:02:01 +0000 Subject: [PATCH 72/82] manually adding the pkg-fetch binary --- .github/workflows/build.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bcb355744b..5dbbfb1ef5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -38,6 +38,13 @@ jobs: with: node-version: '10.x' + - name: Install pkg-fetch + run: | + $fetchedUrl = "https://github.com/vercel/pkg-fetch/releases/download/v2.5/uploaded-v2.5-node-v10.4.1-win-x64" + + New-Item -ItemType directory -Path .\.pkg-cache + Invoke-RestMethod -Uri $fetchedUrl -OutFile ".\.pkg-cache\fetched-v10.4.1-win-x64" + - name: Download & Install RH shell: pwsh run: | @@ -57,7 +64,7 @@ jobs: } .\scripts\make-versioninfo.ps1 env: - WIN_PKG: C:\Users\appveyor\.pkg-cache\v2.5\fetched-v10.4.1-win-x64 + WIN_PKG: C:\Users\runneradmin\.pkg-cache\v2.5\fetched-v10.4.1-win-x64 - name: test setting env var run: | From dbd87ddd2ab7737d00a23e80a29a00b2cccb37ab Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Tue, 12 Jan 2021 22:25:03 +0000 Subject: [PATCH 73/82] moving the version info stuff --- .github/workflows/build.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5dbbfb1ef5..09805b41d6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -62,10 +62,13 @@ jobs: if(Test-Path -Path $env:WIN_PKG) { echo "VER_INFO=true" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append } - .\scripts\make-versioninfo.ps1 env: WIN_PKG: C:\Users\runneradmin\.pkg-cache\v2.5\fetched-v10.4.1-win-x64 + - name: Setup Version Info + shell: pwsh + run: .\scripts\make-versioninfo.ps1 + - name: test setting env var run: | echo "version: $env:PACKAGE_VERSION" From 302d07865313706611aa518915b6b4450d64abc3 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Thu, 14 Jan 2021 21:13:17 +0000 Subject: [PATCH 74/82] testing choco install reshack and flipping all of the back slashes to forward slashes --- .github/workflows/build.yml | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 09805b41d6..aef745c39f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -42,19 +42,20 @@ jobs: run: | $fetchedUrl = "https://github.com/vercel/pkg-fetch/releases/download/v2.5/uploaded-v2.5-node-v10.4.1-win-x64" - New-Item -ItemType directory -Path .\.pkg-cache - Invoke-RestMethod -Uri $fetchedUrl -OutFile ".\.pkg-cache\fetched-v10.4.1-win-x64" + New-Item -ItemType directory -Path ./.pkg-cache + Invoke-RestMethod -Uri $fetchedUrl -OutFile "./.pkg-cache/fetched-v10.4.1-win-x64" - name: Download & Install RH shell: pwsh run: | - Invoke-WebRequest -Uri http://www.angusj.com/resourcehacker/resource_hacker.zip -OutFile "resource_hacker.zip" - Expand-Archive -Path resource_hacker.zip -DestinationPath scripts/resource_hacker - echo "D:\a\cli\cli\scripts\resource_hacker" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + choco install reshack + #Invoke-WebRequest -Uri http://www.angusj.com/resourcehacker/resource_hacker.zip -OutFile "resource_hacker.zip" + #Expand-Archive -Path resource_hacker.zip -DestinationPath scripts/resource_hacker + #echo "D:/a/cli/cli/scripts/resource_hacker" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - name: Set PACKAGE_VERSION & VER_INFO run: | - $env:pkgVersion = (Get-Content -Raw -Path .\package.json | ConvertFrom-Json).version + $env:pkgVersion = (Get-Content -Raw -Path ./package.json | ConvertFrom-Json).version echo "PACKAGE_VERSION=$env:pkgVersion" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append echo "WIN_PKG=$env:WIN_PKG" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append echo "version: $env:pkgVersion" @@ -63,11 +64,11 @@ jobs: echo "VER_INFO=true" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append } env: - WIN_PKG: C:\Users\runneradmin\.pkg-cache\v2.5\fetched-v10.4.1-win-x64 + WIN_PKG: C:/Users/runneradmin/.pkg-cache/v2.5/fetched-v10.4.1-win-x64 - name: Setup Version Info shell: pwsh - run: .\scripts\make-versioninfo.ps1 + run: ./scripts/make-versioninfo.ps1 - name: test setting env var run: | @@ -108,11 +109,11 @@ jobs: - name: Package Chocolatey shell: pwsh run: | - Copy-Item -Path stores\chocolatey -Destination dist\chocolatey -Recurse - Copy-Item dist\windows\bw.exe -Destination dist\chocolatey\tools - Copy-Item LICENSE.txt -Destination dist\chocolatey\tools + Copy-Item -Path stores/chocolatey -Destination dist/chocolatey -Recurse + Copy-Item dist/windows/bw.exe -Destination dist/chocolatey/tools + Copy-Item LICENSE.txt -Destination dist/chocolatey/tools - choco pack dist\chocolatey\bitwarden-cli.nuspec --version ${{ env.PACKAGE_VERSION }} --out dist\chocolatey + choco pack dist/chocolatey/bitwarden-cli.nuspec --version ${{ env.PACKAGE_VERSION }} --out dist/chocolatey - name: Zip shell: cmd @@ -196,7 +197,7 @@ jobs: - name: Set PACKAGE_VERSION run: | - $env:pkgVersion = (Get-Content -Raw -Path .\package.json | ConvertFrom-Json).version + $env:pkgVersion = (Get-Content -Raw -Path ./package.json | ConvertFrom-Json).version echo "PACKAGE_VERSION=$env:pkgVersion" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - name: Download Windows Nuget @@ -212,7 +213,7 @@ jobs: - name: Publish run: | - .\scripts\choco-update.ps1 -version $env:PACKAGE_VERSION + ./scripts/choco-update.ps1 -version $env:PACKAGE_VERSION Get-ChildItem dist - name: Publish @@ -234,7 +235,7 @@ jobs: - name: Set PACKAGE_VERSION shell: pwsh run: | - $env:pkgVersion = (Get-Content -Raw -Path .\package.json | ConvertFrom-Json).version + $env:pkgVersion = (Get-Content -Raw -Path ./package.json | ConvertFrom-Json).version echo "PACKAGE_VERSION=$env:pkgVersion" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - name: Install Snapcraft @@ -260,7 +261,7 @@ jobs: cd ./dist/snap snapcraft - sha256sum bw_${{ env.PACKAGE_VERSION }}_amd64.snap | \ + sha256sum bw_${{ env.PACKAGE_VERSION }}_amd64.snap | \ awk '{split($0, a); print a[1]}' > bw-snap-sha256-${{ env.PACKAGE_VERSION }}.txt - name: Install Snap @@ -304,7 +305,7 @@ jobs: - name: Set PACKAGE_VERSION shell: pwsh run: | - $env:pkgVersion = (Get-Content -Raw -Path .\package.json | ConvertFrom-Json).version + $env:pkgVersion = (Get-Content -Raw -Path ./package.json | ConvertFrom-Json).version echo "PACKAGE_VERSION=$env:pkgVersion" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - name: Install Snapcraft From 478bcb327827f8fe7c24f3996def670e9e7ad1b6 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Thu, 14 Jan 2021 21:36:56 +0000 Subject: [PATCH 75/82] remapping the WIN_PKG. The VER_INFO wasn't firing --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index aef745c39f..90023bf8fb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -43,7 +43,7 @@ jobs: $fetchedUrl = "https://github.com/vercel/pkg-fetch/releases/download/v2.5/uploaded-v2.5-node-v10.4.1-win-x64" New-Item -ItemType directory -Path ./.pkg-cache - Invoke-RestMethod -Uri $fetchedUrl -OutFile "./.pkg-cache/fetched-v10.4.1-win-x64" + Invoke-RestMethod -Uri $fetchedUrl -OutFile ".pkg-cache/fetched-v10.4.1-win-x64" - name: Download & Install RH shell: pwsh @@ -64,7 +64,7 @@ jobs: echo "VER_INFO=true" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append } env: - WIN_PKG: C:/Users/runneradmin/.pkg-cache/v2.5/fetched-v10.4.1-win-x64 + WIN_PKG: D:/a/cli/cli/.pkg-cache/v2.5/fetched-v10.4.1-win-x64 - name: Setup Version Info shell: pwsh From 9d3a573e00acb57f0948cc0fcdb7a53deb7b44a4 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Thu, 14 Jan 2021 21:42:25 +0000 Subject: [PATCH 76/82] changing ubuntu runner to ubuntu-18.04 --- .github/workflows/build.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 90023bf8fb..3a89f63397 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,7 +10,7 @@ on: jobs: cloc: - runs-on: ubuntu-latest + runs-on: ubuntu-18.04 steps: - name: Checkout repo uses: actions/checkout@v2 @@ -227,7 +227,7 @@ jobs: # This process seems independent from the others build_snap: name: Build Snap - runs-on: ubuntu-latest + runs-on: ubuntu-18.04 steps: - name: Checkout repo uses: actions/checkout@v2 @@ -295,7 +295,7 @@ jobs: publish_snap: name: Publish Snap - runs-on: ubuntu-latest + runs-on: ubuntu-18.04 needs: build_snap if: github.event_name == 'release' steps: @@ -341,7 +341,7 @@ jobs: # Could be moved out a level publish_npm: name: Publish NPM - runs-on: ubuntu-latest + runs-on: ubuntu-18.04 needs: build if: github.event_name == 'release' steps: From 4bf515200ae6e2abeae219ecd304c99707af7954 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Thu, 14 Jan 2021 21:46:14 +0000 Subject: [PATCH 77/82] switching ubuntu back and removing line continuation --- .github/workflows/build.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3a89f63397..c980f0066b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,7 +10,7 @@ on: jobs: cloc: - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest steps: - name: Checkout repo uses: actions/checkout@v2 @@ -227,7 +227,7 @@ jobs: # This process seems independent from the others build_snap: name: Build Snap - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest steps: - name: Checkout repo uses: actions/checkout@v2 @@ -261,8 +261,7 @@ jobs: cd ./dist/snap snapcraft - sha256sum bw_${{ env.PACKAGE_VERSION }}_amd64.snap | \ - awk '{split($0, a); print a[1]}' > bw-snap-sha256-${{ env.PACKAGE_VERSION }}.txt + sha256sum bw_${{ env.PACKAGE_VERSION }}_amd64.snap | awk '{split($0, a); print a[1]}' > bw-snap-sha256-${{ env.PACKAGE_VERSION }}.txt - name: Install Snap run: sudo snap install ./dist/snap/bw*.snap --dangerous @@ -295,7 +294,7 @@ jobs: publish_snap: name: Publish Snap - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest needs: build_snap if: github.event_name == 'release' steps: @@ -341,7 +340,7 @@ jobs: # Could be moved out a level publish_npm: name: Publish NPM - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest needs: build if: github.event_name == 'release' steps: From e2cede1d3ec2744a01109e5f201a2c11d12173b8 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Thu, 14 Jan 2021 21:59:43 +0000 Subject: [PATCH 78/82] debugging WIN_PKG --- .github/workflows/build.yml | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c980f0066b..1f4ec907a1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -42,7 +42,7 @@ jobs: run: | $fetchedUrl = "https://github.com/vercel/pkg-fetch/releases/download/v2.5/uploaded-v2.5-node-v10.4.1-win-x64" - New-Item -ItemType directory -Path ./.pkg-cache + New-Item -ItemType directory -Path .pkg-cache Invoke-RestMethod -Uri $fetchedUrl -OutFile ".pkg-cache/fetched-v10.4.1-win-x64" - name: Download & Install RH @@ -61,26 +61,20 @@ jobs: echo "version: $env:pkgVersion" if(Test-Path -Path $env:WIN_PKG) { + Write-Host "Path exists $env:WIN_PKG" echo "VER_INFO=true" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append } env: - WIN_PKG: D:/a/cli/cli/.pkg-cache/v2.5/fetched-v10.4.1-win-x64 + WIN_PKG: .pkg-cache/v2.5/fetched-v10.4.1-win-x64 - name: Setup Version Info shell: pwsh run: ./scripts/make-versioninfo.ps1 - - name: test setting env var - run: | - echo "version: $env:PACKAGE_VERSION" - - if($env:PACKAGE_VERSION -eq "") { - Throw "test env failed." - } - - name: ResourceHacker shell: cmd run: | + echo "ver_info: %VER_INFO%" if defined VER_INFO ResourceHacker -open %WIN_PKG% -save %WIN_PKG% -action delete -mask ICONGROUP,1, if defined VER_INFO ResourceHacker -open version-info.rc -save version-info.res -action compile if defined VER_INFO ResourceHacker -open %WIN_PKG% -save %WIN_PKG% -action addoverwrite -resource version-info.res From c575c7ce9a71ebb031a54620e6e07cb0c287c42f Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Thu, 14 Jan 2021 22:51:39 +0000 Subject: [PATCH 79/82] debugging paths were added --- .github/workflows/build.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1f4ec907a1..f67a066ba7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -44,6 +44,8 @@ jobs: New-Item -ItemType directory -Path .pkg-cache Invoke-RestMethod -Uri $fetchedUrl -OutFile ".pkg-cache/fetched-v10.4.1-win-x64" + dir + dir .pkg-cache - name: Download & Install RH shell: pwsh @@ -60,10 +62,13 @@ jobs: echo "WIN_PKG=$env:WIN_PKG" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append echo "version: $env:pkgVersion" + dir if(Test-Path -Path $env:WIN_PKG) { Write-Host "Path exists $env:WIN_PKG" echo "VER_INFO=true" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append } + + exit 1 env: WIN_PKG: .pkg-cache/v2.5/fetched-v10.4.1-win-x64 @@ -221,6 +226,7 @@ jobs: # This process seems independent from the others build_snap: name: Build Snap + if: false runs-on: ubuntu-latest steps: - name: Checkout repo From d6d12b8c9cae2f7acb9f25911412f502faa55ea2 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Wed, 27 Jan 2021 19:15:29 +0000 Subject: [PATCH 80/82] reworking gh actions into the build/release/deploy model --- .github/workflows/build.yml | 195 +++++------------------ .github/workflows/deploy.yml | 121 ++++++++++++++ .github/workflows/release.yml | 290 ++++++++++++++++++++++++++++++++++ package.json | 4 +- 4 files changed, 450 insertions(+), 160 deletions(-) create mode 100644 .github/workflows/deploy.yml create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f67a066ba7..8d610e1aa1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,9 +4,6 @@ on: push: branches-ignore: - 'l10n_master' - release: - types: - - published jobs: cloc: @@ -23,7 +20,7 @@ jobs: - name: Print lines of code run: cloc --include-lang TypeScript,JavaScript --vcs git - build: + windows: name: Build CLI runs-on: windows-latest steps: @@ -31,58 +28,47 @@ jobs: uses: actions/checkout@v2 - name: Setup Windows builder - run: choco install checksum --no-progress + run: | + choco install checksum --no-progress + choco install reshack --no-progress - name: Set up Node uses: actions/setup-node@v1 with: node-version: '10.x' - - name: Install pkg-fetch - run: | - $fetchedUrl = "https://github.com/vercel/pkg-fetch/releases/download/v2.5/uploaded-v2.5-node-v10.4.1-win-x64" - - New-Item -ItemType directory -Path .pkg-cache - Invoke-RestMethod -Uri $fetchedUrl -OutFile ".pkg-cache/fetched-v10.4.1-win-x64" - dir - dir .pkg-cache - - - name: Download & Install RH - shell: pwsh - run: | - choco install reshack - #Invoke-WebRequest -Uri http://www.angusj.com/resourcehacker/resource_hacker.zip -OutFile "resource_hacker.zip" - #Expand-Archive -Path resource_hacker.zip -DestinationPath scripts/resource_hacker - #echo "D:/a/cli/cli/scripts/resource_hacker" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - - name: Set PACKAGE_VERSION & VER_INFO run: | - $env:pkgVersion = (Get-Content -Raw -Path ./package.json | ConvertFrom-Json).version + $env:pkgVersion = (Get-Content -Raw -Path .\src\package.json | ConvertFrom-Json).version echo "PACKAGE_VERSION=$env:pkgVersion" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append echo "WIN_PKG=$env:WIN_PKG" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append echo "version: $env:pkgVersion" - - dir - if(Test-Path -Path $env:WIN_PKG) { - Write-Host "Path exists $env:WIN_PKG" - echo "VER_INFO=true" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - } - - exit 1 env: - WIN_PKG: .pkg-cache/v2.5/fetched-v10.4.1-win-x64 + WIN_PKG: C:\Users\runneradmin\.pkg-cache\v2.5\fetched-v10.4.1-win-x64 + + - name: get pkg-fetch + shell: pwsh + run: | + cd $HOME + $fetchedUrl = "https://github.com/vercel/pkg-fetch/releases/download/v2.5/uploaded-v2.5-node-v10.4.1-win-x64" + + New-Item -ItemType directory -Path .\.pkg-cache + New-Item -ItemType directory -Path .\.pkg-cache\v2.5 + Invoke-RestMethod -Uri $fetchedUrl -OutFile ".\.pkg-cache\v2.5\fetched-v10.4.1-win-x64" + env: + WIN_PKG: C:\Users\runneradmin\.pkg-cache\v2.5\fetched-v10.4.1-win-x64 - name: Setup Version Info shell: pwsh run: ./scripts/make-versioninfo.ps1 - - name: ResourceHacker + - name: Resource Hacker shell: cmd run: | - echo "ver_info: %VER_INFO%" - if defined VER_INFO ResourceHacker -open %WIN_PKG% -save %WIN_PKG% -action delete -mask ICONGROUP,1, - if defined VER_INFO ResourceHacker -open version-info.rc -save version-info.res -action compile - if defined VER_INFO ResourceHacker -open %WIN_PKG% -save %WIN_PKG% -action addoverwrite -resource version-info.res + set PATH=%PATH%;C:\Program Files (x86)\Resource Hacker + ResourceHacker -open %WIN_PKG% -save %WIN_PKG% -action delete -mask ICONGROUP,1, + ResourceHacker -open version-info.rc -save version-info.res -action compile + ResourceHacker -open %WIN_PKG% -save %WIN_PKG% -action addoverwrite -resource version-info.res - name: Install run: npm install @@ -90,20 +76,8 @@ jobs: - name: Setup sub-module run: npm run sub:init - - name: Build - run: npm run build:prod - - - name: Clean Build - run: npm run clean - - - name: Package Windows - run: npm run package:win - - - name: Package Mac - run: npm run package:mac - - - name: Package Linux - run: npm run package:lin + - name: Build & Package + run: npm run dist - name: Package Chocolatey shell: pwsh @@ -134,6 +108,7 @@ jobs: } - name: Create checksums + if: github.ref == 'refs/heads/master' run: | checksum -f="./dist/bw-windows-${env:PACKAGE_VERSION}.zip" ` -t sha256 | Out-File -Encoding ASCII ./dist/bw-windows-sha256-${env:PACKAGE_VERSION}.txt @@ -143,88 +118,56 @@ jobs: -t sha256 | Out-File -Encoding ASCII ./dist/bw-linux-sha256-${env:PACKAGE_VERSION}.txt - name: Publish windows zip to GitHub + if: github.ref == 'refs/heads/master' uses: actions/upload-artifact@v2 with: name: bw-windows-${{ env.PACKAGE_VERSION }}.zip path: ./dist/bw-windows-${{ env.PACKAGE_VERSION }}.zip - name: Publish windows checksum to GitHub + if: github.ref == 'refs/heads/master' uses: actions/upload-artifact@v2 with: name: bw-windows-sha256-${{ env.PACKAGE_VERSION }}.txt path: ./dist/bw-windows-sha256-${{ env.PACKAGE_VERSION }}.txt - name: Publish macos zip to GitHub + if: github.ref == 'refs/heads/master' uses: actions/upload-artifact@v2 with: name: bw-macos-${{ env.PACKAGE_VERSION }}.zip path: ./dist/bw-macos-${{ env.PACKAGE_VERSION }}.zip - name: Publish macos checksum to GitHub + if: github.ref == 'refs/heads/master' uses: actions/upload-artifact@v2 with: name: bw-macos-sha256-${{ env.PACKAGE_VERSION }}.txt path: ./dist/bw-macos-sha256-${{ env.PACKAGE_VERSION }}.txt - name: Publish linux zip to GitHub + if: github.ref == 'refs/heads/master' uses: actions/upload-artifact@v2 with: name: bw-linux-${{ env.PACKAGE_VERSION }}.zip path: ./dist/bw-linux-${{ env.PACKAGE_VERSION }}.zip - name: Publish linux checksum to GitHub + if: github.ref == 'refs/heads/master' uses: actions/upload-artifact@v2 with: name: bw-linux-sha256-${{ env.PACKAGE_VERSION }}.txt path: ./dist/bw-linux-sha256-${{ env.PACKAGE_VERSION }}.txt - name: Publish Chocolatey CLI + if: github.ref == 'refs/heads/master' uses: actions/upload-artifact@v2 with: name: bitwarden-cli.${{ env.PACKAGE_VERSION }}.nupkg path: ./dist/chocolatey/bitwarden-cli.${{ env.PACKAGE_VERSION }}.nupkg - publish_windows: - name: Publish Windows - runs-on: windows-latest - needs: build - if: github.event_name == 'release' - steps: - - name: Checkout repo - uses: actions/checkout@v2 - - - name: Set PACKAGE_VERSION - run: | - $env:pkgVersion = (Get-Content -Raw -Path ./package.json | ConvertFrom-Json).version - echo "PACKAGE_VERSION=$env:pkgVersion" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - - - name: Download Windows Nuget - uses: actions/download-artifact@v2 - with: - name: bitwarden-cli.${{ env.PACKAGE_VERSION }}.nupkg - path: ./dist/bitwarden-cli.${{ env.PACKAGE_VERSION }}.nupkg - - - name: Setup Chocolatey - run: choco apikey --key $env:CHOCO_API_KEY --source https://push.chocolatey.org/ - env: - CHOCO_API_KEY: ${{ secrets.CHOCO_API_KEY }} - - - name: Publish - run: | - ./scripts/choco-update.ps1 -version $env:PACKAGE_VERSION - Get-ChildItem dist - - - name: Publish - shell: pwsh - run: | - # In place of ./scripts/choco-update.ps1 - cd ./dist - choco push - - - # This process seems independent from the others - build_snap: + linux: name: Build Snap if: false runs-on: ubuntu-latest @@ -280,79 +223,15 @@ jobs: sudo snap remove bw - name: Publish snap to GitHub + if: github.ref == 'refs/heads/master' uses: actions/upload-artifact@v2 with: name: bw_${{ env.PACKAGE_VERSION }}_amd64.snap path: ./dist/snap/bw_${{ env.PACKAGE_VERSION }}_amd64.snap - - name: Publish snap to GitHub + - name: Publish snap checksum to GitHub + if: github.ref == 'refs/heads/master' uses: actions/upload-artifact@v2 with: name: bw-snap-sha256-${{ env.PACKAGE_VERSION }}.txt path: ./dist/snap/bw-snap-sha256-${{ env.PACKAGE_VERSION }}.txt - - - publish_snap: - name: Publish Snap - runs-on: ubuntu-latest - needs: build_snap - if: github.event_name == 'release' - steps: - - name: Checkout repo - uses: actions/checkout@v2 - - - name: Set PACKAGE_VERSION - shell: pwsh - run: | - $env:pkgVersion = (Get-Content -Raw -Path ./package.json | ConvertFrom-Json).version - echo "PACKAGE_VERSION=$env:pkgVersion" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - - - name: Install Snapcraft - uses: samuelmeuli/action-snapcraft@v1 - with: - snapcraft_token: ${{ secrets.SNAP_TOKEN }} - - - name: Download snap - uses: actions/download-artifact@v2 - with: - name: bw_${{ env.PACKAGE_VERSION }}_amd64.snap - path: ./bw_${{ env.PACKAGE_VERSION }}_amd64.snap - - - name: Print environment - run: | - whoami - snapcraft --version - echo "GitHub ref: $GITHUB_REF" - echo "GitHub event: $GITHUB_EVENT" - echo "BW Package Version: $PACKAGE_VERSION" - env: - GITHUB_REF: ${{ github.ref }} - GITHUB_EVENT: ${{ github.event_name }} - - - name: Checksum Snap & Publish Snap - run: snapcraft push ./bw_${{ env.PACKAGE_VERSION }}_amd64.snap --release stable - - - name: Snap Logout - run: snapcraft logout - - - # This job is independent: it reruns 'npm run build:prod' - # Could be moved out a level - publish_npm: - name: Publish NPM - runs-on: ubuntu-latest - needs: build - if: github.event_name == 'release' - steps: - - name: Checkout repo - uses: actions/checkout@v2 - - - name: Setup NPM - shell: pwsh - run: | - "//registry.npmjs.org/:_authToken=${env:NPM_TOKEN}" | Out-File ".npmrc" -Encoding UTF8 - env: - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - - - name: Publish NPM - run: npm run publish:npm diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000000..b9a664989c --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,121 @@ +name: Deploy + +on: + release: + types: + - prereleased + workflow_dispatch: + inputs: + + +jobs: + setup: + runs-on: ubuntu-latest + outputs: + package_version: ${{ steps.get_pkg_version.outputs.package_version }} + tag_version: ${{ steps.get_pkg_version.outputs.tag_version }} + steps: + - name: Checkout Repo + uses: actions/checkout@v2 + + - name: Get package version + id: get_pkg_version + run: | + TAG_VERSION=$(echo ${{ github.ref }} | cut -d "/" -f 3) + PKG_VERSION=${TAG_VERSION:1} + + echo "::set-output name=package_version::$PKG_VERSION" + echo "::set-output name=tag_version::$TAG_VERSION" + + + snap: + name: Publish Snap + runs-on: ubuntu-latest + needs: setup + steps: + - name: Checkout repo + uses: actions/checkout@v2 + + - name: Install Snapcraft + uses: samuelmeuli/action-snapcraft@v1 + #with: + # snapcraft_token: ${{ secrets.SNAP_TOKEN }} + + - name: Get snap release asset + uses: dsaltares/fetch-gh-release-asset@0.0.5 + with: + version: tags/${{ env.TAG_VERSION }} + file: bw_${{ env.PKG_VERSION }}_amd64.snap + env: + PKG_VERSION: ${{ needs.setup.outputs.package_version }} + TAG_VERSION: ${{ needs.setup.outputs.tag_version }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: move assets + run: | + echo "Hopefully this is temporary until release 0.0.6 of the fetch-gh-release-asset is released" + mkdir dist + mv bw_${{ env.PKG_VERSION }}_amd64.snap -t dist + + - name: test + run: ls -alht dist + + #- name: Publish Snap & logout + # run: | + # snapcraft push ./dist/bw_${{ env.PACKAGE_VERSION }}_amd64.snap --release stable + # snapcraft logout + + + choco: + name: Publish Choco + runs-on: windows-latest + needs: setup + steps: + - name: Checkout repo + uses: actions/checkout@v2 + + - name: Setup Chocolatey + run: choco apikey --key $env:CHOCO_API_KEY --source https://push.chocolatey.org/ + env: + CHOCO_API_KEY: ${{ secrets.CHOCO_API_KEY }} + + - name: Get choco release asset + uses: dsaltares/fetch-gh-release-asset@0.0.5 + with: + version: tags/${{ env.TAG_VERSION }} + file: bitwarden.${{ env.PKG_VERSION }}.nupkg + env: + PKG_VERSION: ${{ needs.setup.outputs.package_version }} + TAG_VERSION: ${{ needs.setup.outputs.tag_version }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Push to Chocolatey + shell: pwsh + run: | + # In place of ./scripts/choco-update.ps1 + New-Item -ItemType directory -Path ./dist + Move-Item -Path bitwarden.${{ env.PKG_VERSION }}.nupkg -Destination ./dist + cd ./dist + #choco push + + - name: test + run: ls -atlh dist + + + npm: + name: Publish NPM + if: false + runs-on: ubuntu-latest + steps: + - name: Checkout repo + uses: actions/checkout@v2 + + - name: Setup NPM + shell: pwsh + run: | + "//registry.npmjs.org/:_authToken=${env:NPM_TOKEN}" | Out-File ".npmrc" -Encoding UTF8 + env: + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + + - name: Publish NPM + run: npm run publish:npm diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000000..42cc021460 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,290 @@ +name: Release + +on: + workflow_dispatch: + inputs: + release_tag_name_input: + description: "Release Tag Name " + required: true + + +jobs: + setup: + runs-on: ubuntu-latest + outputs: + release_upload_url: ${{ steps.create_release.outputs.upload_url }} + steps: + - name: Checkout repo + uses: actions/checkout@v2 + + - name: Create Release Vars + id: create_tags + run: | + case "${RELEASE_TAG_NAME_INPUT:0:1}" in + v) + echo "RELEASE_NAME=${RELEASE_TAG_NAME_INPUT:1}" >> $GITHUB_ENV + echo "RELEASE_TAG_NAME=$RELEASE_TAG_NAME_INPUT" >> $GITHUB_ENV + ;; + [0-9]) + echo "RELEASE_NAME=$RELEASE_TAG_NAME_INPUT" >> $GITHUB_ENV + echo "RELEASE_TAG_NAME=v$RELEASE_TAG_NAME_INPUT" >> $GITHUB_ENV + ;; + *) + exit 1 + ;; + esac + env: + RELEASE_TAG_NAME_INPUT: ${{ github.event.inputs.release_tag_name_input }} + + - name: Create Draft Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ env.RELEASE_TAG_NAME }} + release_name: ${{ env.RELEASE_NAME }} + draft: true + prerelease: false + + + windows: + name: Build CLI + runs-on: windows-latest + needs: setup + steps: + - name: Checkout repo + uses: actions/checkout@v2 + + - name: Setup Windows builder + run: | + choco install checksum --no-progress + choco install reshack --no-progress + + - name: Set up Node + uses: actions/setup-node@v1 + with: + node-version: '10.x' + + - name: Set PACKAGE_VERSION & VER_INFO + run: | + $env:pkgVersion = (Get-Content -Raw -Path .\src\package.json | ConvertFrom-Json).version + echo "PACKAGE_VERSION=$env:pkgVersion" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + echo "WIN_PKG=$env:WIN_PKG" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + echo "version: $env:pkgVersion" + env: + WIN_PKG: C:\Users\runneradmin\.pkg-cache\v2.5\fetched-v10.4.1-win-x64 + + - name: get pkg-fetch + shell: pwsh + run: | + cd $HOME + $fetchedUrl = "https://github.com/vercel/pkg-fetch/releases/download/v2.5/uploaded-v2.5-node-v10.4.1-win-x64" + + New-Item -ItemType directory -Path .\.pkg-cache + New-Item -ItemType directory -Path .\.pkg-cache\v2.5 + Invoke-RestMethod -Uri $fetchedUrl -OutFile ".\.pkg-cache\v2.5\fetched-v10.4.1-win-x64" + env: + WIN_PKG: C:\Users\runneradmin\.pkg-cache\v2.5\fetched-v10.4.1-win-x64 + + - name: Setup Version Info + shell: pwsh + run: ./scripts/make-versioninfo.ps1 + + - name: Resource Hacker + shell: cmd + run: | + set PATH=%PATH%;C:\Program Files (x86)\Resource Hacker + ResourceHacker -open %WIN_PKG% -save %WIN_PKG% -action delete -mask ICONGROUP,1, + ResourceHacker -open version-info.rc -save version-info.res -action compile + ResourceHacker -open %WIN_PKG% -save %WIN_PKG% -action addoverwrite -resource version-info.res + + - name: Install + run: npm install + + - name: Setup sub-module + run: npm run sub:init + + - name: Build & Package + run: npm run dist + + - name: Package Chocolatey + shell: pwsh + run: | + Copy-Item -Path stores/chocolatey -Destination dist/chocolatey -Recurse + Copy-Item dist/windows/bw.exe -Destination dist/chocolatey/tools + Copy-Item LICENSE.txt -Destination dist/chocolatey/tools + + choco pack dist/chocolatey/bitwarden-cli.nuspec --version ${{ env.PACKAGE_VERSION }} --out dist/chocolatey + + - name: Zip + shell: cmd + run: | + 7z a ./dist/bw-windows-%PACKAGE_VERSION%.zip ./dist/windows/bw.exe + 7z a ./dist/bw-macos-%PACKAGE_VERSION%.zip ./dist/macos/bw + 7z a ./dist/bw-linux-%PACKAGE_VERSION%.zip ./dist/linux/bw + + - name: Version Test + run: | + dir ./dist/ + Expand-Archive -Path "./dist/bw-windows-${env:PACKAGE_VERSION}.zip" -DestinationPath "./test/windows" + $testVersion = Invoke-Expression '& ./test/windows/bw.exe -v' + + echo "version: $env:PACKAGE_VERSION" + echo "testVersion: $testVersion" + if($testVersion -ne $env:PACKAGE_VERSION) { + Throw "Version test failed." + } + + - name: Create checksums + run: | + checksum -f="./dist/bw-windows-${env:PACKAGE_VERSION}.zip" ` + -t sha256 | Out-File -Encoding ASCII ./dist/bw-windows-sha256-${env:PACKAGE_VERSION}.txt + checksum -f="./dist/bw-macos-${env:PACKAGE_VERSION}.zip" ` + -t sha256 | Out-File -Encoding ASCII ./dist/bw-macos-sha256-${env:PACKAGE_VERSION}.txt + checksum -f="./dist/bw-linux-${env:PACKAGE_VERSION}.zip" ` + -t sha256 | Out-File -Encoding ASCII ./dist/bw-linux-sha256-${env:PACKAGE_VERSION}.txt + + - name: upload windows zip release asset + id: upload-windows-zip + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ needs.setup.outputs.release_upload_url }} + asset_name: bw-windows-${{ env.PACKAGE_VERSION }}.zip + asset_path: ./dist/bw-windows-${{ env.PACKAGE_VERSION }}.zip + + - name: upload macos zip release asset + id: upload-macos-zip + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ needs.setup.outputs.release_upload_url }} + asset_name: bw-macos-${{ env.PACKAGE_VERSION }}.zip + asset_path: ./dist/bw-macos-${{ env.PACKAGE_VERSION }}.zip + + - name: upload linux zip release asset + id: upload-linux-zip + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ needs.setup.outputs.release_upload_url }} + asset_name: bw-linux-${{ env.PACKAGE_VERSION }}.zip + asset_path: ./dist/bw-linux-${{ env.PACKAGE_VERSION }}.zip + + - name: Upload windows checksum release asset + id: upload-windows-checksum + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ needs.setup.outputs.release_upload_url }} + asset_name: bw-windows-sha256-${{ env.PACKAGE_VERSION }}.txt + asset_path: ./dist/bw-windows-sha256-${{ env.PACKAGE_VERSION }}.txt + + - name: Upload macos checksum release asset + id: upload-macos-checksum + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ needs.setup.outputs.release_upload_url }} + asset_name: bw-macos-sha256-${{ env.PACKAGE_VERSION }}.txt + asset_path: ./dist/bw-macos-sha256-${{ env.PACKAGE_VERSION }}.txt + + - name: Upload linux checksum release asset + id: upload-linux-checksum + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ needs.setup.outputs.release_upload_url }} + asset_name: bw-linux-sha256-${{ env.PACKAGE_VERSION }}.txt + asset_path: ./dist/bw-linux-sha256-${{ env.PACKAGE_VERSION }}.txt + + - name: Upload chocolatey nupkg release asset + id: upload-choco-nupkg + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ needs.setup.outputs.release_upload_url }} + asset_name: bitwarden-cli.${{ env.PACKAGE_VERSION }}.nupkg + asset_path: ./dist/chocolatey/bitwarden-cli.${{ env.PACKAGE_VERSION }}.nupkg + + + linux: + name: Publish Snap + runs-on: ubuntu-latest + need: setup + steps: + - name: Checkout repo + uses: actions/checkout@v2 + + - name: Set PACKAGE_VERSION + shell: pwsh + run: | + $env:pkgVersion = (Get-Content -Raw -Path ./package.json | ConvertFrom-Json).version + echo "PACKAGE_VERSION=$env:pkgVersion" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + + - name: Install Snapcraft + uses: samuelmeuli/action-snapcraft@v1 + + - name: Print environment + run: | + whoami + snapcraft --version + echo "GitHub ref: $GITHUB_REF" + echo "GitHub event: $GITHUB_EVENT" + echo "BW Package Version: $PACKAGE_VERSION" + env: + GITHUB_REF: ${{ github.ref }} + GITHUB_EVENT: ${{ github.event_name }} + + - name: Build Snap Package + run: | + mkdir ./dist + cp -r ./stores/snap -t ./dist + sed -i s/__version__/${{ env.PACKAGE_VERSION }}/g ./dist/snap/snapcraft.yaml + + cd ./dist/snap + snapcraft + + sha256sum bw_${{ env.PACKAGE_VERSION }}_amd64.snap | awk '{split($0, a); print a[1]}' > bw-snap-sha256-${{ env.PACKAGE_VERSION }}.txt + + - name: Install Snap + run: sudo snap install ./dist/snap/bw*.snap --dangerous + + - name: Test Snap + shell: pwsh + run: | + $testVersion = Invoke-Expression '& bw -v' + if($testVersion -ne $env:PACKAGE_VERSION) { + Throw "Version test failed." + } + + - name: Cleanup Test & Update Snap for Publish + shell: pwsh + run: | + sudo snap remove bw + + - name: Upload snap release asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ needs.setup.outputs.release_upload_url }} + asset_name: bw_${{ env.PACKAGE_VERSION }}_amd64.snap + asset_path: ./dist/snap/bw_${{ env.PACKAGE_VERSION }}_amd64.snap + + - name: Upload snap checksum release asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ needs.setup.outputs.release_upload_url }} + asset_name: bw-snap-sha256-${{ env.PACKAGE_VERSION }}.txt + asset_path: ./dist/snap/bw-snap-sha256-${{ env.PACKAGE_VERSION }}.txt diff --git a/package.json b/package.json index 7c6f203615..dbe309d52d 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@bitwarden/cli", "description": "A secure and free password manager for all of your devices.", - "version": "1.13.3", + "version": "1.13.4", "keywords": [ "bitwarden", "password", @@ -13,7 +13,7 @@ "homepage": "https://bitwarden.com", "repository": { "type": "git", - "url": "https://github.com/bitwarden/cli" + "url": "https://github.com/joseph-flinn/cli" }, "license": "GPL-3.0", "scripts": { From 4130868524d3250a976981dd481317e095f0893f Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Wed, 27 Jan 2021 19:24:11 +0000 Subject: [PATCH 81/82] fixing the pkg version code --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8d610e1aa1..e7608ed9e4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,4 @@ -name: "Build & Publish" +name: Build on: push: @@ -39,7 +39,7 @@ jobs: - name: Set PACKAGE_VERSION & VER_INFO run: | - $env:pkgVersion = (Get-Content -Raw -Path .\src\package.json | ConvertFrom-Json).version + $env:pkgVersion = (Get-Content -Raw -Path .\package.json | ConvertFrom-Json).version echo "PACKAGE_VERSION=$env:pkgVersion" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append echo "WIN_PKG=$env:WIN_PKG" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append echo "version: $env:pkgVersion" From d28b03dcf1ce0115b46307fe62af82845bae4f08 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Wed, 27 Jan 2021 19:48:08 +0000 Subject: [PATCH 82/82] enabling linux build --- .github/workflows/build.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e7608ed9e4..81efca57a0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -169,7 +169,6 @@ jobs: linux: name: Build Snap - if: false runs-on: ubuntu-latest steps: - name: Checkout repo