From ef7b1d9a19a4d0bada649bf5658f4d79c59b3d60 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Fri, 22 Jan 2021 02:46:11 +0000 Subject: [PATCH] moving the choco update script into the release pipeline and the build pipeline --- .github/workflows/build.yml | 18 ++++++++++++++++++ .github/workflows/release.yml | 11 ++++++++++- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1ce0a04f..7e7e89c5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -184,6 +184,17 @@ jobs: Copy-Item "./dist/Bitwarden-${{ env.PACKAGE_VERSION }}-x64.appx" ` -Destination "./dist/Bitwarden-${{ env.PACKAGE_VERSION }}-x64-store.appx" + - name: Deploy to Chocolatey + shell: pwsh + run: | + Copy-Item -Path ./stores/chocolatey -Destination ./chocolatey -Recurse + Copy-Item -Path ./dist/Bitwarden-Installer-${{ env.PACKAGE_VERSION }}.exe -Destination ./chocolatey + + $checksum = checksum -t sha256 ./chocoloatey/Bitwarden-Installer-${{ env.PACKAGE_VERSION }}.exe + $chocoInstall = "./chocolatey/tools/chocolateyinstall.ps1" + (Get-Content $chocoInstall).replace('__version__', ${{ env.PACKAGE_VERSION }}).replace('__checksum__', $checksum) | Set-Content $chocoInstall + choco pack ./chocolatey/bitwarden.nuspec --version ${{ env.PACKAGE_VERSION }} --out ./chocolately + - name: Upload portable exe artifact if: github.ref == 'refs/heads/master' uses: actions/upload-artifact@v2 @@ -212,6 +223,13 @@ jobs: name: Bitwarden-${{ env.PACKAGE_VERSION }}-x64-store.appx path: ./dist/Bitwarden-${{ env.PACKAGE_VERSION }}-x64-store.appx + - name: Upload nupkg artifact + if: github.ref == 'refs/heads/master' + uses: actions/upload-artifact@v2 + with: + name: bitwarden.${{ env.PACKAGE_VERSION }}.nupkg + path: ./dist/chocolatey/bitwarden.${{ env.PACKAGE_VERSION }}.nupkg + macos: runs-on: macos-latest steps: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index db38a110..7a5912cf 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -259,7 +259,16 @@ jobs: - name: Deploy to Chocolatey shell: pwsh - run: ./scripts/choco-update.ps1 -version $env:PACKAGE_VERSION + run: | + Copy-Item -Path ./stores/chocolatey -Destination ./dist/chocolatey -Recurse + Copy-Item -Path ./dist/Bitwarden-Installer-${{ env.PACKAGE_VERSION }}.exe -Destination ./dist/chocolatey + + $checksum = checksum -t sha256 ./dist/chocoloatey/Bitwarden-Installer-${{ env.PACKAGE_VERSION }}.exe + $chocoInstall = "./dist/chocolatey/tools/chocolateyinstall.ps1" + (Get-Content $chocoInstall).replace('__version__', ${{ env.PACKAGE_VERSION }}).replace('__checksum__', $checksum) | Set-Content $chocoInstall + choco pack ./dist/chocolatey/bitwarden.nuspec --version ${{ env.PACKAGE_VERSION }} --out ./dist/chocolately + cd ./dist/chocolately + #choco push - name: Upload Chocolatey nupkg release asset id: upload-macos-checksum