@ -13,10 +13,10 @@ on:
@@ -13,10 +13,10 @@ on:
jobs:
cloc:
name : CLOC
runs-on : ubuntu-20 .04
runs-on : ubuntu-22 .04
steps:
- name : Checkout repo
uses : actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name : Set up CLOC
run : |
@ -29,23 +29,23 @@ jobs:
@@ -29,23 +29,23 @@ jobs:
setup:
name : Setup
runs-on : ubuntu-20 .04
runs-on : ubuntu-22 .04
outputs:
package_version : ${{ steps.retrieve-version.outputs.package_version }}
steps:
- name : Checkout repo
uses : actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name : Get Package Version
id : retrieve-version
run : |
PKG_VERSION=$(jq -r .version src/package.json)
echo "::set-output name=package_version::$PKG_VERSION"
echo "package_version=$PKG_VERSION" >> $GITHUB_OUTPUT
linux-cli:
name : Build Linux CLI
runs-on : ubuntu-20 .04
runs-on : ubuntu-22 .04
needs : setup
env:
_PACKAGE_VERSION : ${{ needs.setup.outputs.package_version }}
@ -53,10 +53,10 @@ jobs:
@@ -53,10 +53,10 @@ jobs:
_PKG_FETCH_VERSION : 3.4
steps:
- name : Checkout repo
uses : actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name : Set up Node
uses : actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6 .0
uses : actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0 .0
with:
cache : 'npm'
cache-dependency-path : '**/package-lock.json'
@ -94,10 +94,12 @@ jobs:
@@ -94,10 +94,12 @@ jobs:
run : npm run dist:cli:lin
- name : Zip
run : zip -j ./ dist-cli/bwdc-linux-$_PACKAGE_VERSION.zip ./ dist-cli/linux/bwdc ./ keytar/linux/build/Release/keytar.node
run : zip -j dist-cli/bwdc-linux-$_PACKAGE_VERSION.zip dist-cli/linux/bwdc keytar/linux/build/Release/keytar.node
- name : Create checksums
run : sha256sum ./dist-cli/bwdc-linux-$_PACKAGE_VERSION.zip | cut -d " " -f 1 > ./dist-cli/bwdc-linux-sha256-$_PACKAGE_VERSION.txt
run : |
shasum -a 256 dist-cli/bwdc-linux-$_PACKAGE_VERSION.zip | \
cut -d " " -f 1 > dist-cli/bwdc-linux-sha256-$_PACKAGE_VERSION.txt
- name : Version Test
run : |
@ -122,14 +124,14 @@ jobs:
@@ -122,14 +124,14 @@ jobs:
fi
- name : Upload Linux Zip to GitHub
uses : actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
uses : actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
with:
name : bwdc-linux-${{ env._PACKAGE_VERSION }}.zip
path : ./dist-cli/bwdc-linux-${{ env._PACKAGE_VERSION }}.zip
if-no-files-found : error
- name : Upload Linux checksum to GitHub
uses : actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
uses : actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
with:
name : bwdc-linux-sha256-${{ env._PACKAGE_VERSION }}.txt
path : ./dist-cli/bwdc-linux-sha256-${{ env._PACKAGE_VERSION }}.txt
@ -138,7 +140,7 @@ jobs:
@@ -138,7 +140,7 @@ jobs:
macos-cli:
name : Build Mac CLI
runs-on : macos-11
runs-on : macos-12
needs : setup
env:
_PACKAGE_VERSION : ${{ needs.setup.outputs.package_version }}
@ -146,10 +148,10 @@ jobs:
@@ -146,10 +148,10 @@ jobs:
_PKG_FETCH_VERSION : 3.4
steps:
- name : Checkout repo
uses : actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name : Set up Node
uses : actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6 .0
uses : actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0 .0
with:
cache : 'npm'
cache-dependency-path : '**/package-lock.json'
@ -187,10 +189,12 @@ jobs:
@@ -187,10 +189,12 @@ jobs:
run : npm run dist:cli:mac
- name : Zip
run : zip -j ./ dist-cli/bwdc-macos-$_PACKAGE_VERSION.zip ./ dist-cli/macos/bwdc ./ keytar/macos/build/Release/keytar.node
run : zip -j dist-cli/bwdc-macos-$_PACKAGE_VERSION.zip dist-cli/macos/bwdc keytar/macos/build/Release/keytar.node
- name : Create checksums
run : sha256sum ./dist-cli/bwdc-macos-$_PACKAGE_VERSION.zip | cut -d " " -f 1 > ./dist-cli/bwdc-macos-sha256-$_PACKAGE_VERSION.txt
run : |
shasum -a 256 dist-cli/bwdc-macos-$_PACKAGE_VERSION.zip | \
cut -d " " -f 1 > dist-cli/bwdc-macos-sha256-$_PACKAGE_VERSION.txt
- name : Version Test
run : |
@ -208,23 +212,22 @@ jobs:
@@ -208,23 +212,22 @@ jobs:
fi
- name : Upload Mac Zip to GitHub
uses : actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
uses : actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
with:
name : bwdc-macos-${{ env._PACKAGE_VERSION }}.zip
path : ./dist-cli/bwdc-macos-${{ env._PACKAGE_VERSION }}.zip
if-no-files-found : error
- name : Upload Mac checksum to GitHub
uses : actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
uses : actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
with:
name : bwdc-macos-sha256-${{ env._PACKAGE_VERSION }}.txt
path : ./dist-cli/bwdc-macos-sha256-${{ env._PACKAGE_VERSION }}.txt
if-no-files-found : error
windows-cli:
name : Build Windows CLI
runs-on : windows-2019
runs-on : windows-2022
needs : setup
env:
_PACKAGE_VERSION : ${{ needs.setup.outputs.package_version }}
@ -232,7 +235,7 @@ jobs:
@@ -232,7 +235,7 @@ jobs:
_WIN_PKG_VERSION : 3.4
steps:
- name : Checkout repo
uses : actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name : Setup Windows builder
run : |
@ -240,7 +243,7 @@ jobs:
@@ -240,7 +243,7 @@ jobs:
choco install reshack --no-progress
- name : Set up Node
uses : actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6 .0
uses : actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0 .0
with:
cache : 'npm'
cache-dependency-path : '**/package-lock.json'
@ -334,15 +337,17 @@ jobs:
@@ -334,15 +337,17 @@ jobs:
- name : Zip
shell : cmd
run : 7z a ./dist-cli/bwdc-windows-%_PACKAGE_VERSION%.zip ./dist-cli/windows/bwdc.exe ./keytar/windows/keytar.node
run : |
7z a .\dist-cli\bwdc-windows-%_PACKAGE_VERSION%.zip .\dist-cli\windows\bwdc.exe .\keytar\windows\keytar.node
- name : Version Test
shell : pwsh
run : |
Expand-Archive -Path "./dist-cli/bwdc-windows-${env:_PACKAGE_VERSION}.zip" -DestinationPath "./test/ windows"
$testVersion = Invoke-Expression '& ./test/windows/ bwdc.exe -v'
echo "version: $env:_PACKAGE_VERSION"
Expand-Archive -Path "dist-cli\bwdc-windows-${{ env._PACKAGE_VERSION }}.zip" -DestinationPath "test\ windows"
$testVersion = Invoke-Expression '& .\test\windows\ bwdc.exe -v'
echo "version: ${ env:_PACKAGE_VERSION} "
echo "testVersion: $testVersion"
if($testVersion -ne $env:_PACKAGE_VERSION) {
if ($testVersion -ne ${ env:_PACKAGE_VERSION} ) {
Throw "Version test failed."
}
@ -352,14 +357,14 @@ jobs:
@@ -352,14 +357,14 @@ jobs:
-t sha256 | Out-File ./dist-cli/bwdc-windows-sha256-${env:_PACKAGE_VERSION}.txt
- name : Upload Windows Zip to GitHub
uses : actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
uses : actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
with:
name : bwdc-windows-${{ env._PACKAGE_VERSION }}.zip
path : ./dist-cli/bwdc-windows-${{ env._PACKAGE_VERSION }}.zip
if-no-files-found : error
- name : Upload Windows checksum to GitHub
uses : actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
uses : actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
with:
name : bwdc-windows-sha256-${{ env._PACKAGE_VERSION }}.txt
path : ./dist-cli/bwdc-windows-sha256-${{ env._PACKAGE_VERSION }}.txt
@ -368,21 +373,17 @@ jobs:
@@ -368,21 +373,17 @@ jobs:
windows-gui:
name : Build Windows GUI
runs-on : windows-2019
runs-on : windows-2022
needs : setup
env:
NODE_OPTIONS : --max_old_space_size=4096
_PACKAGE_VERSION : ${{ needs.setup.outputs.package_version }}
steps:
- name : Checkout repo
uses : actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- name : Set up dotnet
uses : actions/setup-dotnet@9211491ffb35dd6a6657ca4f45d43dfe6e97c829 # v3.0.3
with:
dotnet-version : '6.0.x'
uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name : Set up Node
uses : actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6 .0
uses : actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
with:
cache : 'npm'
cache-dependency-path : '**/package-lock.json'
@ -393,24 +394,17 @@ jobs:
@@ -393,24 +394,17 @@ jobs:
npm install -g node-gyp
node-gyp install $(node -v)
- 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 : Print environment
run : |
node --version
npm --version
- name : Install AST
uses : bitwarden/gh-actions/install-ast@dfc4cc6b2a38bd189db29cd88b9381a143b04dfc
uses : bitwarden/gh-actions/install-ast@main
- name : Install Node dependencies
run : npm install
# - name: Run linter
# run: npm run lint
- name : Build & Sign
run : npm run dist:win
env:
@ -422,28 +416,28 @@ jobs:
@@ -422,28 +416,28 @@ jobs:
SIGNING_CERT_NAME : ${{ secrets.SIGNING_CERT_NAME }}
- name : Upload Portable Executable to GitHub
uses : actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
uses : actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
with:
name : Bitwarden-Connector-Portable-${{ env._PACKAGE_VERSION }}.exe
path : ./dist/Bitwarden-Connector-Portable-${{ env._PACKAGE_VERSION }}.exe
if-no-files-found : error
- name : Upload Installer Executable to GitHub
uses : actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
uses : actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
with:
name : Bitwarden-Connector-Installer-${{ env._PACKAGE_VERSION }}.exe
path : ./dist/Bitwarden-Connector-Installer-${{ env._PACKAGE_VERSION }}.exe
if-no-files-found : error
- name : Upload Installer Executable Blockmap to GitHub
uses : actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
uses : actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
with:
name : Bitwarden-Connector-Installer-${{ env._PACKAGE_VERSION }}.exe.blockmap
path : ./dist/Bitwarden-Connector-Installer-${{ env._PACKAGE_VERSION }}.exe.blockmap
if-no-files-found : error
- name : Upload latest auto-update artifact
uses : actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
uses : actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
with:
name : latest.yml
path : ./dist/latest.yml
@ -452,16 +446,17 @@ jobs:
@@ -452,16 +446,17 @@ jobs:
linux-gui:
name : Build Linux GUI
runs-on : ubuntu-20 .04
runs-on : ubuntu-22 .04
needs : setup
env:
NODE_OPTIONS : --max_old_space_size=4096
_PACKAGE_VERSION : ${{ needs.setup.outputs.package_version }}
steps:
- name : Checkout repo
uses : actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name : Set up Node
uses : actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6 .0
uses : actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0 .0
with:
cache : 'npm'
cache-dependency-path : '**/package-lock.json'
@ -472,9 +467,6 @@ jobs:
@@ -472,9 +467,6 @@ jobs:
npm install -g node-gyp
node-gyp install $(node -v)
- name : Set Node options
run : echo "NODE_OPTIONS=--max_old_space_size=4096" >> $GITHUB_ENV
- name : Set up environment
run : |
sudo apt-get update
@ -491,14 +483,14 @@ jobs:
@@ -491,14 +483,14 @@ jobs:
run : npm run dist:lin
- name : Upload AppImage
uses : actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
uses : actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
with:
name : Bitwarden-Connector-${{ env._PACKAGE_VERSION }}-x86_64.AppImage
path : ./dist/Bitwarden-Connector-${{ env._PACKAGE_VERSION }}-x86_64.AppImage
if-no-files-found : error
- name : Upload latest auto-update artifact
uses : actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
uses : actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
with:
name : latest-linux.yml
path : ./dist/latest-linux.yml
@ -507,16 +499,17 @@ jobs:
@@ -507,16 +499,17 @@ jobs:
macos-gui:
name : Build MacOS GUI
runs-on : macos-11
runs-on : macos-12
needs : setup
env:
NODE_OPTIONS : --max_old_space_size=4096
_PACKAGE_VERSION : ${{ needs.setup.outputs.package_version }}
steps:
- name : Checkout repo
uses : actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name : Set up Node
uses : actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6 .0
uses : actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0 .0
with:
cache : 'npm'
cache-dependency-path : '**/package-lock.json'
@ -527,9 +520,6 @@ jobs:
@@ -527,9 +520,6 @@ jobs:
npm install -g node-gyp
node-gyp install $(node -v)
- name : Set Node options
run : echo "NODE_OPTIONS=--max_old_space_size=4096" >> $GITHUB_ENV
- name : Print environment
run : |
node --version
@ -588,9 +578,6 @@ jobs:
@@ -588,9 +578,6 @@ jobs:
- name : Install Node dependencies
run : npm install
# - name: Run linter
# run: npm run lint
- name : Build application
run : npm run dist:mac
env:
@ -598,28 +585,28 @@ jobs:
@@ -598,28 +585,28 @@ jobs:
APPLE_ID_PASSWORD : ${{ secrets.APPLE_ID_PASSWORD }}
- name : Upload .zip artifact
uses : actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
uses : actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
with:
name : Bitwarden-Connector-${{ env._PACKAGE_VERSION }}-mac.zip
path : ./dist/Bitwarden-Connector-${{ env._PACKAGE_VERSION }}-mac.zip
if-no-files-found : error
- name : Upload .dmg artifact
uses : actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
uses : actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
with:
name : Bitwarden-Connector-${{ env._PACKAGE_VERSION }}.dmg
path : ./dist/Bitwarden-Connector-${{ env._PACKAGE_VERSION }}.dmg
if-no-files-found : error
- name : Upload .dmg Blockmap artifact
uses : actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
uses : actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
with:
name : Bitwarden-Connector-${{ env._PACKAGE_VERSION }}.dmg.blockmap
path : ./dist/Bitwarden-Connector-${{ env._PACKAGE_VERSION }}.dmg.blockmap
if-no-files-found : error
- name : Upload latest auto-update artifact
uses : actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
uses : actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
with:
name : latest-mac.yml
path : ./dist/latest-mac.yml
@ -628,7 +615,7 @@ jobs:
@@ -628,7 +615,7 @@ jobs:
check-failures:
name : Check for failures
runs-on : ubuntu-20 .04
runs-on : ubuntu-22 .04
needs:
- cloc
- setup
@ -669,7 +656,7 @@ jobs:
@@ -669,7 +656,7 @@ jobs:
exit 1
fi
- name : Login to Azure - Prod S ubscription
- name : Login to Azure - CI s ubscription
uses : Azure/login@92a5484dfaf04ca78a94597f4f19fea633851fa2 # v1.4.7
if : failure()
with:
@ -677,18 +664,11 @@ jobs:
@@ -677,18 +664,11 @@ jobs:
- name : Retrieve secrets
id : retrieve-secrets
uses : bitwarden/gh-actions/get-keyvault-secrets@main
if : failure()
env:
KEYVAULT : bitwarden-ci
SECRETS : |
devops-alerts-slack-webhook-url
run : |
for i in ${SECRETS//,/ }
do
VALUE=$(az keyvault secret show --vault-name $KEYVAULT --name $i --query value --output tsv)
echo "::add-mask::$VALUE"
echo "::set-output name=$i::$VALUE"
done
with:
keyvault : "bitwarden-ci"
secrets : "devops-alerts-slack-webhook-url"
- name : Notify Slack on failure
uses : act10ns/slack@ed1309ab9862e57e9e583e51c7889486b9a00b0f # v2.0.0