1
0
mirror of https://github.com/bitwarden/browser.git synced 2025-01-24 21:41:33 +01:00

Merge pull request #2 from joseph-flinn/migrate-appveyor-to-actions

Migrate appveyor to actions
This commit is contained in:
Joseph Flinn 2021-01-27 11:50:51 -08:00 committed by GitHub
commit bd528ebecf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 494 additions and 110 deletions

View File

@ -1,15 +1,9 @@
name: build & publish name: Build
on: on:
workflow_dispatch: push:
branches-ignore:
#on: - 'l10n_master'
# push:
# branches-ignore:
# - 'l10n_master'
# release:
# types:
# - published
jobs: jobs:
cloc: cloc:
@ -26,7 +20,7 @@ jobs:
- name: Print lines of code - name: Print lines of code
run: cloc --include-lang TypeScript,JavaScript --vcs git run: cloc --include-lang TypeScript,JavaScript --vcs git
build: windows:
name: Build CLI name: Build CLI
runs-on: windows-latest runs-on: windows-latest
steps: steps:
@ -34,7 +28,9 @@ jobs:
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Setup Windows builder - 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 - name: Set up Node
uses: actions/setup-node@v1 uses: actions/setup-node@v1
@ -45,29 +41,34 @@ jobs:
run: | 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 "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" 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: 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 - name: get pkg-fetch
shell: pwsh
run: | run: |
echo "version: $env:PACKAGE_VERSION" cd $HOME
$fetchedUrl = "https://github.com/vercel/pkg-fetch/releases/download/v2.5/uploaded-v2.5-node-v10.4.1-win-x64"
if($env:PACKAGE_VERSION -eq "") {
Throw "test env failed."
}
- name: 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: ResourceHacker - name: Setup Version Info
shell: pwsh
run: ./scripts/make-versioninfo.ps1
- name: Resource Hacker
shell: cmd
run: | run: |
if defined VER_INFO ResourceHacker -open %WIN_PKG% -save %WIN_PKG% -action delete -mask ICONGROUP,1, set PATH=%PATH%;C:\Program Files (x86)\Resource Hacker
if defined VER_INFO ResourceHacker -open version-info.rc -save version-info.res -action compile ResourceHacker -open %WIN_PKG% -save %WIN_PKG% -action delete -mask ICONGROUP,1,
if defined VER_INFO ResourceHacker -open %WIN_PKG% -save %WIN_PKG% -action addoverwrite -resource version-info.res 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 - name: Install
run: npm install run: npm install
@ -75,20 +76,17 @@ jobs:
- name: Setup sub-module - name: Setup sub-module
run: npm run sub:init run: npm run sub:init
- name: Build - name: Build & Package
run: npm run build:prod run: npm run dist
- name: Clean Build - name: Package Chocolatey
run: npm run clean 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
- name: Package Windows choco pack dist/chocolatey/bitwarden-cli.nuspec --version ${{ env.PACKAGE_VERSION }} --out dist/chocolatey
run: npm run package:win
- name: Package Mac
run: npm run package:mac
- name: Package Linux
run: npm run package:lin
- name: Zip - name: Zip
shell: cmd shell: cmd
@ -109,10 +107,9 @@ jobs:
Throw "Version test failed." Throw "Version test failed."
} }
- name: Package & Create checksums - name: Create checksums
if: github.ref == 'refs/heads/master'
run: | run: |
.\scripts\choco-pack.ps1
checksum -f="./dist/bw-windows-${env:PACKAGE_VERSION}.zip" ` checksum -f="./dist/bw-windows-${env:PACKAGE_VERSION}.zip" `
-t sha256 | Out-File -Encoding ASCII ./dist/bw-windows-sha256-${env:PACKAGE_VERSION}.txt -t sha256 | Out-File -Encoding ASCII ./dist/bw-windows-sha256-${env:PACKAGE_VERSION}.txt
checksum -f="./dist/bw-macos-${env:PACKAGE_VERSION}.zip" ` checksum -f="./dist/bw-macos-${env:PACKAGE_VERSION}.zip" `
@ -121,78 +118,70 @@ jobs:
-t sha256 | Out-File -Encoding ASCII ./dist/bw-linux-sha256-${env:PACKAGE_VERSION}.txt -t sha256 | Out-File -Encoding ASCII ./dist/bw-linux-sha256-${env:PACKAGE_VERSION}.txt
- name: Publish windows zip to GitHub - name: Publish windows zip to GitHub
if: github.ref == 'refs/heads/master'
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v2
with: with:
name: bw-windows-${{ env.PACKAGE_VERSION }}.zip name: bw-windows-${{ env.PACKAGE_VERSION }}.zip
path: ./dist/bw-windows-${{ env.PACKAGE_VERSION }}.zip path: ./dist/bw-windows-${{ env.PACKAGE_VERSION }}.zip
- name: Publish windows checksum to GitHub - name: Publish windows checksum to GitHub
if: github.ref == 'refs/heads/master'
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v2
with: with:
name: bw-windows-sha256-${{ env.PACKAGE_VERSION }}.txt name: bw-windows-sha256-${{ env.PACKAGE_VERSION }}.txt
path: ./dist/bw-windows-sha256-${{ env.PACKAGE_VERSION }}.txt path: ./dist/bw-windows-sha256-${{ env.PACKAGE_VERSION }}.txt
- name: Publish macos zip to GitHub - name: Publish macos zip to GitHub
if: github.ref == 'refs/heads/master'
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v2
with: with:
name: bw-macos-${{ env.PACKAGE_VERSION }}.zip name: bw-macos-${{ env.PACKAGE_VERSION }}.zip
path: ./dist/bw-macos-${{ env.PACKAGE_VERSION }}.zip path: ./dist/bw-macos-${{ env.PACKAGE_VERSION }}.zip
- name: Publish macos checksum to GitHub - name: Publish macos checksum to GitHub
if: github.ref == 'refs/heads/master'
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v2
with: with:
name: bw-macos-sha256-${{ env.PACKAGE_VERSION }}.txt name: bw-macos-sha256-${{ env.PACKAGE_VERSION }}.txt
path: ./dist/bw-macos-sha256-${{ env.PACKAGE_VERSION }}.txt path: ./dist/bw-macos-sha256-${{ env.PACKAGE_VERSION }}.txt
- name: Publish linux zip to GitHub - name: Publish linux zip to GitHub
if: github.ref == 'refs/heads/master'
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v2
with: with:
name: bw-linux-${{ env.PACKAGE_VERSION }}.zip name: bw-linux-${{ env.PACKAGE_VERSION }}.zip
path: ./dist/bw-linux-${{ env.PACKAGE_VERSION }}.zip path: ./dist/bw-linux-${{ env.PACKAGE_VERSION }}.zip
- name: Publish linux checksum to GitHub - name: Publish linux checksum to GitHub
if: github.ref == 'refs/heads/master'
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v2
with: with:
name: bw-linux-sha256-${{ env.PACKAGE_VERSION }}.txt name: bw-linux-sha256-${{ env.PACKAGE_VERSION }}.txt
path: ./dist/bw-linux-sha256-${{ env.PACKAGE_VERSION }}.txt path: ./dist/bw-linux-sha256-${{ env.PACKAGE_VERSION }}.txt
- name: Publish Chocolatey CLI - name: Publish Chocolatey CLI
if: github.ref == 'refs/heads/master'
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v2
with: with:
name: bitwarden-cli.${{ env.PACKAGE_VERSION }}.nupkg name: bitwarden-cli.${{ env.PACKAGE_VERSION }}.nupkg
path: ./dist/chocolatey/bitwarden-cli.${{ env.PACKAGE_VERSION }}.nupkg path: ./dist/chocolatey/bitwarden-cli.${{ env.PACKAGE_VERSION }}.nupkg
publish_windows: linux:
name: Publish Windows name: Build Snap
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
# This process seems independent from the others
publish_snap:
name: Publish Snap
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: build
if: github.event_name == 'release'
steps: steps:
- name: Checkout repo - name: Checkout repo
uses: actions/checkout@v2 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 - name: Install Snapcraft
uses: samuelmeuli/action-snapcraft@v1 uses: samuelmeuli/action-snapcraft@v1
with:
snapcraft_token: ${{ secrets.SNAP_TOKEN }}
- name: Print environment - name: Print environment
run: | run: |
@ -200,15 +189,24 @@ jobs:
snapcraft --version snapcraft --version
echo "GitHub ref: $GITHUB_REF" echo "GitHub ref: $GITHUB_REF"
echo "GitHub event: $GITHUB_EVENT" echo "GitHub event: $GITHUB_EVENT"
echo "BW Package Version: $PACKAGE_VERSION"
env: env:
GITHUB_REF: ${{ github.ref }} GITHUB_REF: ${{ github.ref }}
GITHUB_EVENT: ${{ github.event_name }} GITHUB_EVENT: ${{ github.event_name }}
- name: Install Snap - name: Build Snap Package
shell: pwsh
run: | run: |
./scripts/snap-build.ps1 -version $env:PACKAGE_VERSION mkdir ./dist
snap install ./dist/snap/bw*.snap --dangerous 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 - name: Test Snap
shell: pwsh shell: pwsh
@ -221,32 +219,18 @@ jobs:
- name: Cleanup Test & Update Snap for Publish - name: Cleanup Test & Update Snap for Publish
shell: pwsh shell: pwsh
run: | run: |
snap remove bw sudo snap remove bw
./scripts/snap-update.ps1
- name: Publish - name: Publish snap to GitHub
shell: pwsh if: github.ref == 'refs/heads/master'
run: | uses: actions/upload-artifact@v2
echo "<stub for publishing snap to github release>" with:
echo "./dist/snap/bw_${PACKAGE_VERSION}_amd64.snap" name: bw_${{ env.PACKAGE_VERSION }}_amd64.snap
path: ./dist/snap/bw_${{ env.PACKAGE_VERSION }}_amd64.snap
- name: Snap Logout - name: Publish snap checksum to GitHub
run: snapcraft logout if: github.ref == 'refs/heads/master'
uses: actions/upload-artifact@v2
with:
# This job is independent: it reruns 'npm run build:prod' name: bw-snap-sha256-${{ env.PACKAGE_VERSION }}.txt
publish_npm: path: ./dist/snap/bw-snap-sha256-${{ env.PACKAGE_VERSION }}.txt
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

