From 336c41c054f64dba73588c39dccbaaa242cbb954 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Mon, 21 Dec 2020 23:44:29 +0000 Subject: [PATCH 001/145] initial commit of the new GH Actions workflow --- .github/workflows/build.yml | 168 ++++++++++++++++++++++++++++++++++++ 1 file changed, 168 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000000..4e4028a3b0 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,168 @@ +name: build & publish + +on: + # push: + # branches-ignore: + # - 'l10n_master' + # release: + # types: + # - published + workflow_dispatch: + + +jobs: + cloc: + runs-on: ubuntu-latest + steps: + - name: Checkout repo + uses: actions/checkout@v2 + + - name: Set up cloc + run: | + apt update + apt -y install cloc + + - name: Print lines of code + run: cloc --include-lang TypeScript,JavaScript,HTML,Sass,CSS --vcs git + + + build: + name: Build CLI + 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: Setup & Build + run: | + npm install + npm sub:init + npm dist + + - 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: | + Expand-Archive -Path "./dist/bw-windows-${env:PACKAGE_VERSION}.zip" -DestinationPath "./test/windows" + $testVersion = Invoke-Expression '& ./test/windows/bw.exe -v' + if($testVersion -ne $env:PACKAGE_VERSION) { + Throw "Version test failed." + } + + - name: Package & 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" ` + -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: Publish to GitHub + run: | + Write-Host "" + Write-Host .\dist\bw-windows-${env:PACKAGE_VERSION}.zip + Write-Host .\dist\bw-macos-${env:PACKAGE_VERSION}.zip + Write-Host .\dist\bw-linux-${env:PACKAGE_VERSION}.zip + Write-Host .\dist\bw-windows-sha256-${env:PACKAGE_VERSION}.txt + Write-Host .\dist\bw-macos-sha256-${env:PACKAGE_VERSION}.txt + Write-Host .\dist\bw-linux-sha256-${env:PACKAGE_VERSION}.txt + Write-Host .\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: 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 + + + publish_snap: + name: Publish Snap + runs-on: ubuntu-latest + needs: build + if: github.event_name == 'release' + steps: + - name: Checkout repo + uses: actions/checkout@v2 + + - name: Install Snapcraft + uses: samuelmeuli/action-snapcraft@v1 + with: + snapcraft_token: ${{ secrets.SNAP_TOKEN }} + + - name: Print environment + run: | + whoami + snapcraft --version + echo "GitHub ref: $GITHUB_REF" + echo "GitHub event: $GITHUB_EVENT" + env: + GITHUB_REF: ${{ github.ref }} + GITHUB_EVENT: ${{ github.event_name }} + + - name: Install Snap + shell: pwsh + run: | + ./scripts/snap-build.ps1 -version $env:PACKAGE_VERSION + 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: | + snap remove bw + ./scripts/snap-update.ps1 + + - name: Publish + shell: pwsh + run: | + echo "" + echo "./dist/snap/bw_${PACKAGE_VERSION}_amd64.snap" + + - name: Snap Logout + run: snapcraft logout + + + publish_npm: + name: Publish NPM + runs-on: ubuntu-latest + needs: build + if: github.event_name == 'release' + steps: + - 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 From 38d27feefa28539f91fc40ac66b9b50a545d0df9 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Mon, 21 Dec 2020 23:46:44 +0000 Subject: [PATCH 002/145] trying a fix for the yaml syntax error --- .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 4e4028a3b0..a212351b16 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -160,7 +160,8 @@ jobs: steps: - name: Setup NPM shell: pwsh - run: "//registry.npmjs.org/:_authToken=${env:NPM_TOKEN}" | Out-File ".npmrc" -Encoding UTF8 + run: | + "//registry.npmjs.org/:_authToken=${env:NPM_TOKEN}" | Out-File ".npmrc" -Encoding UTF8 env: NPM_TOKEN: ${{ secrets.NPM_TOKEN }} From 7f2fab46b198da835b3e0715bcaabd8d04749344 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Mon, 21 Dec 2020 23:49:13 +0000 Subject: [PATCH 003/145] removing the manual trigger thing --- .github/workflows/build.yml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a212351b16..045c4dc54c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,13 +1,12 @@ name: build & publish on: - # push: - # branches-ignore: - # - 'l10n_master' - # release: - # types: - # - published - workflow_dispatch: + push: + branches-ignore: + - 'l10n_master' + release: + types: + - published jobs: From 17d33ba28878ead46c61cb1a4588b8bfc65f3b37 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Mon, 21 Dec 2020 23:53:41 +0000 Subject: [PATCH 004/145] fixing sudo issue. Splitting out the npm install => npm dist --- .github/workflows/build.yml | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 045c4dc54c..29e72bddad 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,8 +18,8 @@ jobs: - name: Set up cloc run: | - apt update - apt -y install cloc + sudo apt update + sudo apt -y install cloc - name: Print lines of code run: cloc --include-lang TypeScript,JavaScript,HTML,Sass,CSS --vcs git @@ -37,11 +37,14 @@ jobs: with: node-version: '10.x' - - name: Setup & Build - run: | - npm install - npm sub:init - npm dist + - name: Install + run: npm install + + - name: Setup sub-module + run: npm sub:init + + - name: Build + run: npm dist - name: Zip shell: cmd From a6b2112e226551c76f23f06066e250587f15f0f7 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Tue, 22 Dec 2020 17:44:53 +0000 Subject: [PATCH 005/145] fixing the npm scripts --- .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 29e72bddad..419b7bf236 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -41,10 +41,10 @@ jobs: run: npm install - name: Setup sub-module - run: npm sub:init + run: npm run sub:init - name: Build - run: npm dist + run: npm run dist - name: Zip shell: cmd From e1aaca8a178333ae0b86197cfda7f887e58cd06d Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Tue, 22 Dec 2020 21:23:15 +0000 Subject: [PATCH 006/145] adding PACKAGE_VERSION via an env file --- .github/workflows/build.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 419b7bf236..c19ed490f6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -37,6 +37,11 @@ jobs: with: node-version: '10.x' + - 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 run: npm install From ae8a1968372317312edb7fa58e8d1425b94a95c8 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Tue, 22 Dec 2020 21:45:05 +0000 Subject: [PATCH 007/145] debugging envs --- .github/workflows/build.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c19ed490f6..4461575fd9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -60,8 +60,12 @@ jobs: - 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: $env:testVersion" if($testVersion -ne $env:PACKAGE_VERSION) { Throw "Version test failed." } From f574253aa604ad930b9ac2a1c1ba095045629148 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Tue, 22 Dec 2020 22:12:55 +0000 Subject: [PATCH 008/145] testing env --- .github/workflows/build.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4461575fd9..4f7c8768f8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -41,6 +41,15 @@ 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 "version: $pkgVersion" + + - name: test setting env var + run: | + echo "version: $PACKAGE_VERSION" + + if($PACKAGE_VERSION -eq "") { + Throw "test env failed." + } - name: Install run: npm install From 9d965171becd1cba9c91b50a70d4c48108894c09 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Tue, 22 Dec 2020 22:16:35 +0000 Subject: [PATCH 009/145] trying pwsh env syntax...'cause you know....it is a pwsh shell --- .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 4f7c8768f8..b99a7a7548 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -41,11 +41,11 @@ 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 "version: $pkgVersion" + echo "version: $env:pkgVersion" - name: test setting env var run: | - echo "version: $PACKAGE_VERSION" + echo "version: $env:PACKAGE_VERSION" if($PACKAGE_VERSION -eq "") { Throw "test env failed." From 93d43c75bb8d3739c6b68a5aadf707db64e4edf8 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Tue, 22 Dec 2020 22:22:51 +0000 Subject: [PATCH 010/145] removing env brackets.... --- .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 b99a7a7548..76cfd68705 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -40,14 +40,14 @@ jobs: - 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 + echo "PACKAGE_VERSION=$env:pkgVersion" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append echo "version: $env:pkgVersion" - name: test setting env var run: | echo "version: $env:PACKAGE_VERSION" - if($PACKAGE_VERSION -eq "") { + if($env:PACKAGE_VERSION -eq "") { Throw "test env failed." } @@ -74,7 +74,7 @@ jobs: $testVersion = Invoke-Expression '& ./test/windows/bw.exe -v' echo "version: $env:PACKAGE_VERSION" - echo "testVersion: $env:testVersion" + echo "testVersion: $testVersion" if($testVersion -ne $env:PACKAGE_VERSION) { Throw "Version test failed." } From 69be353ef8dca328b69864d497fc9c5d4206432d Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Tue, 22 Dec 2020 22:36:37 +0000 Subject: [PATCH 011/145] installing checksum in windows builder --- .github/workflows/build.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 76cfd68705..b870160d65 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -32,6 +32,9 @@ jobs: - name: Checkout repo uses: actions/checkout@v2 + - name: Setup Windows builder + run: choco install checksum --no-progress + - name: Set up Node uses: actions/setup-node@v1 with: From 7ca96ffa2929c93a4027e5023fab2ce98e9f64b1 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Tue, 22 Dec 2020 23:21:15 +0000 Subject: [PATCH 012/145] adding github publishing --- .github/workflows/build.yml | 53 +++++++++++++++++++++++++++++-------- 1 file changed, 42 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b870160d65..d9204a23ea 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -93,18 +93,49 @@ jobs: checksum -f="./dist/bw-linux-${env:PACKAGE_VERSION}.zip" ` -t sha256 | Out-File -Encoding ASCII ./dist/bw-linux-sha256-${env:PACKAGE_VERSION}.txt - - name: Publish to GitHub - run: | - Write-Host "" - Write-Host .\dist\bw-windows-${env:PACKAGE_VERSION}.zip - Write-Host .\dist\bw-macos-${env:PACKAGE_VERSION}.zip - Write-Host .\dist\bw-linux-${env:PACKAGE_VERSION}.zip - Write-Host .\dist\bw-windows-sha256-${env:PACKAGE_VERSION}.txt - Write-Host .\dist\bw-macos-sha256-${env:PACKAGE_VERSION}.txt - Write-Host .\dist\bw-linux-sha256-${env:PACKAGE_VERSION}.txt - Write-Host .\dist\chocolatey\bitwarden-cli.${env:PACKAGE_VERSION}.nupkg + - name: Publish windows zip to GitHub + 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 + 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 + 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 + 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 + 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 + 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 + 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 From 757c3f6208dbdccb422ed680948a4a245505ffb9 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Wed, 23 Dec 2020 15:46:00 +0000 Subject: [PATCH 013/145] splitting out the packages --- .github/workflows/build.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d9204a23ea..70517e4435 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -61,7 +61,19 @@ jobs: run: npm run sub:init - name: Build - run: npm run dist + run: npm run build:prod + + - name: Clean Build + run: npm run clean + + - name: Package Windows + run: pkg . --targets win-x64 --output ./dist/windows/bw.exe + + - name: Package Mac + run: pkg . --targets macos-x64 --output ./dist/macos/bw + + - name: Package Linux + run: pkg . --targets linux-x64 --output ./dist/linux/bw - name: Zip shell: cmd From 079fd7dc82fa2d2d1d50de1549bf3810367e1fa4 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Wed, 23 Dec 2020 15:52:24 +0000 Subject: [PATCH 014/145] changing package command --- .github/workflows/build.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 70517e4435..ada723f84a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -67,13 +67,13 @@ jobs: run: npm run clean - name: Package Windows - run: pkg . --targets win-x64 --output ./dist/windows/bw.exe + run: npm run package:win #pkg . --targets win-x64 --output ./dist/windows/bw.exe - name: Package Mac - run: pkg . --targets macos-x64 --output ./dist/macos/bw + run: npm run package:mac #pkg . --targets macos-x64 --output ./dist/macos/bw - name: Package Linux - run: pkg . --targets linux-x64 --output ./dist/linux/bw + run: npm run package:lin #pkg . --targets linux-x64 --output ./dist/linux/bw - name: Zip shell: cmd @@ -164,6 +164,7 @@ jobs: .\scripts\choco-update.ps1 -version $env:PACKAGE_VERSION + # This process seems independent from the others publish_snap: name: Publish Snap runs-on: ubuntu-latest @@ -218,6 +219,7 @@ jobs: run: snapcraft logout + # This job is independent: it reruns 'npm run build:prod' publish_npm: name: Publish NPM runs-on: ubuntu-latest From c13e50db89de402bb651d6e4d8dae312e35ed90c Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Wed, 23 Dec 2020 18:48:51 +0000 Subject: [PATCH 015/145] debugging files --- .github/workflows/build.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ada723f84a..0c7fae1c51 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -105,6 +105,9 @@ jobs: checksum -f="./dist/bw-linux-${env:PACKAGE_VERSION}.zip" ` -t sha256 | Out-File -Encoding ASCII ./dist/bw-linux-sha256-${env:PACKAGE_VERSION}.txt + - name: Debug Files + run: dir ./dist + - name: Publish windows zip to GitHub uses: actions/upload-artifact@v2 with: From 43ddc6f5fe4abd90b05d083a83424975924e2802 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Wed, 23 Dec 2020 18:59:21 +0000 Subject: [PATCH 016/145] trying different env retrieval --- .github/workflows/build.yml | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0c7fae1c51..2033cbf3b3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -67,13 +67,13 @@ jobs: run: npm run clean - name: Package Windows - run: npm run package:win #pkg . --targets win-x64 --output ./dist/windows/bw.exe + run: npm run package:win - name: Package Mac - run: npm run package:mac #pkg . --targets macos-x64 --output ./dist/macos/bw + run: npm run package:mac - name: Package Linux - run: npm run package:lin #pkg . --targets linux-x64 --output ./dist/linux/bw + run: npm run package:lin - name: Zip shell: cmd @@ -111,44 +111,44 @@ jobs: - name: Publish windows zip to GitHub uses: actions/upload-artifact@v2 with: - name: bw-windows-${env:PACKAGE_VERSION}.zip - path: ./dist/bw-windows-${env:PACKAGE_VERSION}.zip + name: bw-windows-${PACKAGE_VERSION}.zip + path: ./dist/bw-windows-${PACKAGE_VERSION}.zip - name: Publish windows checksum to GitHub uses: actions/upload-artifact@v2 with: - name: bw-windows-sha256-${env:PACKAGE_VERSION}.txt - path: ./dist/bw-windows-sha256-${env:PACKAGE_VERSION}.txt + name: bw-windows-sha256-${PACKAGE_VERSION}.txt + path: ./dist/bw-windows-sha256-${PACKAGE_VERSION}.txt - name: Publish macos zip to GitHub uses: actions/upload-artifact@v2 with: - name: bw-macos-${env:PACKAGE_VERSION}.zip - path: ./dist/bw-macos-${env:PACKAGE_VERSION}.zip + name: bw-macos-${PACKAGE_VERSION}.zip + path: ./dist/bw-macos-${PACKAGE_VERSION}.zip - name: Publish macos checksum to GitHub uses: actions/upload-artifact@v2 with: - name: bw-macos-sha256-${env:PACKAGE_VERSION}.txt - path: ./dist/bw-macos-sha256-${env:PACKAGE_VERSION}.txt + name: bw-macos-sha256-${PACKAGE_VERSION}.txt + path: ./dist/bw-macos-sha256-${PACKAGE_VERSION}.txt - name: Publish linux zip to GitHub uses: actions/upload-artifact@v2 with: - name: bw-linux-${env:PACKAGE_VERSION}.zip - path: ./dist/bw-linux-${env:PACKAGE_VERSION}.zip + name: bw-linux-${PACKAGE_VERSION}.zip + path: ./dist/bw-linux-${PACKAGE_VERSION}.zip - name: Publish linux checksum to GitHub uses: actions/upload-artifact@v2 with: - name: bw-linux-sha256-${env:PACKAGE_VERSION}.txt - path: ./dist/bw-linux-sha256-${env:PACKAGE_VERSION}.txt + name: bw-linux-sha256-${PACKAGE_VERSION}.txt + path: ./dist/bw-linux-sha256-${PACKAGE_VERSION}.txt - name: Publish Chocolatey CLI uses: actions/upload-artifact@v2 with: - name: bitwarden-cli.${env:PACKAGE_VERSION}.nupkg - path: ./dist/chocolatey/bitwarden-cli.${env:PACKAGE_VERSION}.nupkg + name: bitwarden-cli.${PACKAGE_VERSION}.nupkg + path: ./dist/chocolatey/bitwarden-cli.${PACKAGE_VERSION}.nupkg publish_windows: From 7a9899548289798f651028cbe7bda2417c2baeb5 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Wed, 23 Dec 2020 19:16:39 +0000 Subject: [PATCH 017/145] trying different env retrieval again --- .github/workflows/build.yml | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2033cbf3b3..927b8fc17d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -111,44 +111,44 @@ jobs: - name: Publish windows zip to GitHub uses: actions/upload-artifact@v2 with: - name: bw-windows-${PACKAGE_VERSION}.zip - path: ./dist/bw-windows-${PACKAGE_VERSION}.zip + name: bw-windows-${{ PACKAGE_VERSION }}.zip + path: ./dist/bw-windows-${{ PACKAGE_VERSION }}.zip - name: Publish windows checksum to GitHub uses: actions/upload-artifact@v2 with: - name: bw-windows-sha256-${PACKAGE_VERSION}.txt - path: ./dist/bw-windows-sha256-${PACKAGE_VERSION}.txt + name: bw-windows-sha256-${{ PACKAGE_VERSION }}.txt + path: ./dist/bw-windows-sha256-${{ PACKAGE_VERSION }}.txt - name: Publish macos zip to GitHub uses: actions/upload-artifact@v2 with: - name: bw-macos-${PACKAGE_VERSION}.zip - path: ./dist/bw-macos-${PACKAGE_VERSION}.zip + name: bw-macos-${{ PACKAGE_VERSION }}.zip + path: ./dist/bw-macos-${{ PACKAGE_VERSION }}.zip - name: Publish macos checksum to GitHub uses: actions/upload-artifact@v2 with: - name: bw-macos-sha256-${PACKAGE_VERSION}.txt - path: ./dist/bw-macos-sha256-${PACKAGE_VERSION}.txt + name: bw-macos-sha256-${{ PACKAGE_VERSION }}.txt + path: ./dist/bw-macos-sha256-${{ PACKAGE_VERSION }}.txt - name: Publish linux zip to GitHub uses: actions/upload-artifact@v2 with: - name: bw-linux-${PACKAGE_VERSION}.zip - path: ./dist/bw-linux-${PACKAGE_VERSION}.zip + name: bw-linux-${{ PACKAGE_VERSION }}.zip + path: ./dist/bw-linux-${{ PACKAGE_VERSION }}.zip - name: Publish linux checksum to GitHub uses: actions/upload-artifact@v2 with: - name: bw-linux-sha256-${PACKAGE_VERSION}.txt - path: ./dist/bw-linux-sha256-${PACKAGE_VERSION}.txt + name: bw-linux-sha256-${{ PACKAGE_VERSION }}.txt + path: ./dist/bw-linux-sha256-${{ PACKAGE_VERSION }}.txt - name: Publish Chocolatey CLI uses: actions/upload-artifact@v2 with: - name: bitwarden-cli.${PACKAGE_VERSION}.nupkg - path: ./dist/chocolatey/bitwarden-cli.${PACKAGE_VERSION}.nupkg + name: bitwarden-cli.${{ PACKAGE_VERSION }}.nupkg + path: ./dist/chocolatey/bitwarden-cli.${{ PACKAGE_VERSION }}.nupkg publish_windows: From 7a0dcb630559564d13b9f1f87077168f412c932a Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Wed, 23 Dec 2020 19:20:53 +0000 Subject: [PATCH 018/145] adding an env transfer --- .github/workflows/build.yml | 42 ++++++++++++++++++++++++------------- 1 file changed, 28 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 927b8fc17d..84199a860e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -111,44 +111,58 @@ jobs: - name: Publish windows zip to GitHub uses: actions/upload-artifact@v2 with: - name: bw-windows-${{ PACKAGE_VERSION }}.zip - path: ./dist/bw-windows-${{ PACKAGE_VERSION }}.zip + name: bw-windows-${{ env.pkg-version }}.zip + path: ./dist/bw-windows-${{ env.pkg-version }}.zip + env: + pkg-version: $PACKAGE_VERSION - name: Publish windows checksum to GitHub uses: actions/upload-artifact@v2 with: - name: bw-windows-sha256-${{ PACKAGE_VERSION }}.txt - path: ./dist/bw-windows-sha256-${{ PACKAGE_VERSION }}.txt + name: bw-windows-sha256-${{ env.pkg-version }}.txt + path: ./dist/bw-windows-sha256-${{ env.pkg-version }}.txt + env: + pkg-version: $PACKAGE_VERSION - name: Publish macos zip to GitHub uses: actions/upload-artifact@v2 with: - name: bw-macos-${{ PACKAGE_VERSION }}.zip - path: ./dist/bw-macos-${{ PACKAGE_VERSION }}.zip + name: bw-macos-${{ env.pkg-version }}.zip + path: ./dist/bw-macos-${{ env.pkg-version }}.zip + env: + pkg-version: $PACKAGE_VERSION - name: Publish macos checksum to GitHub uses: actions/upload-artifact@v2 with: - name: bw-macos-sha256-${{ PACKAGE_VERSION }}.txt - path: ./dist/bw-macos-sha256-${{ PACKAGE_VERSION }}.txt + name: bw-macos-sha256-${{ env.pkg-version }}.txt + path: ./dist/bw-macos-sha256-${{ env.pkg-version }}.txt + env: + pkg-version: $PACKAGE_VERSION - name: Publish linux zip to GitHub uses: actions/upload-artifact@v2 with: - name: bw-linux-${{ PACKAGE_VERSION }}.zip - path: ./dist/bw-linux-${{ PACKAGE_VERSION }}.zip + name: bw-linux-${{ env.pkg-version }}.zip + path: ./dist/bw-linux-${{ env.pkg-version }}.zip + env: + pkg-version: $PACKAGE_VERSION - name: Publish linux checksum to GitHub uses: actions/upload-artifact@v2 with: - name: bw-linux-sha256-${{ PACKAGE_VERSION }}.txt - path: ./dist/bw-linux-sha256-${{ PACKAGE_VERSION }}.txt + name: bw-linux-sha256-${{ env.pkg-version }}.txt + path: ./dist/bw-linux-sha256-${{ env.pkg-version }}.txt + env: + pkg-version: $PACKAGE_VERSION - name: Publish Chocolatey CLI uses: actions/upload-artifact@v2 with: - name: bitwarden-cli.${{ PACKAGE_VERSION }}.nupkg - path: ./dist/chocolatey/bitwarden-cli.${{ PACKAGE_VERSION }}.nupkg + name: bitwarden-cli.${{ env.pkg-version }}.nupkg + path: ./dist/chocolatey/bitwarden-cli.${{ env.pkg-version }}.nupkg + env: + pkg-version: $PACKAGE_VERSION publish_windows: From 169d94b9fb77c3ec77b35bbe3e88be8520217a1a Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Wed, 23 Dec 2020 19:31:45 +0000 Subject: [PATCH 019/145] more debugging --- .github/workflows/build.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 84199a860e..c83e696cb7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -114,7 +114,7 @@ jobs: name: bw-windows-${{ env.pkg-version }}.zip path: ./dist/bw-windows-${{ env.pkg-version }}.zip env: - pkg-version: $PACKAGE_VERSION + pkg-version: ${PACKAGE_VERSION} - name: Publish windows checksum to GitHub uses: actions/upload-artifact@v2 @@ -122,7 +122,7 @@ jobs: name: bw-windows-sha256-${{ env.pkg-version }}.txt path: ./dist/bw-windows-sha256-${{ env.pkg-version }}.txt env: - pkg-version: $PACKAGE_VERSION + pkg-version: ${PACKAGE_VERSION} - name: Publish macos zip to GitHub uses: actions/upload-artifact@v2 @@ -130,7 +130,7 @@ jobs: name: bw-macos-${{ env.pkg-version }}.zip path: ./dist/bw-macos-${{ env.pkg-version }}.zip env: - pkg-version: $PACKAGE_VERSION + pkg-version: ${PACKAGE_VERSION} - name: Publish macos checksum to GitHub uses: actions/upload-artifact@v2 @@ -138,7 +138,7 @@ jobs: name: bw-macos-sha256-${{ env.pkg-version }}.txt path: ./dist/bw-macos-sha256-${{ env.pkg-version }}.txt env: - pkg-version: $PACKAGE_VERSION + pkg-version: ${PACKAGE_VERSION} - name: Publish linux zip to GitHub uses: actions/upload-artifact@v2 @@ -146,7 +146,7 @@ jobs: name: bw-linux-${{ env.pkg-version }}.zip path: ./dist/bw-linux-${{ env.pkg-version }}.zip env: - pkg-version: $PACKAGE_VERSION + pkg-version: ${PACKAGE_VERSION} - name: Publish linux checksum to GitHub uses: actions/upload-artifact@v2 @@ -154,7 +154,7 @@ jobs: name: bw-linux-sha256-${{ env.pkg-version }}.txt path: ./dist/bw-linux-sha256-${{ env.pkg-version }}.txt env: - pkg-version: $PACKAGE_VERSION + pkg-version: ${PACKAGE_VERSION} - name: Publish Chocolatey CLI uses: actions/upload-artifact@v2 @@ -162,7 +162,7 @@ jobs: name: bitwarden-cli.${{ env.pkg-version }}.nupkg path: ./dist/chocolatey/bitwarden-cli.${{ env.pkg-version }}.nupkg env: - pkg-version: $PACKAGE_VERSION + pkg-version: ${PACKAGE_VERSION} publish_windows: From 18031b80f028005984b0a2ee11c5d3677dd2eca5 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Wed, 23 Dec 2020 19:45:23 +0000 Subject: [PATCH 020/145] trying the env.* syntax --- .github/workflows/build.yml | 42 +++++++++++++------------------------ 1 file changed, 14 insertions(+), 28 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c83e696cb7..534ea4f308 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -111,58 +111,44 @@ jobs: - name: Publish windows zip to GitHub uses: actions/upload-artifact@v2 with: - name: bw-windows-${{ env.pkg-version }}.zip - path: ./dist/bw-windows-${{ env.pkg-version }}.zip - env: - pkg-version: ${PACKAGE_VERSION} + name: bw-windows-${{ env.PACKAGE_NAME }}.zip + path: ./dist/bw-windows-${{ env.PACKAGE_NAME }}.zip - name: Publish windows checksum to GitHub uses: actions/upload-artifact@v2 with: - name: bw-windows-sha256-${{ env.pkg-version }}.txt - path: ./dist/bw-windows-sha256-${{ env.pkg-version }}.txt - env: - pkg-version: ${PACKAGE_VERSION} + name: bw-windows-sha256-${{ env.PACKAGE_NAME }}.txt + path: ./dist/bw-windows-sha256-${{ env.PACKAGE_NAME }}.txt - name: Publish macos zip to GitHub uses: actions/upload-artifact@v2 with: - name: bw-macos-${{ env.pkg-version }}.zip - path: ./dist/bw-macos-${{ env.pkg-version }}.zip - env: - pkg-version: ${PACKAGE_VERSION} + name: bw-macos-${{ env.PACKAGE_NAME }}.zip + path: ./dist/bw-macos-${{ env.PACKAGE_NAME }}.zip - name: Publish macos checksum to GitHub uses: actions/upload-artifact@v2 with: - name: bw-macos-sha256-${{ env.pkg-version }}.txt - path: ./dist/bw-macos-sha256-${{ env.pkg-version }}.txt - env: - pkg-version: ${PACKAGE_VERSION} + name: bw-macos-sha256-${{ env.PACKAGE_NAME }}.txt + path: ./dist/bw-macos-sha256-${{ env.PACKAGE_NAME }}.txt - name: Publish linux zip to GitHub uses: actions/upload-artifact@v2 with: - name: bw-linux-${{ env.pkg-version }}.zip - path: ./dist/bw-linux-${{ env.pkg-version }}.zip - env: - pkg-version: ${PACKAGE_VERSION} + name: bw-linux-${{ env.PACKAGE_NAME }}.zip + path: ./dist/bw-linux-${{ env.PACKAGE_NAME }}.zip - name: Publish linux checksum to GitHub uses: actions/upload-artifact@v2 with: - name: bw-linux-sha256-${{ env.pkg-version }}.txt - path: ./dist/bw-linux-sha256-${{ env.pkg-version }}.txt - env: - pkg-version: ${PACKAGE_VERSION} + name: bw-linux-sha256-${{ env.PACKAGE_NAME }}.txt + path: ./dist/bw-linux-sha256-${{ env.PACKAGE_NAME }}.txt - name: Publish Chocolatey CLI uses: actions/upload-artifact@v2 with: - name: bitwarden-cli.${{ env.pkg-version }}.nupkg - path: ./dist/chocolatey/bitwarden-cli.${{ env.pkg-version }}.nupkg - env: - pkg-version: ${PACKAGE_VERSION} + name: bitwarden-cli.${{ env.PACKAGE_NAME }}.nupkg + path: ./dist/chocolatey/bitwarden-cli.${{ env.PACKAGE_NAME }}.nupkg publish_windows: From 184f46cd8b2a57d8ca20f99efdc9cdc524cd835e Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Wed, 23 Dec 2020 19:54:01 +0000 Subject: [PATCH 021/145] fixing the env var for publishing --- .github/workflows/build.yml | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 534ea4f308..9b4579638e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -105,50 +105,47 @@ jobs: checksum -f="./dist/bw-linux-${env:PACKAGE_VERSION}.zip" ` -t sha256 | Out-File -Encoding ASCII ./dist/bw-linux-sha256-${env:PACKAGE_VERSION}.txt - - name: Debug Files - run: dir ./dist - - name: Publish windows zip to GitHub uses: actions/upload-artifact@v2 with: - name: bw-windows-${{ env.PACKAGE_NAME }}.zip - path: ./dist/bw-windows-${{ env.PACKAGE_NAME }}.zip + name: bw-windows-${{ env.PACKAGE_VERSION }}.zip + path: ./dist/bw-windows-${{ env.PACKAGE_VERSION }}.zip - name: Publish windows checksum to GitHub uses: actions/upload-artifact@v2 with: - name: bw-windows-sha256-${{ env.PACKAGE_NAME }}.txt - path: ./dist/bw-windows-sha256-${{ env.PACKAGE_NAME }}.txt + name: bw-windows-sha256-${{ env.PACKAGE_VERSION }}.txt + path: ./dist/bw-windows-sha256-${{ env.PACKAGE_VERSION }}.txt - name: Publish macos zip to GitHub uses: actions/upload-artifact@v2 with: - name: bw-macos-${{ env.PACKAGE_NAME }}.zip - path: ./dist/bw-macos-${{ env.PACKAGE_NAME }}.zip + name: bw-macos-${{ env.PACKAGE_VERSION }}.zip + path: ./dist/bw-macos-${{ env.PACKAGE_VERSION }}.zip - name: Publish macos checksum to GitHub uses: actions/upload-artifact@v2 with: - name: bw-macos-sha256-${{ env.PACKAGE_NAME }}.txt - path: ./dist/bw-macos-sha256-${{ env.PACKAGE_NAME }}.txt + name: bw-macos-sha256-${{ env.PACKAGE_VERSION }}.txt + path: ./dist/bw-macos-sha256-${{ env.PACKAGE_VERSION }}.txt - name: Publish linux zip to GitHub uses: actions/upload-artifact@v2 with: - name: bw-linux-${{ env.PACKAGE_NAME }}.zip - path: ./dist/bw-linux-${{ env.PACKAGE_NAME }}.zip + name: bw-linux-${{ env.PACKAGE_VERSION }}.zip + path: ./dist/bw-linux-${{ env.PACKAGE_VERSION }}.zip - name: Publish linux checksum to GitHub uses: actions/upload-artifact@v2 with: - name: bw-linux-sha256-${{ env.PACKAGE_NAME }}.txt - path: ./dist/bw-linux-sha256-${{ env.PACKAGE_NAME }}.txt + name: bw-linux-sha256-${{ env.PACKAGE_VERSION }}.txt + path: ./dist/bw-linux-sha256-${{ env.PACKAGE_VERSION }}.txt - name: Publish Chocolatey CLI uses: actions/upload-artifact@v2 with: - name: bitwarden-cli.${{ env.PACKAGE_NAME }}.nupkg - path: ./dist/chocolatey/bitwarden-cli.${{ env.PACKAGE_NAME }}.nupkg + name: bitwarden-cli.${{ env.PACKAGE_VERSION }}.nupkg + path: ./dist/chocolatey/bitwarden-cli.${{ env.PACKAGE_VERSION }}.nupkg publish_windows: From 2b44a3897d4595da6391c62a3141614d8f5abdde Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Wed, 6 Jan 2021 19:26:25 +0000 Subject: [PATCH 022/145] adding an experimental workflow to test the windows environment on for the ResourceHacker --- .github/workflows/build.yml | 33 ++++++++++++++++++++++++--------- .github/workflows/exp.yml | 11 +++++++++++ 2 files changed, 35 insertions(+), 9 deletions(-) create mode 100644 .github/workflows/exp.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9b4579638e..77d4ee9f14 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,13 +1,15 @@ name: build & publish on: - push: - branches-ignore: - - 'l10n_master' - release: - types: - - published + workflow_dispatch: +#on: +# push: +# branches-ignore: +# - 'l10n_master' +# release: +# types: +# - published jobs: cloc: @@ -22,8 +24,7 @@ jobs: sudo apt -y install cloc - name: Print lines of code - run: cloc --include-lang TypeScript,JavaScript,HTML,Sass,CSS --vcs git - + run: cloc --include-lang TypeScript,JavaScript --vcs git build: name: Build CLI @@ -40,12 +41,18 @@ jobs: with: node-version: '10.x' - - name: Set PACKAGE_VERSION + - name: Set PACKAGE_VERSION & VER_INFO 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 "version: $env:pkgVersion" + if(Test-Path -Path $env:WIN_PKG) { + echo "VER_INFO=true" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + } + env: + WIN_PKG: C:\Users\appveyor\.pkg-cache\v2.5\fetched-v10.4.1-win-x64 + - name: test setting env var run: | echo "version: $env:PACKAGE_VERSION" @@ -54,6 +61,14 @@ 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, + 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 + - name: Install run: npm install diff --git a/.github/workflows/exp.yml b/.github/workflows/exp.yml new file mode 100644 index 0000000000..1f6e1244ea --- /dev/null +++ b/.github/workflows/exp.yml @@ -0,0 +1,11 @@ +name: Windows Environment Exploration + +on: + workflow_dispatch: + +jobs: + exp: + runs-on: ubuntu-latest + steps: + - name: Test pkg + run: pkg --help From 88cc5c050c4db769eb5764fca1f3b7113882bbb7 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Wed, 6 Jan 2021 19:35:25 +0000 Subject: [PATCH 023/145] 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 024/145] 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 025/145] 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 026/145] 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 027/145] 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 028/145] 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 029/145] 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 030/145] 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 031/145] 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 032/145] 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 033/145] 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 034/145] 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 035/145] 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 036/145] 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 037/145] 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 038/145] 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 039/145] 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 040/145] 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 041/145] 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 042/145] 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 043/145] 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 044/145] 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 045/145] 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 046/145] 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 047/145] 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 048/145] 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 049/145] 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 050/145] 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 051/145] 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 052/145] 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 053/145] 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 054/145] 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 055/145] 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 056/145] 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 057/145] 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 058/145] 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 059/145] 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 060/145] 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 061/145] 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 062/145] 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 063/145] 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 064/145] 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 065/145] 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 066/145] 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 067/145] 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 068/145] 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 069/145] 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 070/145] 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 071/145] 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 072/145] 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 073/145] 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 074/145] 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 075/145] 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 076/145] 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 077/145] 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 078/145] 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 079/145] 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 080/145] 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 081/145] 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 082/145] 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 083/145] 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 084/145] 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 085/145] 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 086/145] 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 087/145] 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 088/145] 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 089/145] 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 090/145] 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 091/145] 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 092/145] 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 093/145] 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 094/145] 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 095/145] 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 096/145] 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 097/145] 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 098/145] 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 099/145] 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 100/145] 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 101/145] 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 102/145] 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 103/145] 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 104/145] 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 From 8248efb2bac8d28606ef8dc67bf471f8a12a92bc Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Wed, 27 Jan 2021 22:15:08 +0000 Subject: [PATCH 105/145] fixing 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 81efca57a0..db67ee4336 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -197,7 +197,7 @@ jobs: - name: Build Snap Package run: | mkdir ./dist - cp -r ./stores/snap -t ./dist + cp -r ./stores/snap -t ./dist/snap sed -i s/__version__/${{ env.PACKAGE_VERSION }}/g ./dist/snap/snapcraft.yaml cd ./dist/snap From b70dea7acf2d88557a400f0d2fcbef0320f9271e Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Wed, 27 Jan 2021 22:19:59 +0000 Subject: [PATCH 106/145] making sure that dist/snap exists --- .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 db67ee4336..ffc4206535 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -196,17 +196,17 @@ jobs: - name: Build Snap Package run: | - mkdir ./dist - cp -r ./stores/snap -t ./dist/snap - sed -i s/__version__/${{ env.PACKAGE_VERSION }}/g ./dist/snap/snapcraft.yaml + mkdir -p dist/snap + cp -r stores/snap -t dist/snap + sed -i s/__version__/${{ env.PACKAGE_VERSION }}/g dist/snap/snapcraft.yaml - cd ./dist/snap + 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 + run: sudo snap install dist/snap/bw*.snap --dangerous - name: Test Snap shell: pwsh From dbf2eb960651e6473b9f0195a9b4516326705498 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Wed, 27 Jan 2021 22:48:50 +0000 Subject: [PATCH 107/145] switching to local zip versus one that has already been released --- .github/workflows/build.yml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ffc4206535..ee7f29b3a7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,7 +20,7 @@ jobs: - name: Print lines of code run: cloc --include-lang TypeScript,JavaScript --vcs git - windows: + cli: name: Build CLI runs-on: windows-latest steps: @@ -167,9 +167,11 @@ jobs: path: ./dist/chocolatey/bitwarden-cli.${{ env.PACKAGE_VERSION }}.nupkg - linux: + snap: name: Build Snap runs-on: ubuntu-latest + needs: cli + if: github.ref == 'refs/heads/master' steps: - name: Checkout repo uses: actions/checkout@v2 @@ -194,10 +196,16 @@ jobs: GITHUB_REF: ${{ github.ref }} GITHUB_EVENT: ${{ github.event_name }} + - name: Get bw linux cli + uses: actions/download-artifact@v2 + with: + name: bw-linux-${{ env.PACKAGE_VERSION }}.zip + path: ./dist/bw-linux-${{ env.PACKAGE_VERSION }}.zip + - name: Build Snap Package run: | - mkdir -p dist/snap - cp -r stores/snap -t dist/snap + mkdir -p dist + cp -r stores/snap -t dist sed -i s/__version__/${{ env.PACKAGE_VERSION }}/g dist/snap/snapcraft.yaml cd dist/snap From b953db7eba73a1e2a52ccf99d4214d37d64e7cb6 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Wed, 27 Jan 2021 22:49:15 +0000 Subject: [PATCH 108/145] committing the missed file --- stores/snap/snapcraft.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stores/snap/snapcraft.yaml b/stores/snap/snapcraft.yaml index 51bd4c3803..80b98c63c2 100644 --- a/stores/snap/snapcraft.yaml +++ b/stores/snap/snapcraft.yaml @@ -10,6 +10,6 @@ apps: parts: bw: plugin: dump - source: https://github.com/bitwarden/cli/releases/download/v$SNAPCRAFT_PROJECT_VERSION/bw-linux-$SNAPCRAFT_PROJECT_VERSION.zip + source: ./dist/bw-linux-$SNAPCRAFT_PROJECT_VERSION.zip prepare: | chmod +x bw From e7aa94dd76046748aea223dc02c9bfd4e86c599a Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Wed, 27 Jan 2021 23:01:07 +0000 Subject: [PATCH 109/145] downloading the cli into dist/snap --- .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 ee7f29b3a7..143c09ddd1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -200,7 +200,7 @@ jobs: uses: actions/download-artifact@v2 with: name: bw-linux-${{ env.PACKAGE_VERSION }}.zip - path: ./dist/bw-linux-${{ env.PACKAGE_VERSION }}.zip + path: ./dist/snap/bw-linux-${{ env.PACKAGE_VERSION }}.zip - name: Build Snap Package run: | From ea4687177e96c9a24842e798923e60f51e15bc39 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Wed, 27 Jan 2021 23:09:03 +0000 Subject: [PATCH 110/145] fixing path in snapcraft.yaml --- stores/snap/snapcraft.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stores/snap/snapcraft.yaml b/stores/snap/snapcraft.yaml index 80b98c63c2..05ca1d5eeb 100644 --- a/stores/snap/snapcraft.yaml +++ b/stores/snap/snapcraft.yaml @@ -10,6 +10,6 @@ apps: parts: bw: plugin: dump - source: ./dist/bw-linux-$SNAPCRAFT_PROJECT_VERSION.zip + source: ./bw-linux-$SNAPCRAFT_PROJECT_VERSION.zip prepare: | chmod +x bw From 1d3300d8c39522515af1e3cdaa897b7b0afeeefa Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Wed, 27 Jan 2021 23:26:21 +0000 Subject: [PATCH 111/145] trying something else --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 143c09ddd1..f93d4944a9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -209,6 +209,7 @@ jobs: sed -i s/__version__/${{ env.PACKAGE_VERSION }}/g dist/snap/snapcraft.yaml cd dist/snap + ls- alth snapcraft sha256sum bw_${{ env.PACKAGE_VERSION }}_amd64.snap | awk '{split($0, a); print a[1]}' > bw-snap-sha256-${{ env.PACKAGE_VERSION }}.txt From a0a60b3a77a0a9ec036619bc2a93b8291663eaf8 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Wed, 27 Jan 2021 23:34:08 +0000 Subject: [PATCH 112/145] fixing ls command --- .github/workflows/build.yml | 2 +- stores/snap/snapcraft.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f93d4944a9..6d88c30bcb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -209,7 +209,7 @@ jobs: sed -i s/__version__/${{ env.PACKAGE_VERSION }}/g dist/snap/snapcraft.yaml cd dist/snap - ls- alth + ls -alth snapcraft sha256sum bw_${{ env.PACKAGE_VERSION }}_amd64.snap | awk '{split($0, a); print a[1]}' > bw-snap-sha256-${{ env.PACKAGE_VERSION }}.txt diff --git a/stores/snap/snapcraft.yaml b/stores/snap/snapcraft.yaml index 05ca1d5eeb..e70bca6419 100644 --- a/stores/snap/snapcraft.yaml +++ b/stores/snap/snapcraft.yaml @@ -10,6 +10,6 @@ apps: parts: bw: plugin: dump - source: ./bw-linux-$SNAPCRAFT_PROJECT_VERSION.zip + source: bw-linux-$SNAPCRAFT_PROJECT_VERSION.zip prepare: | chmod +x bw From e508988f4d0bd711db64c9f8ea0418f513a9f8dc Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Wed, 27 Jan 2021 23:41:05 +0000 Subject: [PATCH 113/145] let's see what's inside --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6d88c30bcb..afbd6b6fd3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -210,6 +210,7 @@ jobs: cd dist/snap ls -alth + ls -alth bw-linux-${{ env.PACKAGE_VERSION }}.zip snapcraft sha256sum bw_${{ env.PACKAGE_VERSION }}_amd64.snap | awk '{split($0, a); print a[1]}' > bw-snap-sha256-${{ env.PACKAGE_VERSION }}.txt From 9ab72bb308e0b18e629ee0c4808937def2337e0e Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Wed, 27 Jan 2021 23:50:11 +0000 Subject: [PATCH 114/145] removing the file name from the download --- .github/workflows/build.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index afbd6b6fd3..ac9d24f6fe 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -200,7 +200,7 @@ jobs: uses: actions/download-artifact@v2 with: name: bw-linux-${{ env.PACKAGE_VERSION }}.zip - path: ./dist/snap/bw-linux-${{ env.PACKAGE_VERSION }}.zip + path: ./dist/snap - name: Build Snap Package run: | @@ -210,7 +210,6 @@ jobs: cd dist/snap ls -alth - ls -alth bw-linux-${{ env.PACKAGE_VERSION }}.zip snapcraft sha256sum bw_${{ env.PACKAGE_VERSION }}_amd64.snap | awk '{split($0, a); print a[1]}' > bw-snap-sha256-${{ env.PACKAGE_VERSION }}.txt From 8ca398d6962b48f916c81f6a9c0234e9b38b6c5f Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Thu, 28 Jan 2021 00:03:20 +0000 Subject: [PATCH 115/145] fixing the need --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 42cc021460..28f8ddda40 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -219,7 +219,7 @@ jobs: linux: name: Publish Snap runs-on: ubuntu-latest - need: setup + needs: setup steps: - name: Checkout repo uses: actions/checkout@v2 From 52611dd8a7ba7603abebe9f82ec8fdd788215833 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Thu, 28 Jan 2021 00:09:02 +0000 Subject: [PATCH 116/145] copying over snap build to release --- .github/workflows/release.yml | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 28f8ddda40..1e77e90f78 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -244,13 +244,20 @@ jobs: GITHUB_REF: ${{ github.ref }} GITHUB_EVENT: ${{ github.event_name }} + - name: Get bw linux cli + uses: actions/download-artifact@v2 + with: + name: bw-linux-${{ env.PACKAGE_VERSION }}.zip + path: ./dist/snap + - 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 + mkdir -p dist + cp -r stores/snap -t dist + sed -i s/__version__/${{ env.PACKAGE_VERSION }}/g dist/snap/snapcraft.yaml - cd ./dist/snap + cd dist/snap + ls -alth snapcraft sha256sum bw_${{ env.PACKAGE_VERSION }}_amd64.snap | awk '{split($0, a); print a[1]}' > bw-snap-sha256-${{ env.PACKAGE_VERSION }}.txt From 840b076ab6269339ec6949e5e61392afcfcc01d7 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Thu, 28 Jan 2021 00:11:08 +0000 Subject: [PATCH 117/145] fixing the other things from the build --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1e77e90f78..8bf847b428 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -68,7 +68,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 99dfb48f8ea0e4f77e7ee55d76713dbc61d1b10d Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Thu, 28 Jan 2021 15:22:16 +0000 Subject: [PATCH 118/145] adding in the other job dependency --- .github/workflows/release.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8bf847b428..4a3742aeae 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -48,7 +48,7 @@ jobs: prerelease: false - windows: + cli: name: Build CLI runs-on: windows-latest needs: setup @@ -216,10 +216,12 @@ jobs: asset_path: ./dist/chocolatey/bitwarden-cli.${{ env.PACKAGE_VERSION }}.nupkg - linux: + snap: name: Publish Snap runs-on: ubuntu-latest - needs: setup + needs: + - setup + - cli steps: - name: Checkout repo uses: actions/checkout@v2 From 21714b687855e3b2981c22d3cee0be5a049b6e0c Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Thu, 28 Jan 2021 15:23:37 +0000 Subject: [PATCH 119/145] adding mime types back in --- .github/workflows/release.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4a3742aeae..72c029985b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -154,6 +154,7 @@ jobs: 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 + asset_content_type: application/zip - name: upload macos zip release asset id: upload-macos-zip @@ -164,6 +165,7 @@ jobs: 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 + asset_content_type: application/zip - name: upload linux zip release asset id: upload-linux-zip @@ -174,6 +176,7 @@ jobs: 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 + asset_content_type: application/zip - name: Upload windows checksum release asset id: upload-windows-checksum @@ -184,6 +187,7 @@ jobs: 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 + asset_content_type: plain/text - name: Upload macos checksum release asset id: upload-macos-checksum @@ -194,6 +198,7 @@ jobs: 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 + asset_content_type: plain/text - name: Upload linux checksum release asset id: upload-linux-checksum @@ -204,6 +209,7 @@ jobs: 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 + asset_content_type: plain/text - name: Upload chocolatey nupkg release asset id: upload-choco-nupkg @@ -214,6 +220,7 @@ jobs: 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 + asset_content_type: application snap: From b0075ffbb7d24c911ce004d0aae9e76e4b468a7f Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Thu, 28 Jan 2021 15:44:27 +0000 Subject: [PATCH 120/145] changing asset fetch task and updating dependencies --- .github/workflows/release.yml | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 72c029985b..342facf373 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,6 +13,7 @@ jobs: runs-on: ubuntu-latest outputs: release_upload_url: ${{ steps.create_release.outputs.upload_url }} + package_version: ${{ steps.create_tags.outputs.release_name }} steps: - name: Checkout repo uses: actions/checkout@v2 @@ -33,6 +34,8 @@ jobs: exit 1 ;; esac + + echo "::set-output name=package_version::$RELEASE_NAME" env: RELEASE_TAG_NAME_INPUT: ${{ github.event.inputs.release_tag_name_input }} @@ -229,16 +232,12 @@ jobs: needs: - setup - cli + env: + PACKAGE_VERSION: ${{ needs.setup.outputs.package_version }} 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 @@ -253,11 +252,20 @@ jobs: GITHUB_REF: ${{ github.ref }} GITHUB_EVENT: ${{ github.event_name }} - - name: Get bw linux cli - uses: actions/download-artifact@v2 + - name: Get snap release asset + uses: dsaltares/fetch-gh-release-asset@0.0.5 with: + version: tags/${{ env.TAG_VERSION }} name: bw-linux-${{ env.PACKAGE_VERSION }}.zip - path: ./dist/snap + env: + 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.PACKAGE_VERSION }}_amd64.snap -t dist - name: Build Snap Package run: | From e83299f1f3b8a54ee7ded3a11ec78ada27a48446 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Thu, 28 Jan 2021 15:53:54 +0000 Subject: [PATCH 121/145] fixing asset fetch input --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 342facf373..e0e7b8f537 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -227,7 +227,7 @@ jobs: snap: - name: Publish Snap + name: Release Snap runs-on: ubuntu-latest needs: - setup @@ -256,7 +256,7 @@ jobs: uses: dsaltares/fetch-gh-release-asset@0.0.5 with: version: tags/${{ env.TAG_VERSION }} - name: bw-linux-${{ env.PACKAGE_VERSION }}.zip + file: bw-linux-${{ env.PACKAGE_VERSION }}.zip env: TAG_VERSION: ${{ needs.setup.outputs.tag_version }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From c76a7e9437b554936263c37bca543ceda516e823 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Thu, 28 Jan 2021 16:10:41 +0000 Subject: [PATCH 122/145] adding missing outputs --- .github/workflows/release.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e0e7b8f537..4d15df9ebb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,7 +13,8 @@ jobs: runs-on: ubuntu-latest outputs: release_upload_url: ${{ steps.create_release.outputs.upload_url }} - package_version: ${{ steps.create_tags.outputs.release_name }} + package_version: ${{ steps.create_tags.outputs.package_version }} + tag_version: ${{ steps.create_tags.outputs.tag_version }} steps: - name: Checkout repo uses: actions/checkout@v2 @@ -25,17 +26,19 @@ jobs: v) echo "RELEASE_NAME=${RELEASE_TAG_NAME_INPUT:1}" >> $GITHUB_ENV echo "RELEASE_TAG_NAME=$RELEASE_TAG_NAME_INPUT" >> $GITHUB_ENV + echo "::set-output name=package_version::${RELEASE_TAG_NAME_INPUT:1}" + echo "::set-output name=tag_version::$RELEASE_TAG_NAME_INPUT" ;; [0-9]) echo "RELEASE_NAME=$RELEASE_TAG_NAME_INPUT" >> $GITHUB_ENV echo "RELEASE_TAG_NAME=v$RELEASE_TAG_NAME_INPUT" >> $GITHUB_ENV + echo "::set-output name=package_version::$RELEASE_TAG_NAME_INPUT" + echo "::set-output name=tag_version::${RELEASE_TAG_NAME_INPUT:1}" ;; *) exit 1 ;; esac - - echo "::set-output name=package_version::$RELEASE_NAME" env: RELEASE_TAG_NAME_INPUT: ${{ github.event.inputs.release_tag_name_input }} From 368cb89da0a9900a3667fc35f984da7c03d11033 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Thu, 28 Jan 2021 16:27:16 +0000 Subject: [PATCH 123/145] fixing tag version --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4d15df9ebb..e754471be3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -33,7 +33,7 @@ jobs: echo "RELEASE_NAME=$RELEASE_TAG_NAME_INPUT" >> $GITHUB_ENV echo "RELEASE_TAG_NAME=v$RELEASE_TAG_NAME_INPUT" >> $GITHUB_ENV echo "::set-output name=package_version::$RELEASE_TAG_NAME_INPUT" - echo "::set-output name=tag_version::${RELEASE_TAG_NAME_INPUT:1}" + echo "::set-output name=tag_version::v$RELEASE_TAG_NAME_INPUT" ;; *) exit 1 From 58621fd265962766668d656c3a80e97203bb5ecf Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Thu, 28 Jan 2021 16:42:01 +0000 Subject: [PATCH 124/145] switching back to the artifact download task since the release won't be published yet --- .github/workflows/build.yml | 3 +-- .github/workflows/release.yml | 24 +++++++++++++----------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ac9d24f6fe..5555a24096 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -204,8 +204,7 @@ jobs: - name: Build Snap Package run: | - mkdir -p dist - cp -r stores/snap -t dist + cp -r stores/snap/* -t dist/snap sed -i s/__version__/${{ env.PACKAGE_VERSION }}/g dist/snap/snapcraft.yaml cd dist/snap diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e754471be3..ec65f4f8df 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -151,6 +151,12 @@ jobs: checksum -f="./dist/bw-linux-${env:PACKAGE_VERSION}.zip" ` -t sha256 | Out-File -Encoding ASCII ./dist/bw-linux-sha256-${env:PACKAGE_VERSION}.txt + - name: build artifact - linux zip + uses: actions/upload-artifact@v2 + with: + name: bw-linux-${{ env.PACKAGE_VERSION }}.zip + path: ./dist/bw-linux-${{ env.PACKAGE_VERSION }}.zip + - name: upload windows zip release asset id: upload-windows-zip uses: actions/upload-release-asset@v1 @@ -255,25 +261,21 @@ jobs: GITHUB_REF: ${{ github.ref }} GITHUB_EVENT: ${{ github.event_name }} - - name: Get snap release asset - uses: dsaltares/fetch-gh-release-asset@0.0.5 - with: - version: tags/${{ env.TAG_VERSION }} - file: bw-linux-${{ env.PACKAGE_VERSION }}.zip - env: - 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.PACKAGE_VERSION }}_amd64.snap -t dist + - name: get linux zip artifact + uses: actions/download-artifact@v2 + with: + name: bw-linux-${{ env.PACKAGE_VERSION }}.zip + path: ./dist/snap + - name: Build Snap Package run: | - mkdir -p dist - cp -r stores/snap -t dist + cp -r stores/snap/* -t dist/snap sed -i s/__version__/${{ env.PACKAGE_VERSION }}/g dist/snap/snapcraft.yaml cd dist/snap From 44e134b6dee5fa5273e474b093f21b012f5ab04f Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Thu, 28 Jan 2021 16:54:29 +0000 Subject: [PATCH 125/145] removing the 'move asset' task. no longer needed --- .github/workflows/release.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ec65f4f8df..a64598bb85 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -261,12 +261,6 @@ jobs: GITHUB_REF: ${{ github.ref }} GITHUB_EVENT: ${{ github.event_name }} - - 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.PACKAGE_VERSION }}_amd64.snap -t dist - - name: get linux zip artifact uses: actions/download-artifact@v2 with: From 180752fd834ef149dc56ae726ab15537cd42bfcc Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Thu, 28 Jan 2021 17:15:45 +0000 Subject: [PATCH 126/145] adding in missing mime types --- .github/workflows/release.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a64598bb85..80aa9d8a40 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -302,6 +302,7 @@ jobs: 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 + asset_content_type: application - name: Upload snap checksum release asset uses: actions/upload-release-asset@v1 @@ -311,3 +312,4 @@ jobs: 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 + asset_content_type: plain/text From 36f57aea511f3f8d58635b7f833667c8992dee0f Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Thu, 28 Jan 2021 17:44:06 +0000 Subject: [PATCH 127/145] fixing the deploy --- .github/workflows/deploy.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index b9a664989c..31901640da 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -55,7 +55,7 @@ jobs: 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 + mv bw_${{ needs.setup.outputs.package_version }}_amd64.snap -t dist - name: test run: ls -alht dist @@ -75,6 +75,7 @@ jobs: uses: actions/checkout@v2 - name: Setup Chocolatey + if: false run: choco apikey --key $env:CHOCO_API_KEY --source https://push.chocolatey.org/ env: CHOCO_API_KEY: ${{ secrets.CHOCO_API_KEY }} From 879ecd1075ed1172391cff358966cdcc56843617 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Thu, 28 Jan 2021 17:46:23 +0000 Subject: [PATCH 128/145] fixing the env vars --- .github/workflows/deploy.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 31901640da..832e912163 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -32,6 +32,9 @@ jobs: name: Publish Snap runs-on: ubuntu-latest needs: setup + environment: + PKG_VERSION: ${{ needs.setup.outputs.package_version }} + TAG_VERSION: ${{ needs.setup.outputs.tag_version }} steps: - name: Checkout repo uses: actions/checkout@v2 @@ -55,7 +58,7 @@ jobs: run: | echo "Hopefully this is temporary until release 0.0.6 of the fetch-gh-release-asset is released" mkdir dist - mv bw_${{ needs.setup.outputs.package_version }}_amd64.snap -t dist + mv bw_${{ env.PKG_VERSION }}_amd64.snap -t dist - name: test run: ls -alht dist @@ -70,6 +73,9 @@ jobs: name: Publish Choco runs-on: windows-latest needs: setup + environment: + PKG_VERSION: ${{ needs.setup.outputs.package_version }} + TAG_VERSION: ${{ needs.setup.outputs.tag_version }} steps: - name: Checkout repo uses: actions/checkout@v2 From 19bea422d0d357195db562b6c0f2b2c2a6019d17 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Thu, 28 Jan 2021 18:04:16 +0000 Subject: [PATCH 129/145] switching from environment to env --- .github/workflows/deploy.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 832e912163..c7764bfd41 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -32,7 +32,7 @@ jobs: name: Publish Snap runs-on: ubuntu-latest needs: setup - environment: + env: PKG_VERSION: ${{ needs.setup.outputs.package_version }} TAG_VERSION: ${{ needs.setup.outputs.tag_version }} steps: @@ -73,7 +73,7 @@ jobs: name: Publish Choco runs-on: windows-latest needs: setup - environment: + env: PKG_VERSION: ${{ needs.setup.outputs.package_version }} TAG_VERSION: ${{ needs.setup.outputs.tag_version }} steps: From c5b2cb17c882c551221512e7d287480e1f250d52 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Thu, 28 Jan 2021 18:46:23 +0000 Subject: [PATCH 130/145] trying different github action. adding manual workflow trigger for quicker testing --- .github/workflows/deploy.yml | 64 ++++++++++++++++++++++++++++-------- 1 file changed, 51 insertions(+), 13 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index c7764bfd41..da90273ae3 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,24 +1,53 @@ name: Deploy on: - release: - types: - - prereleased workflow_dispatch: inputs: + release_tag_name_input: + description: "Release Tag Name " + required: true + #release: + #types: + #- prereleased 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 }} + #package_version: ${{ steps.get_pkg_version.outputs.package_version }} + #tag_version: ${{ steps.get_pkg_version.outputs.tag_version }} + package_version: ${{ steps.create_tags.outputs.package_version }} + tag_version: ${{ steps.create_tags.outputs.tag_version }} 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 + echo "::set-output name=package_version::${RELEASE_TAG_NAME_INPUT:1}" + echo "::set-output name=tag_version::$RELEASE_TAG_NAME_INPUT" + ;; + [0-9]) + echo "RELEASE_NAME=$RELEASE_TAG_NAME_INPUT" >> $GITHUB_ENV + echo "RELEASE_TAG_NAME=v$RELEASE_TAG_NAME_INPUT" >> $GITHUB_ENV + echo "::set-output name=package_version::$RELEASE_TAG_NAME_INPUT" + echo "::set-output name=tag_version::v$RELEASE_TAG_NAME_INPUT" + ;; + *) + exit 1 + ;; + esac + env: + RELEASE_TAG_NAME_INPUT: ${{ github.event.inputs.release_tag_name_input }} + - name: Get package version + if: false id: get_pkg_version run: | TAG_VERSION=$(echo ${{ github.ref }} | cut -d "/" -f 3) @@ -86,15 +115,24 @@ jobs: env: CHOCO_API_KEY: ${{ secrets.CHOCO_API_KEY }} - - name: Get choco release asset - uses: dsaltares/fetch-gh-release-asset@0.0.5 + #- 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: Test getting choco release asset - windows + uses: Xotl/cool-github-releases@v1 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 }} + mode: download + tag_name: ${{ env.TAG_VERSION }} + assets: bitwarden.${{ env.PKG_VERSION }}.nupkg + github_token: ${{ secrets.GITHUB_TOKEN }} + - name: Push to Chocolatey shell: pwsh From 975f79697caa27423509ee4b54c6c8edaa75df29 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Thu, 28 Jan 2021 18:51:53 +0000 Subject: [PATCH 131/145] fixing choco package name --- .github/workflows/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index da90273ae3..b99836f3b9 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -130,7 +130,7 @@ jobs: with: mode: download tag_name: ${{ env.TAG_VERSION }} - assets: bitwarden.${{ env.PKG_VERSION }}.nupkg + assets: bitwarden-cli.${{ env.PKG_VERSION }}.nupkg github_token: ${{ secrets.GITHUB_TOKEN }} From 1a2e0336715c75426b3c3d95fb85e7fd2879eb48 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Thu, 28 Jan 2021 18:59:07 +0000 Subject: [PATCH 132/145] adding path to download to --- .github/workflows/deploy.yml | 69 +++++++++++++++++------------------- 1 file changed, 33 insertions(+), 36 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index b99836f3b9..be308674bc 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -6,56 +6,52 @@ on: release_tag_name_input: description: "Release Tag Name " required: true - #release: - #types: - #- prereleased + release: + types: + - prereleased 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 }} package_version: ${{ steps.create_tags.outputs.package_version }} tag_version: ${{ steps.create_tags.outputs.tag_version }} steps: - name: Checkout Repo uses: actions/checkout@v2 - - name: Create Release Vars + - name: Create Deploy version 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 - echo "::set-output name=package_version::${RELEASE_TAG_NAME_INPUT:1}" - echo "::set-output name=tag_version::$RELEASE_TAG_NAME_INPUT" - ;; - [0-9]) - echo "RELEASE_NAME=$RELEASE_TAG_NAME_INPUT" >> $GITHUB_ENV - echo "RELEASE_TAG_NAME=v$RELEASE_TAG_NAME_INPUT" >> $GITHUB_ENV - echo "::set-output name=package_version::$RELEASE_TAG_NAME_INPUT" - echo "::set-output name=tag_version::v$RELEASE_TAG_NAME_INPUT" - ;; - *) - exit 1 - ;; - esac + if [[ "${{ github.ref}}" -eq "release" ]]; then + 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 + echo "::set-output name=package_version::${RELEASE_TAG_NAME_INPUT:1}" + echo "::set-output name=tag_version::$RELEASE_TAG_NAME_INPUT" + ;; + [0-9]) + echo "RELEASE_NAME=$RELEASE_TAG_NAME_INPUT" >> $GITHUB_ENV + echo "RELEASE_TAG_NAME=v$RELEASE_TAG_NAME_INPUT" >> $GITHUB_ENV + echo "::set-output name=package_version::$RELEASE_TAG_NAME_INPUT" + echo "::set-output name=tag_version::v$RELEASE_TAG_NAME_INPUT" + ;; + *) + exit 1 + ;; + esac + else + 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" + fi env: RELEASE_TAG_NAME_INPUT: ${{ github.event.inputs.release_tag_name_input }} - - name: Get package version - if: false - 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 @@ -130,7 +126,7 @@ jobs: with: mode: download tag_name: ${{ env.TAG_VERSION }} - assets: bitwarden-cli.${{ env.PKG_VERSION }}.nupkg + assets: bitwarden-cli.${{ env.PKG_VERSION }}.nupkg|./dist/bitwarden-cli.${{ env.PKG_VERSION }}.nupkg github_token: ${{ secrets.GITHUB_TOKEN }} @@ -138,8 +134,9 @@ jobs: 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 + + #New-Item -ItemType directory -Path ./dist + #Move-Item -Path bitwarden-cli.${{ env.PKG_VERSION }}.nupkg -Destination ./dist cd ./dist #choco push From e35af6ea42d6beeebe1a669c85f37c09505cea61 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Thu, 28 Jan 2021 19:03:23 +0000 Subject: [PATCH 133/145] switching the build version var check --- .github/workflows/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index be308674bc..1c1f6c0429 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -24,7 +24,7 @@ jobs: - name: Create Deploy version vars id: create_tags run: | - if [[ "${{ github.ref}}" -eq "release" ]]; then + if [[ "${{ github.event_name }}" -eq "release" ]]; then case "${RELEASE_TAG_NAME_INPUT:0:1}" in v) echo "RELEASE_NAME=${RELEASE_TAG_NAME_INPUT:1}" >> $GITHUB_ENV From 9d10dcd63345b3dbd4cc07f3198a80b1def6cdd7 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Thu, 28 Jan 2021 19:08:06 +0000 Subject: [PATCH 134/145] trying without the ./ --- .github/workflows/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 1c1f6c0429..c3efd8ecf2 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -126,7 +126,7 @@ jobs: with: mode: download tag_name: ${{ env.TAG_VERSION }} - assets: bitwarden-cli.${{ env.PKG_VERSION }}.nupkg|./dist/bitwarden-cli.${{ env.PKG_VERSION }}.nupkg + assets: bitwarden-cli.${{ env.PKG_VERSION }}.nupkg|dist/bitwarden-cli.${{ env.PKG_VERSION }}.nupkg github_token: ${{ secrets.GITHUB_TOKEN }} From a833b984199e3c86ab00a5b2d33606a8b30d29ef Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Thu, 28 Jan 2021 19:10:37 +0000 Subject: [PATCH 135/145] switching back to manually creating the directory and moving the asset --- .github/workflows/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index c3efd8ecf2..9ff79854d5 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -126,7 +126,7 @@ jobs: with: mode: download tag_name: ${{ env.TAG_VERSION }} - assets: bitwarden-cli.${{ env.PKG_VERSION }}.nupkg|dist/bitwarden-cli.${{ env.PKG_VERSION }}.nupkg + assets: bitwarden-cli.${{ env.PKG_VERSION }}.nupkg github_token: ${{ secrets.GITHUB_TOKEN }} From e549fa389dbc5ce3d332bb2094d55c5ea9820ef1 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Thu, 28 Jan 2021 19:22:34 +0000 Subject: [PATCH 136/145] debugging dist --- .github/workflows/deploy.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 9ff79854d5..5f3852e9d4 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -54,7 +54,7 @@ jobs: snap: - name: Publish Snap + name: Deploy Snap runs-on: ubuntu-latest needs: setup env: @@ -95,7 +95,7 @@ jobs: choco: - name: Publish Choco + name: Deploy Choco runs-on: windows-latest needs: setup env: @@ -135,9 +135,10 @@ jobs: run: | # In place of ./scripts/choco-update.ps1 - #New-Item -ItemType directory -Path ./dist - #Move-Item -Path bitwarden-cli.${{ env.PKG_VERSION }}.nupkg -Destination ./dist - cd ./dist + New-Item -ItemType directory -Path ./dist + ls -atlh + Move-Item -Path bitwarden-cli.${{ env.PKG_VERSION }}.nupkg -Destination ./dist + cd dist #choco push - name: test From 11b9f2587166ffddbaf644e854d9e8d0966811a9 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Thu, 28 Jan 2021 19:29:08 +0000 Subject: [PATCH 137/145] updating Move-Item --- .github/workflows/deploy.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 5f3852e9d4..e085c53c17 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -136,8 +136,8 @@ jobs: # In place of ./scripts/choco-update.ps1 New-Item -ItemType directory -Path ./dist - ls -atlh - Move-Item -Path bitwarden-cli.${{ env.PKG_VERSION }}.nupkg -Destination ./dist + ls + Move-Item -Path bitwarden-cli.${{ env.PKG_VERSION }}.nupkg -Destination ./dist/bitwarden-cli.${{ env.PKG_VERSION }}.nupkg cd dist #choco push From 6e6b6c8b59b6639c08bcd6abb48418fdce3d5d3c Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Thu, 28 Jan 2021 19:35:39 +0000 Subject: [PATCH 138/145] trying the folder location again --- .github/workflows/deploy.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index e085c53c17..1cabac701c 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -121,12 +121,16 @@ jobs: # TAG_VERSION: ${{ needs.setup.outputs.tag_version }} # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: make dist dir + shell: pwsh + run: New-Item -ItemType directory -Path ./dist + - name: Test getting choco release asset - windows uses: Xotl/cool-github-releases@v1 with: mode: download tag_name: ${{ env.TAG_VERSION }} - assets: bitwarden-cli.${{ env.PKG_VERSION }}.nupkg + assets: bitwarden-cli.${{ env.PKG_VERSION }}.nupkg|./dist/bitwarden-cli.${{ env.PKG_VERSION }}.nupkg github_token: ${{ secrets.GITHUB_TOKEN }} @@ -135,14 +139,13 @@ jobs: run: | # In place of ./scripts/choco-update.ps1 - New-Item -ItemType directory -Path ./dist - ls - Move-Item -Path bitwarden-cli.${{ env.PKG_VERSION }}.nupkg -Destination ./dist/bitwarden-cli.${{ env.PKG_VERSION }}.nupkg + #New-Item -ItemType directory -Path ./dist + #Move-Item -Path bitwarden-cli.${{ env.PKG_VERSION }}.nupkg -Destination ./dist/bitwarden-cli.${{ env.PKG_VERSION }}.nupkg cd dist #choco push - name: test - run: ls -atlh dist + run: ls dist npm: From c1be8d9009e808b79aca5611bdd9c1d3803c5297 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Thu, 28 Jan 2021 19:45:55 +0000 Subject: [PATCH 139/145] switching other fetch release assset to xotl's --- .github/workflows/deploy.yml | 41 ++++++++---------------------------- 1 file changed, 9 insertions(+), 32 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 1cabac701c..9b4d359e08 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -69,21 +69,16 @@ jobs: #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: setup + run: mkdir dist - - 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 getting choco release asset - windows + uses: Xotl/cool-github-releases@v1 + with: + mode: download + tag_name: ${{ env.TAG_VERSION }} + assets: bw_${{ env.PKG_VERSION }}_amd64.snap|./dist/bw_${{ env.PKG_VERSION }}_amd64.snap + github_token: ${{ secrets.GITHUB_TOKEN }} - name: test run: ls -alht dist @@ -111,16 +106,6 @@ jobs: 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: make dist dir shell: pwsh run: New-Item -ItemType directory -Path ./dist @@ -133,20 +118,12 @@ jobs: assets: bitwarden-cli.${{ env.PKG_VERSION }}.nupkg|./dist/bitwarden-cli.${{ env.PKG_VERSION }}.nupkg 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-cli.${{ env.PKG_VERSION }}.nupkg -Destination ./dist/bitwarden-cli.${{ env.PKG_VERSION }}.nupkg cd dist #choco push - - name: test - run: ls dist - npm: name: Publish NPM From d6da00757b571e221d41d2b849f87db59a6e7d29 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Thu, 28 Jan 2021 20:06:04 +0000 Subject: [PATCH 140/145] version bump for release/deploy testing --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index dbe309d52d..35ad36549a 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.4", + "version": "1.13.5", "keywords": [ "bitwarden", "password", From 75e9deacf6ab5abf1cdaf6704135c2b84d4bb983 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Thu, 28 Jan 2021 20:19:44 +0000 Subject: [PATCH 141/145] changing release type from prereleased --- .github/workflows/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 9b4d359e08..0d6ec7bee4 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -8,7 +8,7 @@ on: required: true release: types: - - prereleased + - released jobs: From cc16245115a0131cb0c073ed75d3f442c11ad318 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Thu, 28 Jan 2021 20:22:36 +0000 Subject: [PATCH 142/145] adding published release type --- .github/workflows/deploy.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 0d6ec7bee4..37ae5cfa7f 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -9,6 +9,7 @@ on: release: types: - released + - published jobs: From 1f6d095ab1b7224ad939dc63d314dc175e0a15c8 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Thu, 28 Jan 2021 20:49:46 +0000 Subject: [PATCH 143/145] fixing the versions --- .github/workflows/deploy.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 37ae5cfa7f..376bd2be8c 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -8,7 +8,6 @@ on: required: true release: types: - - released - published @@ -25,7 +24,7 @@ jobs: - name: Create Deploy version vars id: create_tags run: | - if [[ "${{ github.event_name }}" -eq "release" ]]; then + if ! [[ "${{ github.event_name }}" -eq "release" ]]; then case "${RELEASE_TAG_NAME_INPUT:0:1}" in v) echo "RELEASE_NAME=${RELEASE_TAG_NAME_INPUT:1}" >> $GITHUB_ENV From d175590313445eeef2a3a8588ea2a0e85ce4d43b Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Thu, 28 Jan 2021 21:05:17 +0000 Subject: [PATCH 144/145] resetting testing code --- .github/workflows/deploy.yml | 16 +++++++--------- package.json | 4 ++-- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 376bd2be8c..aee82a8008 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -66,8 +66,8 @@ jobs: - name: Install Snapcraft uses: samuelmeuli/action-snapcraft@v1 - #with: - # snapcraft_token: ${{ secrets.SNAP_TOKEN }} + with: + snapcraft_token: ${{ secrets.SNAP_TOKEN }} - name: setup run: mkdir dist @@ -83,10 +83,10 @@ jobs: - name: test run: ls -alht dist - #- name: Publish Snap & logout - # run: | - # snapcraft push ./dist/bw_${{ env.PACKAGE_VERSION }}_amd64.snap --release stable - # snapcraft logout + - name: Publish Snap & logout + run: | + snapcraft push ./dist/bw_${{ env.PACKAGE_VERSION }}_amd64.snap --release stable + snapcraft logout choco: @@ -101,7 +101,6 @@ jobs: uses: actions/checkout@v2 - name: Setup Chocolatey - if: false run: choco apikey --key $env:CHOCO_API_KEY --source https://push.chocolatey.org/ env: CHOCO_API_KEY: ${{ secrets.CHOCO_API_KEY }} @@ -122,12 +121,11 @@ jobs: shell: pwsh run: | cd dist - #choco push + choco push npm: name: Publish NPM - if: false runs-on: ubuntu-latest steps: - name: Checkout repo diff --git a/package.json b/package.json index 35ad36549a..7c6f203615 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.5", + "version": "1.13.3", "keywords": [ "bitwarden", "password", @@ -13,7 +13,7 @@ "homepage": "https://bitwarden.com", "repository": { "type": "git", - "url": "https://github.com/joseph-flinn/cli" + "url": "https://github.com/bitwarden/cli" }, "license": "GPL-3.0", "scripts": { From cbae5a920d6c2bbe62b38b1ccdf472f71c7aa980 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Thu, 28 Jan 2021 21:07:15 +0000 Subject: [PATCH 145/145] flagging appveyor for delete --- appveyor.yml => appveyor.yml.flagged-for-delete | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename appveyor.yml => appveyor.yml.flagged-for-delete (100%) diff --git a/appveyor.yml b/appveyor.yml.flagged-for-delete similarity index 100% rename from appveyor.yml rename to appveyor.yml.flagged-for-delete