From 20dcfe8ad3a5e25f3e5ee053f6f1af3bb4a0a810 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Fri, 8 Jan 2021 23:28:32 +0000 Subject: [PATCH] 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 0f0813abf5d..6e44d16a5d0 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