121
.github/workflows/deploy.yml vendored Normal file
View File

@ -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

View File

@ -1,11 +0,0 @@
name: Windows Environment Exploration
on:
workflow_dispatch:
jobs:
exp:
runs-on: ubuntu-latest
steps:
- name: Test pkg
run: pkg --help

290
.github/workflows/release.yml vendored Normal file
View File

@ -0,0 +1,290 @@
name: Release
on:
workflow_dispatch:
inputs:
release_tag_name_input:
description: "Release Tag Name <X.X.X>"
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

View File

@ -1,7 +1,7 @@
{ {
"name": "@bitwarden/cli", "name": "@bitwarden/cli",
"description": "A secure and free password manager for all of your devices.", "description": "A secure and free password manager for all of your devices.",
"version": "1.13.3", "version": "1.13.4",
"keywords": [ "keywords": [
"bitwarden", "bitwarden",
"password", "password",
@ -13,7 +13,7 @@
"homepage": "https://bitwarden.com", "homepage": "https://bitwarden.com",
"repository": { "repository": {
"type": "git", "type": "git",
"url": "https://github.com/bitwarden/cli" "url": "https://github.com/joseph-flinn/cli"
}, },
"license": "GPL-3.0", "license": "GPL-3.0",
"scripts": { "scripts": {