From 45eaa24b0c83de4f06ab7e77e4a9d48768f556f0 Mon Sep 17 00:00:00 2001 From: Joseph Flinn <58369717+joseph-flinn@users.noreply.github.com> Date: Wed, 11 Aug 2021 15:38:05 -0700 Subject: [PATCH] Removing branch constraints on when to expose build assets (#359) * Removing branch constraints on when to expose build assets * updating to snap 5.0 * adding more snapcraft 5.0 specific updates * installing multipass * fixing syntax error * switching from using a VM via multipass to using lxd * trying the official snap build actions * fixing error * commenting out the snapcraft version * testing the new changes to the snapcraft.yml file * nameing the build snap task * naming the build snap task --- .github/workflows/build.yml | 28 +++++++++++++++------------- .github/workflows/release.yml | 11 ++++++++++- stores/snap/snapcraft.yaml | 5 +++-- 3 files changed, 28 insertions(+), 16 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 35150ea118..68f604cd38 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -115,7 +115,6 @@ jobs: } - name: Create checksums - if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/rc' run: | checksum -f="./dist/bw-windows-${env:PACKAGE_VERSION}.zip" ` -t sha256 | Out-File -Encoding ASCII ./dist/bw-windows-sha256-${env:PACKAGE_VERSION}.txt @@ -125,49 +124,42 @@ jobs: -t sha256 | Out-File -Encoding ASCII ./dist/bw-linux-sha256-${env:PACKAGE_VERSION}.txt - name: Upload windows zip asset - if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/rc' uses: actions/upload-artifact@v2 with: name: bw-windows-${{ env.PACKAGE_VERSION }}.zip path: ./dist/bw-windows-${{ env.PACKAGE_VERSION }}.zip - name: Upload windows checksum asset - if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/rc' uses: actions/upload-artifact@v2 with: name: bw-windows-sha256-${{ env.PACKAGE_VERSION }}.txt path: ./dist/bw-windows-sha256-${{ env.PACKAGE_VERSION }}.txt - name: Upload macos zip asset - if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/rc' uses: actions/upload-artifact@v2 with: name: bw-macos-${{ env.PACKAGE_VERSION }}.zip path: ./dist/bw-macos-${{ env.PACKAGE_VERSION }}.zip - name: Upload macos checksum asset - if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/rc' uses: actions/upload-artifact@v2 with: name: bw-macos-sha256-${{ env.PACKAGE_VERSION }}.txt path: ./dist/bw-macos-sha256-${{ env.PACKAGE_VERSION }}.txt - name: Upload linux zip asset - if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/rc' uses: actions/upload-artifact@v2 with: name: bw-linux-${{ env.PACKAGE_VERSION }}.zip path: ./dist/bw-linux-${{ env.PACKAGE_VERSION }}.zip - name: Upload linux checksum asset - if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/rc' uses: actions/upload-artifact@v2 with: name: bw-linux-sha256-${{ env.PACKAGE_VERSION }}.txt path: ./dist/bw-linux-sha256-${{ env.PACKAGE_VERSION }}.txt - name: Upload Chocolatey asset - if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/rc' uses: actions/upload-artifact@v2 with: name: bitwarden-cli.${{ env.PACKAGE_VERSION }}.nupkg @@ -178,7 +170,6 @@ jobs: name: Build Snap runs-on: ubuntu-latest needs: cli - if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/rc' steps: - name: Checkout repo uses: actions/checkout@v2 @@ -189,13 +180,15 @@ jobs: $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: Install Snapcraft + # uses: samuelmeuli/action-snapcraft@v1 + # with: + # use_lxd: true - name: Print environment run: | whoami - snapcraft --version + #snapcraft --version echo "GitHub ref: $GITHUB_REF" echo "GitHub event: $GITHUB_EVENT" echo "BW Package Version: $PACKAGE_VERSION" @@ -216,8 +209,17 @@ jobs: cd dist/snap ls -alth - snapcraft + - name: Build snap + uses: snapcore/action-build@6dd3202e55fccbcf8482a61f38fe630d655a2728 # v1.0.8 + with: + path: dist/snap + + - name: Create checksum + run: | + #sg lxd -c 'snapcraft --use-lxd' + cd dist/snap + ls -alth sha256sum bw_${{ env.PACKAGE_VERSION }}_amd64.snap | awk '{split($0, a); print a[1]}' > bw-snap-sha256-${{ env.PACKAGE_VERSION }}.txt - name: Install Snap diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index da834f51bb..eeafdce0ed 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -290,8 +290,17 @@ jobs: cd dist/snap ls -alth - snapcraft + - name: Build snap + uses: snapcore/action-build@6dd3202e55fccbcf8482a61f38fe630d655a2728 # v1.0.8 + with: + path: dist/snap + + - name: Create checksum + run: | + #sg lxd -c 'snapcraft --use-lxd' + cd dist/snap + ls -alth sha256sum bw_${{ env.PACKAGE_VERSION }}_amd64.snap | awk '{split($0, a); print a[1]}' > bw-snap-sha256-${{ env.PACKAGE_VERSION }}.txt - name: Install Snap diff --git a/stores/snap/snapcraft.yaml b/stores/snap/snapcraft.yaml index 58a538dab4..b358a58687 100644 --- a/stores/snap/snapcraft.yaml +++ b/stores/snap/snapcraft.yaml @@ -11,6 +11,7 @@ apps: parts: bw: plugin: dump - source: bw-linux-$SNAPCRAFT_PROJECT_VERSION.zip - prepare: | + source: ./bw-linux-$SNAPCRAFT_PROJECT_VERSION.zip + override-build: | chmod +x bw + snapcraftctl build