mirror of
https://github.com/bitwarden/directory-connector
synced 2025-12-16 00:04:34 +00:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8072c523cc | ||
|
|
f96429a47b |
160
.github/workflows/build.yml
vendored
160
.github/workflows/build.yml
vendored
@@ -1,4 +1,3 @@
|
|||||||
---
|
|
||||||
name: Build
|
name: Build
|
||||||
|
|
||||||
on:
|
on:
|
||||||
@@ -11,8 +10,7 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
cloc:
|
cloc:
|
||||||
name: CLOC
|
runs-on: ubuntu-latest
|
||||||
runs-on: ubuntu-20.04
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
||||||
@@ -26,8 +24,7 @@ jobs:
|
|||||||
|
|
||||||
|
|
||||||
setup:
|
setup:
|
||||||
name: Setup
|
runs-on: ubuntu-latest
|
||||||
runs-on: ubuntu-20.04
|
|
||||||
outputs:
|
outputs:
|
||||||
package_version: ${{ steps.get_version.outputs.package_version }}
|
package_version: ${{ steps.get_version.outputs.package_version }}
|
||||||
steps:
|
steps:
|
||||||
@@ -39,17 +36,14 @@ jobs:
|
|||||||
shell: pwsh
|
shell: pwsh
|
||||||
run: |
|
run: |
|
||||||
$env:pkgVersion = (Get-Content -Raw -Path ./src/package.json | ConvertFrom-Json).version
|
$env:pkgVersion = (Get-Content -Raw -Path ./src/package.json | ConvertFrom-Json).version
|
||||||
echo "::set-output name=package_version::$env:pkgVersion"
|
echo "::set-output name=PACKAGE_VERSION::$env:pkgVersion"
|
||||||
|
|
||||||
|
|
||||||
cli:
|
cli:
|
||||||
name: CLI
|
runs-on: windows-latest
|
||||||
runs-on: windows-2019
|
|
||||||
needs: setup
|
needs: setup
|
||||||
env:
|
env:
|
||||||
_PACKAGE_VERSION: ${{ needs.setup.outputs.package_version }}
|
PACKAGE_VERSION: ${{ needs.setup.outputs.package_version }}
|
||||||
_WIN_PKG_FETCH_VERSION: 14.17.0
|
|
||||||
_WIN_PKG_VERSION: 3.1
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
||||||
@@ -70,15 +64,24 @@ jobs:
|
|||||||
npm install -g node-gyp
|
npm install -g node-gyp
|
||||||
node-gyp install $(node -v)
|
node-gyp install $(node -v)
|
||||||
|
|
||||||
- name: Get pkg-fetch
|
- name: Setting WIN_PKG
|
||||||
|
run: |
|
||||||
|
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\v3.0\fetched-v14.16.1-win-x64
|
||||||
|
|
||||||
|
- name: get pkg-fetch
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
run: |
|
run: |
|
||||||
cd $HOME
|
cd $HOME
|
||||||
$fetchedUrl = "https://github.com/vercel/pkg-fetch/releases/download/v$env:_WIN_PKG_VERSION/node-v$env:_WIN_PKG_FETCH_VERSION-win-x64"
|
$fetchedUrl = "https://github.com/vercel/pkg-fetch/releases/download/v3.0/node-v14.16.1-win-x64"
|
||||||
|
|
||||||
New-Item -ItemType directory -Path ./.pkg-cache
|
New-Item -ItemType directory -Path ./.pkg-cache
|
||||||
New-Item -ItemType directory -Path ./.pkg-cache/v$env:_WIN_PKG_VERSION
|
New-Item -ItemType directory -Path ./.pkg-cache/v3.0
|
||||||
Invoke-RestMethod -Uri $fetchedUrl -OutFile "./.pkg-cache/v$env:_WIN_PKG_VERSION/fetched-v$env:_WIN_PKG_FETCH_VERSION-win-x64"
|
Invoke-RestMethod -Uri $fetchedUrl -OutFile "./.pkg-cache/v3.0/fetched-v14.16.1-win-x64"
|
||||||
|
env:
|
||||||
|
WIN_PKG: C:\Users\runneradmin\.pkg-cache\v3.0\fetched-v14.16.1-win-x64
|
||||||
|
|
||||||
- name: Keytar
|
- name: Keytar
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
@@ -113,9 +116,6 @@ jobs:
|
|||||||
shell: cmd
|
shell: cmd
|
||||||
run: |
|
run: |
|
||||||
set PATH=%PATH%;C:\Program Files (x86)\Resource Hacker
|
set PATH=%PATH%;C:\Program Files (x86)\Resource Hacker
|
||||||
set WIN_PKG=C:\Users\runneradmin\.pkg-cache\v%_WIN_PKG_VERSION%\fetched-v%_WIN_PKG_FETCH_VERSION%-win-x64
|
|
||||||
set WIN_PKG_BUILT=C:\Users\runneradmin\.pkg-cache\v%_WIN_PKG_VERSION%\built-v%_WIN_PKG_FETCH_VERSION%-win-x64
|
|
||||||
|
|
||||||
ResourceHacker -open %WIN_PKG% -save %WIN_PKG% -action delete -mask ICONGROUP,1,
|
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 version-info.rc -save version-info.res -action compile
|
||||||
ResourceHacker -open %WIN_PKG% -save %WIN_PKG% -action addoverwrite -resource version-info.res
|
ResourceHacker -open %WIN_PKG% -save %WIN_PKG% -action addoverwrite -resource version-info.res
|
||||||
@@ -129,73 +129,83 @@ jobs:
|
|||||||
- name: Zip
|
- name: Zip
|
||||||
shell: cmd
|
shell: cmd
|
||||||
run: |
|
run: |
|
||||||
7z a ./dist-cli/bwdc-windows-%_PACKAGE_VERSION%.zip ./dist-cli/windows/bwdc.exe ./keytar/windows/keytar.node
|
7z a ./dist-cli/bwdc-windows-%PACKAGE_VERSION%.zip ./dist-cli/windows/bwdc.exe ./keytar/windows/keytar.node
|
||||||
7z a ./dist-cli/bwdc-macos-%_PACKAGE_VERSION%.zip ./dist-cli/macos/bwdc ./keytar/macos/keytar.node
|
7z a ./dist-cli/bwdc-macos-%PACKAGE_VERSION%.zip ./dist-cli/macos/bwdc ./keytar/macos/keytar.node
|
||||||
7z a ./dist-cli/bwdc-linux-%_PACKAGE_VERSION%.zip ./dist-cli/linux/bwdc ./keytar/linux/keytar.node
|
7z a ./dist-cli/bwdc-linux-%PACKAGE_VERSION%.zip ./dist-cli/linux/bwdc ./keytar/linux/keytar.node
|
||||||
|
|
||||||
- name: Version Test
|
- name: Version Test
|
||||||
run: |
|
run: |
|
||||||
Expand-Archive -Path "./dist-cli/bwdc-windows-${env:_PACKAGE_VERSION}.zip" -DestinationPath "./test/windows"
|
Expand-Archive -Path "./dist-cli/bwdc-windows-${env:PACKAGE_VERSION}.zip" -DestinationPath "./test/windows"
|
||||||
$testVersion = Invoke-Expression '& ./test/windows/bwdc.exe -v'
|
$testVersion = Invoke-Expression '& ./test/windows/bwdc.exe -v'
|
||||||
echo "version: $env:_PACKAGE_VERSION"
|
echo "version: $env:PACKAGE_VERSION"
|
||||||
echo "testVersion: $testVersion"
|
echo "testVersion: $testVersion"
|
||||||
if($testVersion -ne $env:_PACKAGE_VERSION) {
|
if($testVersion -ne $env:PACKAGE_VERSION) {
|
||||||
Throw "Version test failed."
|
Throw "Version test failed."
|
||||||
}
|
}
|
||||||
|
|
||||||
- name: Create checksums
|
- name: Create checksums
|
||||||
run: |
|
run: |
|
||||||
checksum -f="./dist-cli/bwdc-windows-${env:_PACKAGE_VERSION}.zip" `
|
checksum -f="./dist-cli/bwdc-windows-${env:PACKAGE_VERSION}.zip" `
|
||||||
-t sha256 | Out-File ./dist-cli/bwdc-windows-sha256-${env:_PACKAGE_VERSION}.txt
|
-t sha256 | Out-File ./dist-cli/bwdc-windows-sha256-${env:PACKAGE_VERSION}.txt
|
||||||
checksum -f="./dist-cli/bwdc-macos-${env:_PACKAGE_VERSION}.zip" `
|
checksum -f="./dist-cli/bwdc-macos-${env:PACKAGE_VERSION}.zip" `
|
||||||
-t sha256 | Out-File ./dist-cli/bwdc-macos-sha256-${env:_PACKAGE_VERSION}.txt
|
-t sha256 | Out-File ./dist-cli/bwdc-macos-sha256-${env:PACKAGE_VERSION}.txt
|
||||||
checksum -f="./dist-cli/bwdc-linux-${env:_PACKAGE_VERSION}.zip" `
|
checksum -f="./dist-cli/bwdc-linux-${env:PACKAGE_VERSION}.zip" `
|
||||||
-t sha256 | Out-File ./dist-cli/bwdc-linux-sha256-${env:_PACKAGE_VERSION}.txt
|
-t sha256 | Out-File ./dist-cli/bwdc-linux-sha256-${env:PACKAGE_VERSION}.txt
|
||||||
|
|
||||||
- name: Upload windows zip to GitHub
|
- name: Upload windows zip to GitHub
|
||||||
|
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/rc'
|
||||||
uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700
|
uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700
|
||||||
with:
|
with:
|
||||||
name: bwdc-windows-${{ env._PACKAGE_VERSION }}.zip
|
name: bwdc-windows-${{ env.PACKAGE_VERSION }}.zip
|
||||||
path: ./dist-cli/bwdc-windows-${{ env._PACKAGE_VERSION }}.zip
|
path: ./dist-cli/bwdc-windows-${{ env.PACKAGE_VERSION }}.zip
|
||||||
|
|
||||||
- name: Upload mac zip to GitHub
|
- name: Upload mac zip to GitHub
|
||||||
|
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/rc'
|
||||||
uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700
|
uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700
|
||||||
with:
|
with:
|
||||||
name: bwdc-macos-${{ env._PACKAGE_VERSION }}.zip
|
name: bwdc-macos-${{ env.PACKAGE_VERSION }}.zip
|
||||||
path: ./dist-cli/bwdc-macos-${{ env._PACKAGE_VERSION }}.zip
|
path: ./dist-cli/bwdc-macos-${{ env.PACKAGE_VERSION }}.zip
|
||||||
|
|
||||||
- name: Upload linux zip to GitHub
|
- name: Upload linux zip to GitHub
|
||||||
|
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/rc'
|
||||||
uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700
|
uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700
|
||||||
with:
|
with:
|
||||||
name: bwdc-linux-${{ env._PACKAGE_VERSION }}.zip
|
name: bwdc-linux-${{ env.PACKAGE_VERSION }}.zip
|
||||||
path: ./dist-cli/bwdc-linux-${{ env._PACKAGE_VERSION }}.zip
|
path: ./dist-cli/bwdc-linux-${{ env.PACKAGE_VERSION }}.zip
|
||||||
|
|
||||||
- name: Upload windows checksum to GitHub
|
- name: Upload windows checksum to GitHub
|
||||||
|
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/rc'
|
||||||
uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700
|
uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700
|
||||||
with:
|
with:
|
||||||
name: bwdc-windows-sha256-${{ env._PACKAGE_VERSION }}.txt
|
name: bwdc-windows-sha256-${{ env.PACKAGE_VERSION }}.txt
|
||||||
path: ./dist-cli/bwdc-windows-sha256-${{ env._PACKAGE_VERSION }}.txt
|
path: ./dist-cli/bwdc-windows-sha256-${{ env.PACKAGE_VERSION }}.txt
|
||||||
|
|
||||||
- name: Upload mac checksum to GitHub
|
- name: Upload mac checksum to GitHub
|
||||||
|
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/rc'
|
||||||
uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700
|
uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700
|
||||||
with:
|
with:
|
||||||
name: bwdc-macos-sha256-${{ env._PACKAGE_VERSION }}.txt
|
name: bwdc-macos-sha256-${{ env.PACKAGE_VERSION }}.txt
|
||||||
path: ./dist-cli/bwdc-macos-sha256-${{ env._PACKAGE_VERSION }}.txt
|
path: ./dist-cli/bwdc-macos-sha256-${{ env.PACKAGE_VERSION }}.txt
|
||||||
|
|
||||||
- name: Upload linux checksum to GitHub
|
- name: Upload linux checksum to GitHub
|
||||||
|
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/rc'
|
||||||
uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700
|
uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700
|
||||||
with:
|
with:
|
||||||
name: bwdc-linux-sha256-${{ env._PACKAGE_VERSION }}.txt
|
name: bwdc-linux-sha256-${{ env.PACKAGE_VERSION }}.txt
|
||||||
path: ./dist-cli/bwdc-linux-sha256-${{ env._PACKAGE_VERSION }}.txt
|
path: ./dist-cli/bwdc-linux-sha256-${{ env.PACKAGE_VERSION }}.txt
|
||||||
|
|
||||||
|
|
||||||
windows_gui:
|
windows_gui:
|
||||||
name: Windows GUI
|
runs-on: windows-latest
|
||||||
runs-on: windows-2019
|
|
||||||
needs: setup
|
needs: setup
|
||||||
env:
|
env:
|
||||||
_PACKAGE_VERSION: ${{ needs.setup.outputs.package_version }}
|
PACKAGE_VERSION: ${{ needs.setup.outputs.package_version }}
|
||||||
steps:
|
steps:
|
||||||
|
- name: Set up dotnet
|
||||||
|
uses: actions/setup-dotnet@a71d1eb2c86af85faa8c772c03fb365e377e45ea
|
||||||
|
with:
|
||||||
|
dotnet-version: "3.1.x"
|
||||||
|
|
||||||
- name: Set up Node
|
- name: Set up Node
|
||||||
uses: actions/setup-node@46071b5c7a2e0c34e49c3cb8a0e792e86e18d5ea
|
uses: actions/setup-node@46071b5c7a2e0c34e49c3cb8a0e792e86e18d5ea
|
||||||
with:
|
with:
|
||||||
@@ -218,7 +228,24 @@ jobs:
|
|||||||
dotnet --version
|
dotnet --version
|
||||||
|
|
||||||
- name: Install AST
|
- name: Install AST
|
||||||
uses: bitwarden/gh-actions/install-ast@f135c42c8596cb535c5bcb7523c0b2eef89709ac
|
shell: pwsh
|
||||||
|
run: |
|
||||||
|
cd $HOME
|
||||||
|
|
||||||
|
git clone https://github.com/vcsjones/AzureSignTool.git
|
||||||
|
cd AzureSignTool
|
||||||
|
$latest_head = $(git rev-parse HEAD)[0..9] -join ""
|
||||||
|
$latest_version = "0.0.0-g$latest_head"
|
||||||
|
|
||||||
|
Write-Host "--------"
|
||||||
|
Write-Host "git commit - $(git rev-parse HEAD)"
|
||||||
|
Write-Host "latest_head - $latest_head"
|
||||||
|
Write-Host "PACKAGE VERSION TO BUILD - $latest_version"
|
||||||
|
Write-Host "--------"
|
||||||
|
|
||||||
|
dotnet restore
|
||||||
|
dotnet pack --output ./nupkg
|
||||||
|
dotnet tool install --global --ignore-failed-sources --add-source ./nupkg --version $latest_version azuresigntool
|
||||||
|
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
||||||
@@ -243,24 +270,25 @@ jobs:
|
|||||||
run: dir ./dist
|
run: dir ./dist
|
||||||
|
|
||||||
- name: Publish Portable Exe to GitHub
|
- name: Publish Portable Exe to GitHub
|
||||||
|
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/rc'
|
||||||
uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700
|
uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700
|
||||||
with:
|
with:
|
||||||
name: Bitwarden-Connector-Portable-${{ env._PACKAGE_VERSION }}.exe
|
name: Bitwarden-Connector-Portable-${{ env.PACKAGE_VERSION }}.exe
|
||||||
path: ./dist/Bitwarden-Connector-Portable-${{ env._PACKAGE_VERSION }}.exe
|
path: ./dist/Bitwarden-Connector-Portable-${{ env.PACKAGE_VERSION }}.exe
|
||||||
|
|
||||||
- name: Publish Installer Exe to GitHub
|
- name: Publish Installer Exe to GitHub
|
||||||
|
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/rc'
|
||||||
uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700
|
uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700
|
||||||
with:
|
with:
|
||||||
name: Bitwarden-Connector-Installer-${{ env._PACKAGE_VERSION }}.exe
|
name: Bitwarden-Connector-Installer-${{ env.PACKAGE_VERSION }}.exe
|
||||||
path: ./dist/Bitwarden-Connector-Installer-${{ env._PACKAGE_VERSION }}.exe
|
path: ./dist/Bitwarden-Connector-Installer-${{ env.PACKAGE_VERSION }}.exe
|
||||||
|
|
||||||
|
|
||||||
linux:
|
linux:
|
||||||
name: Linux
|
runs-on: ubuntu-latest
|
||||||
runs-on: ubuntu-20.04
|
|
||||||
needs: setup
|
needs: setup
|
||||||
env:
|
env:
|
||||||
_PACKAGE_VERSION: ${{ needs.setup.outputs.package_version }}
|
PACKAGE_VERSION: ${{ needs.setup.outputs.package_version }}
|
||||||
steps:
|
steps:
|
||||||
- name: Set up Node
|
- name: Set up Node
|
||||||
uses: actions/setup-node@46071b5c7a2e0c34e49c3cb8a0e792e86e18d5ea
|
uses: actions/setup-node@46071b5c7a2e0c34e49c3cb8a0e792e86e18d5ea
|
||||||
@@ -279,34 +307,34 @@ jobs:
|
|||||||
- name: Set up environment
|
- name: Set up environment
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get -y install pkg-config libxss-dev libsecret-1-dev
|
sudo apt-get -y install pkg-config libxss-dev libsecret-1-dev
|
||||||
sudo apt-get -y install rpm
|
sudo apt-get -y install rpm
|
||||||
|
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
||||||
|
|
||||||
- name: NPM install
|
- name: npm install
|
||||||
run: npm install
|
run: npm install
|
||||||
|
|
||||||
- name: NPM rebuild
|
- name: npm rebuild
|
||||||
run: npm run rebuild
|
run: npm run rebuild
|
||||||
|
|
||||||
- name: NPM package
|
- name: npm package
|
||||||
run: npm run dist:lin
|
run: npm run dist:lin
|
||||||
|
|
||||||
- name: Publish AppImage
|
- name: Publish AppImage
|
||||||
|
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/rc'
|
||||||
uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700
|
uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700
|
||||||
with:
|
with:
|
||||||
name: Bitwarden-Connector-${{ env._PACKAGE_VERSION }}-x86_64.AppImage
|
name: Bitwarden-Connector-${{ env.PACKAGE_VERSION }}-x86_64.AppImage
|
||||||
path: ./dist/Bitwarden-Connector-${{ env._PACKAGE_VERSION }}-x86_64.AppImage
|
path: ./dist/Bitwarden-Connector-${{ env.PACKAGE_VERSION }}-x86_64.AppImage
|
||||||
|
|
||||||
|
|
||||||
macos:
|
macos:
|
||||||
name: MacOS
|
runs-on: macos-latest
|
||||||
runs-on: macos-11
|
|
||||||
needs: setup
|
needs: setup
|
||||||
env:
|
env:
|
||||||
_PACKAGE_VERSION: ${{ needs.setup.outputs.package_version }}
|
PACKAGE_VERSION: ${{ needs.setup.outputs.package_version }}
|
||||||
steps:
|
steps:
|
||||||
- name: Set up Node
|
- name: Set up Node
|
||||||
uses: actions/setup-node@46071b5c7a2e0c34e49c3cb8a0e792e86e18d5ea
|
uses: actions/setup-node@46071b5c7a2e0c34e49c3cb8a0e792e86e18d5ea
|
||||||
@@ -375,12 +403,12 @@ jobs:
|
|||||||
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/rc'
|
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/rc'
|
||||||
uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700
|
uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700
|
||||||
with:
|
with:
|
||||||
name: Bitwarden-Connector-${{ env._PACKAGE_VERSION }}-mac.zip
|
name: Bitwarden-Connector-${{ env.PACKAGE_VERSION }}-mac.zip
|
||||||
path: ./dist/Bitwarden-Connector-${{ env._PACKAGE_VERSION }}-mac.zip
|
path: ./dist/Bitwarden-Connector-${{ env.PACKAGE_VERSION }}-mac.zip
|
||||||
|
|
||||||
- name: Upload .dmg artifact
|
- name: Upload .dmg artifact
|
||||||
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/rc'
|
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/rc'
|
||||||
uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700
|
uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700
|
||||||
with:
|
with:
|
||||||
name: Bitwarden-Connector-${{ env._PACKAGE_VERSION }}.dmg
|
name: Bitwarden-Connector-${{ env.PACKAGE_VERSION }}.dmg
|
||||||
path: ./dist/Bitwarden-Connector-${{ env._PACKAGE_VERSION }}.dmg
|
path: ./dist/Bitwarden-Connector-${{ env.PACKAGE_VERSION }}.dmg
|
||||||
|
|||||||
206
.github/workflows/release.yml
vendored
206
.github/workflows/release.yml
vendored
@@ -1,4 +1,3 @@
|
|||||||
---
|
|
||||||
name: Release
|
name: Release
|
||||||
|
|
||||||
on:
|
on:
|
||||||
@@ -11,8 +10,7 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
setup:
|
setup:
|
||||||
name: Setup
|
runs-on: ubuntu-latest
|
||||||
runs-on: ubuntu-20.04
|
|
||||||
outputs:
|
outputs:
|
||||||
package_version: ${{ steps.create_tags.outputs.package_version }}
|
package_version: ${{ steps.create_tags.outputs.package_version }}
|
||||||
tag_version: ${{ steps.create_tags.outputs.tag_version }}
|
tag_version: ${{ steps.create_tags.outputs.tag_version }}
|
||||||
@@ -64,92 +62,191 @@ jobs:
|
|||||||
draft: true
|
draft: true
|
||||||
prerelease: false
|
prerelease: false
|
||||||
|
|
||||||
|
|
||||||
cli:
|
cli:
|
||||||
name: CLI
|
runs-on: windows-latest
|
||||||
runs-on: windows-2019
|
|
||||||
needs: setup
|
needs: setup
|
||||||
env:
|
env:
|
||||||
_PACKAGE_VERSION: ${{ needs.setup.outputs.package_version }}
|
PACKAGE_VERSION: ${{ needs.setup.outputs.package_version }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
||||||
|
|
||||||
- name: Download latest RC build artifacts
|
- name: Setup Windows builder
|
||||||
uses: dawidd6/action-download-artifact@b9571484721e8187f1fd08147b497129f8972c74 # v2.14.0
|
run: |
|
||||||
with:
|
choco install checksum --no-progress
|
||||||
workflow: build.yml
|
choco install reshack --no-progress
|
||||||
workflow_conclusion: success
|
|
||||||
branch: rc
|
|
||||||
path: ./dist-cli
|
|
||||||
|
|
||||||
- name: Upload Windows zip release asset
|
- name: Set up Node
|
||||||
|
uses: actions/setup-node@46071b5c7a2e0c34e49c3cb8a0e792e86e18d5ea
|
||||||
|
with:
|
||||||
|
node-version: '14.x'
|
||||||
|
|
||||||
|
- name: Update NPM
|
||||||
|
run: |
|
||||||
|
npm install -g npm@7
|
||||||
|
npm install -g node-gyp
|
||||||
|
node-gyp install $(node -v)
|
||||||
|
|
||||||
|
- name: Set VER_INFO
|
||||||
|
run: |
|
||||||
|
echo "WIN_PKG=$env:WIN_PKG" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
||||||
|
env:
|
||||||
|
WIN_PKG: C:\Users\runneradmin\.pkg-cache\v3.0\fetched-v14.16.1-win-x64
|
||||||
|
|
||||||
|
- name: get pkg-fetch
|
||||||
|
shell: pwsh
|
||||||
|
run: |
|
||||||
|
cd $HOME
|
||||||
|
$fetchedUrl = "https://github.com/vercel/pkg-fetch/releases/download/v3.0/node-v14.16.1-win-x64"
|
||||||
|
|
||||||
|
New-Item -ItemType directory -Path ./.pkg-cache
|
||||||
|
New-Item -ItemType directory -Path ./.pkg-cache/v3.0
|
||||||
|
Invoke-RestMethod -Uri $fetchedUrl -OutFile "./.pkg-cache/v3.0/fetched-v14.16.1-win-x64"
|
||||||
|
env:
|
||||||
|
WIN_PKG: C:\Users\runneradmin\.pkg-cache\v3.0\fetched-v14.16.1-win-x64
|
||||||
|
|
||||||
|
- name: Keytar
|
||||||
|
shell: pwsh
|
||||||
|
run: |
|
||||||
|
$keytarVersion = (Get-Content -Raw -Path ./src/package.json | ConvertFrom-Json).dependencies.keytar
|
||||||
|
$nodeModVersion = node -e "console.log(process.config.variables.node_module_version)"
|
||||||
|
$keytarTar = "keytar-v${keytarVersion}-node-v${nodeModVersion}-{0}-x64.tar"
|
||||||
|
$keytarTarGz = "${keytarTar}.gz"
|
||||||
|
$keytarUrl = "https://github.com/atom/node-keytar/releases/download/v${keytarVersion}/${keytarTarGz}"
|
||||||
|
|
||||||
|
New-Item -ItemType directory -Path ./keytar/macos | Out-Null
|
||||||
|
New-Item -ItemType directory -Path ./keytar/linux | Out-Null
|
||||||
|
New-Item -ItemType directory -Path ./keytar/windows | Out-Null
|
||||||
|
|
||||||
|
Invoke-RestMethod -Uri $($keytarUrl -f "darwin") -OutFile "./keytar/macos/$($keytarTarGz -f "darwin")"
|
||||||
|
Invoke-RestMethod -Uri $($keytarUrl -f "linux") -OutFile "./keytar/linux/$($keytarTarGz -f "linux")"
|
||||||
|
Invoke-RestMethod -Uri $($keytarUrl -f "win32") -OutFile "./keytar/windows/$($keytarTarGz -f "win32")"
|
||||||
|
|
||||||
|
7z e "./keytar/macos/$($keytarTarGz -f "darwin")" -o"./keytar/macos"
|
||||||
|
7z e "./keytar/linux/$($keytarTarGz -f "linux")" -o"./keytar/linux"
|
||||||
|
7z e "./keytar/windows/$($keytarTarGz -f "win32")" -o"./keytar/windows"
|
||||||
|
|
||||||
|
7z e "./keytar/macos/$($keytarTar -f "darwin")" -o"./keytar/macos"
|
||||||
|
7z e "./keytar/linux/$($keytarTar -f "linux")" -o"./keytar/linux"
|
||||||
|
7z e "./keytar/windows/$($keytarTar -f "win32")" -o"./keytar/windows"
|
||||||
|
|
||||||
|
- 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: Package CLI
|
||||||
|
run: npm run dist:cli
|
||||||
|
|
||||||
|
- name: Zip
|
||||||
|
shell: cmd
|
||||||
|
run: |
|
||||||
|
7z a ./dist-cli/bwdc-windows-%PACKAGE_VERSION%.zip ./dist-cli/windows/bwdc.exe ./keytar/windows/keytar.node
|
||||||
|
7z a ./dist-cli/bwdc-macos-%PACKAGE_VERSION%.zip ./dist-cli/macos/bwdc ./keytar/macos/keytar.node
|
||||||
|
7z a ./dist-cli/bwdc-linux-%PACKAGE_VERSION%.zip ./dist-cli/linux/bwdc ./keytar/linux/keytar.node
|
||||||
|
|
||||||
|
- name: Version Test
|
||||||
|
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"
|
||||||
|
echo "testVersion: $testVersion"
|
||||||
|
if($testVersion -ne $env:PACKAGE_VERSION) {
|
||||||
|
Throw "Version test failed."
|
||||||
|
}
|
||||||
|
|
||||||
|
- name: Create checksums
|
||||||
|
run: |
|
||||||
|
checksum -f="./dist-cli/bwdc-windows-${env:PACKAGE_VERSION}.zip" `
|
||||||
|
-t sha256 | Out-File ./dist-cli/bwdc-windows-sha256-${env:PACKAGE_VERSION}.txt
|
||||||
|
checksum -f="./dist-cli/bwdc-macos-${env:PACKAGE_VERSION}.zip" `
|
||||||
|
-t sha256 | Out-File ./dist-cli/bwdc-macos-sha256-${env:PACKAGE_VERSION}.txt
|
||||||
|
checksum -f="./dist-cli/bwdc-linux-${env:PACKAGE_VERSION}.zip" `
|
||||||
|
-t sha256 | Out-File ./dist-cli/bwdc-linux-sha256-${env:PACKAGE_VERSION}.txt
|
||||||
|
|
||||||
|
- name: upload windows zip release asset
|
||||||
uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5
|
uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
with:
|
with:
|
||||||
upload_url: ${{ needs.setup.outputs.release_upload_url }}
|
upload_url: ${{ needs.setup.outputs.release_upload_url }}
|
||||||
asset_path: ./dist-cli/bwdc-windows-${{ env._PACKAGE_VERSION }}.zip/bwdc-windows-${{ env._PACKAGE_VERSION }}.zip
|
asset_path: ./dist-cli/bwdc-windows-${{ env.PACKAGE_VERSION }}.zip
|
||||||
asset_name: bwdc-windows-${{ env._PACKAGE_VERSION }}.zip
|
asset_name: bwdc-windows-${{ env.PACKAGE_VERSION }}.zip
|
||||||
asset_content_type: application/zip
|
asset_content_type: application/zip
|
||||||
|
|
||||||
- name: Upload MacOS zip release asset
|
- name: upload macos zip release asset
|
||||||
uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5
|
uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
with:
|
with:
|
||||||
upload_url: ${{ needs.setup.outputs.release_upload_url }}
|
upload_url: ${{ needs.setup.outputs.release_upload_url }}
|
||||||
asset_path: ./dist-cli/bwdc-macos-${{ env._PACKAGE_VERSION }}.zip/bwdc-macos-${{ env._PACKAGE_VERSION }}.zip
|
asset_path: ./dist-cli/bwdc-macos-${{ env.PACKAGE_VERSION }}.zip
|
||||||
asset_name: bwdc-macos-${{ env._PACKAGE_VERSION }}.zip
|
asset_name: bwdc-macos-${{ env.PACKAGE_VERSION }}.zip
|
||||||
asset_content_type: application/zip
|
asset_content_type: application/zip
|
||||||
|
|
||||||
- name: Upload Linux zip release asset
|
- name: upload linux zip release asset
|
||||||
uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5
|
uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
with:
|
with:
|
||||||
upload_url: ${{ needs.setup.outputs.release_upload_url }}
|
upload_url: ${{ needs.setup.outputs.release_upload_url }}
|
||||||
asset_path: ./dist-cli/bwdc-linux-${{ env._PACKAGE_VERSION }}.zip/bwdc-linux-${{ env._PACKAGE_VERSION }}.zip
|
asset_path: ./dist-cli/bwdc-linux-${{ env.PACKAGE_VERSION }}.zip
|
||||||
asset_name: bwdc-linux-${{ env._PACKAGE_VERSION }}.zip
|
asset_name: bwdc-linux-${{ env.PACKAGE_VERSION }}.zip
|
||||||
asset_content_type: application/zip
|
asset_content_type: application/zip
|
||||||
|
|
||||||
- name: Upload Windows checksum release asset
|
- name: upload windows checksum release asset
|
||||||
uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5
|
uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
with:
|
with:
|
||||||
upload_url: ${{ needs.setup.outputs.release_upload_url }}
|
upload_url: ${{ needs.setup.outputs.release_upload_url }}
|
||||||
asset_path: ./dist-cli/bwdc-windows-sha256-${{ env._PACKAGE_VERSION }}.txt/bwdc-windows-sha256-${{ env._PACKAGE_VERSION }}.txt
|
asset_path: ./dist-cli/bwdc-windows-sha256-${{ env.PACKAGE_VERSION }}.txt
|
||||||
asset_name: bwdc-windows-sha256-${{ env._PACKAGE_VERSION }}.txt
|
asset_name: bwdc-windows-sha256-${{ env.PACKAGE_VERSION }}.txt
|
||||||
asset_content_type: text/plain
|
asset_content_type: text/plain
|
||||||
|
|
||||||
- name: Upload MacOS checksum release asset
|
- name: upload macos checksum release asset
|
||||||
uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5
|
uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
with:
|
with:
|
||||||
upload_url: ${{ needs.setup.outputs.release_upload_url }}
|
upload_url: ${{ needs.setup.outputs.release_upload_url }}
|
||||||
asset_path: ./dist-cli/bwdc-macos-sha256-${{ env._PACKAGE_VERSION }}.txt/bwdc-macos-sha256-${{ env._PACKAGE_VERSION }}.txt
|
asset_path: ./dist-cli/bwdc-macos-sha256-${{ env.PACKAGE_VERSION }}.txt
|
||||||
asset_name: bwdc-macos-sha256-${{ env._PACKAGE_VERSION }}.txt
|
asset_name: bwdc-macos-sha256-${{ env.PACKAGE_VERSION }}.txt
|
||||||
asset_content_type: text/plain
|
asset_content_type: text/plain
|
||||||
|
|
||||||
- name: Upload Linux checksum release asset
|
- name: upload linux checksum release asset
|
||||||
uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5
|
uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
with:
|
with:
|
||||||
upload_url: ${{ needs.setup.outputs.release_upload_url }}
|
upload_url: ${{ needs.setup.outputs.release_upload_url }}
|
||||||
asset_path: ./dist-cli/bwdc-linux-sha256-${{ env._PACKAGE_VERSION }}.txt/bwdc-linux-sha256-${{ env._PACKAGE_VERSION }}.txt
|
asset_path: ./dist-cli/bwdc-linux-sha256-${{ env.PACKAGE_VERSION }}.txt
|
||||||
asset_name: bwdc-linux-sha256-${{ env._PACKAGE_VERSION }}.txt
|
asset_name: bwdc-linux-sha256-${{ env.PACKAGE_VERSION }}.txt
|
||||||
asset_content_type: text/plain
|
asset_content_type: text/plain
|
||||||
|
|
||||||
|
|
||||||
windows-gui:
|
windows-gui:
|
||||||
name: Windows GUI
|
runs-on: windows-latest
|
||||||
runs-on: windows-2019
|
|
||||||
needs: setup
|
needs: setup
|
||||||
env:
|
env:
|
||||||
_PACKAGE_VERSION: ${{ needs.setup.outputs.package_version }}
|
PACKAGE_VERSION: ${{ needs.setup.outputs.package_version }}
|
||||||
steps:
|
steps:
|
||||||
|
- name: Set up dotnet
|
||||||
|
uses: actions/setup-dotnet@a71d1eb2c86af85faa8c772c03fb365e377e45ea
|
||||||
|
with:
|
||||||
|
dotnet-version: "3.1.x"
|
||||||
|
|
||||||
- name: Set up Node
|
- name: Set up Node
|
||||||
uses: actions/setup-node@46071b5c7a2e0c34e49c3cb8a0e792e86e18d5ea
|
uses: actions/setup-node@46071b5c7a2e0c34e49c3cb8a0e792e86e18d5ea
|
||||||
with:
|
with:
|
||||||
@@ -172,7 +269,22 @@ jobs:
|
|||||||
dotnet --version
|
dotnet --version
|
||||||
|
|
||||||
- name: Install AST
|
- name: Install AST
|
||||||
uses: bitwarden/gh-actions/install-ast@f135c42c8596cb535c5bcb7523c0b2eef89709ac
|
shell: pwsh
|
||||||
|
run: |
|
||||||
|
cd $HOME
|
||||||
|
git clone https://github.com/vcsjones/AzureSignTool.git
|
||||||
|
cd AzureSignTool
|
||||||
|
$latest_head = $(git rev-parse HEAD)[0..9] -join ""
|
||||||
|
$latest_version = "0.0.0-g$latest_head"
|
||||||
|
Write-Host "--------"
|
||||||
|
Write-Host "git commit - $(git rev-parse HEAD)"
|
||||||
|
Write-Host "latest_head - $latest_head"
|
||||||
|
Write-Host "PACKAGE VERSION TO BUILD - $latest_version"
|
||||||
|
Write-Host "--------"
|
||||||
|
dotnet restore
|
||||||
|
dotnet pack --output ./nupkg
|
||||||
|
dotnet tool install --global --ignore-failed-sources --add-source ./nupkg --version $latest_version azuresigntool
|
||||||
|
cd $HOME
|
||||||
|
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
||||||
@@ -183,7 +295,7 @@ jobs:
|
|||||||
- name: Run linter
|
- name: Run linter
|
||||||
run: npm run lint
|
run: npm run lint
|
||||||
|
|
||||||
- name: NPM rebuild
|
- name: npm rebuild
|
||||||
run: npm run rebuild
|
run: npm run rebuild
|
||||||
|
|
||||||
- name: Build & Sign
|
- name: Build & Sign
|
||||||
@@ -200,11 +312,10 @@ jobs:
|
|||||||
|
|
||||||
|
|
||||||
linux:
|
linux:
|
||||||
name: Linux
|
runs-on: ubuntu-latest
|
||||||
runs-on: ubuntu-20.04
|
|
||||||
needs: setup
|
needs: setup
|
||||||
env:
|
env:
|
||||||
_PACKAGE_VERSION: ${{ needs.setup.outputs.package_version }}
|
PACKAGE_VERSION: ${{ needs.setup.outputs.package_version }}
|
||||||
steps:
|
steps:
|
||||||
- name: Set up Node
|
- name: Set up Node
|
||||||
uses: actions/setup-node@46071b5c7a2e0c34e49c3cb8a0e792e86e18d5ea
|
uses: actions/setup-node@46071b5c7a2e0c34e49c3cb8a0e792e86e18d5ea
|
||||||
@@ -223,37 +334,36 @@ jobs:
|
|||||||
- name: Set up environment
|
- name: Set up environment
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get -y install pkg-config libxss-dev libsecret-1-dev
|
sudo apt-get -y install pkg-config libxss-dev libsecret-1-dev
|
||||||
sudo apt-get -y install rpm
|
sudo apt-get -y install rpm
|
||||||
|
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
||||||
|
|
||||||
- name: Set Package version
|
- name: Set PACKAGE_VERSION
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
run: |
|
run: |
|
||||||
$env:pkgVersion = (Get-Content -Raw -Path ./src/package.json | ConvertFrom-Json).version
|
$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 "PACKAGE_VERSION=$env:pkgVersion" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
||||||
echo "version: $env:pkgVersion"
|
echo "version: $env:pkgVersion"
|
||||||
|
|
||||||
- name: NPM install
|
- name: npm install
|
||||||
run: npm install
|
run: npm install
|
||||||
|
|
||||||
- name: NPM rebuild
|
- name: npm rebuild
|
||||||
run: npm run rebuild
|
run: npm run rebuild
|
||||||
|
|
||||||
- name: NPM package
|
- name: npm package
|
||||||
run: npm run publish:lin
|
run: npm run publish:lin
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
|
||||||
macos:
|
macos:
|
||||||
name: MacOS
|
runs-on: macos-latest
|
||||||
runs-on: macos-11
|
|
||||||
needs: setup
|
needs: setup
|
||||||
env:
|
env:
|
||||||
_PACKAGE_VERSION: ${{ needs.setup.outputs.package_version }}
|
PACKAGE_VERSION: ${{ needs.setup.outputs.package_version }}
|
||||||
steps:
|
steps:
|
||||||
- name: Set up Node
|
- name: Set up Node
|
||||||
uses: actions/setup-node@46071b5c7a2e0c34e49c3cb8a0e792e86e18d5ea
|
uses: actions/setup-node@46071b5c7a2e0c34e49c3cb8a0e792e86e18d5ea
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
$major, $minor, $patch = $env:_PACKAGE_VERSION.split('.')
|
$major,$minor,$patch = $env:PACKAGE_VERSION.split('.')
|
||||||
|
|
||||||
$versionInfo = @"
|
$versionInfo = @"
|
||||||
|
|
||||||
@@ -15,8 +15,8 @@ BLOCK "StringFileInfo"
|
|||||||
VALUE "CompanyName", "Bitwarden Inc."
|
VALUE "CompanyName", "Bitwarden Inc."
|
||||||
VALUE "ProductName", "Bitwarden"
|
VALUE "ProductName", "Bitwarden"
|
||||||
VALUE "FileDescription", "Bitwarden Directory Connector CLI"
|
VALUE "FileDescription", "Bitwarden Directory Connector CLI"
|
||||||
VALUE "FileVersion", "$env:_PACKAGE_VERSION"
|
VALUE "FileVersion", "$env:PACKAGE_VERSION"
|
||||||
VALUE "ProductVersion", "$env:_PACKAGE_VERSION"
|
VALUE "ProductVersion", "$env:PACKAGE_VERSION"
|
||||||
VALUE "OriginalFilename", "bwdc.exe"
|
VALUE "OriginalFilename", "bwdc.exe"
|
||||||
VALUE "InternalName", "bwdc"
|
VALUE "InternalName", "bwdc"
|
||||||
VALUE "LegalCopyright", "Copyright Bitwarden Inc."
|
VALUE "LegalCopyright", "Copyright Bitwarden Inc."
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
"name": "bitwarden-directory-connector",
|
"name": "bitwarden-directory-connector",
|
||||||
"productName": "Bitwarden Directory Connector",
|
"productName": "Bitwarden Directory Connector",
|
||||||
"description": "Sync your user directory to your Bitwarden organization.",
|
"description": "Sync your user directory to your Bitwarden organization.",
|
||||||
"version": "2.9.5",
|
"version": "2.9.4",
|
||||||
"author": "Bitwarden Inc. <hello@bitwarden.com> (https://bitwarden.com)",
|
"author": "Bitwarden Inc. <hello@bitwarden.com> (https://bitwarden.com)",
|
||||||
"homepage": "https://bitwarden.com",
|
"homepage": "https://bitwarden.com",
|
||||||
"license": "GPL-3.0",
|
"license": "GPL-3.0",
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ export class Main {
|
|||||||
this.messagingService = new NoopMessagingService();
|
this.messagingService = new NoopMessagingService();
|
||||||
this.environmentService = new EnvironmentService(this.storageService);
|
this.environmentService = new EnvironmentService(this.storageService);
|
||||||
this.apiService = new NodeApiService(this.tokenService, this.platformUtilsService, this.environmentService,
|
this.apiService = new NodeApiService(this.tokenService, this.platformUtilsService, this.environmentService,
|
||||||
() => refreshToken(this.apiKeyService, this.authService), async (expired: boolean) => await this.logout());
|
this.refreshTokenCallback, async (expired: boolean) => await this.logout());
|
||||||
this.apiKeyService = new ApiKeyService(this.tokenService, this.storageService);
|
this.apiKeyService = new ApiKeyService(this.tokenService, this.storageService);
|
||||||
this.userService = new UserService(this.tokenService, this.storageService);
|
this.userService = new UserService(this.tokenService, this.storageService);
|
||||||
this.containerService = new ContainerService(this.cryptoService);
|
this.containerService = new ContainerService(this.cryptoService);
|
||||||
@@ -118,6 +118,10 @@ export class Main {
|
|||||||
await this.apiKeyService.clear();
|
await this.apiKeyService.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
refreshTokenCallback() {
|
||||||
|
return refreshToken(this.apiKeyService, this.authService);
|
||||||
|
}
|
||||||
|
|
||||||
private async init() {
|
private async init() {
|
||||||
await this.storageService.init();
|
await this.storageService.init();
|
||||||
this.containerService.attachToWindow(global);
|
this.containerService.attachToWindow(global);
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
"name": "bitwarden-directory-connector",
|
"name": "bitwarden-directory-connector",
|
||||||
"productName": "Bitwarden Directory Connector",
|
"productName": "Bitwarden Directory Connector",
|
||||||
"description": "Sync your user directory to your Bitwarden organization.",
|
"description": "Sync your user directory to your Bitwarden organization.",
|
||||||
"version": "2.9.6",
|
"version": "2.9.4",
|
||||||
"author": "Bitwarden Inc. <hello@bitwarden.com> (https://bitwarden.com)",
|
"author": "Bitwarden Inc. <hello@bitwarden.com> (https://bitwarden.com)",
|
||||||
"homepage": "https://bitwarden.com",
|
"homepage": "https://bitwarden.com",
|
||||||
"license": "GPL-3.0",
|
"license": "GPL-3.0",
|
||||||
|
|||||||
@@ -386,7 +386,7 @@ export class AzureDirectoryService extends BaseDirectoryService implements IDire
|
|||||||
authProvider: done => {
|
authProvider: done => {
|
||||||
if (this.dirConfig.applicationId == null || this.dirConfig.key == null ||
|
if (this.dirConfig.applicationId == null || this.dirConfig.key == null ||
|
||||||
this.dirConfig.tenant == null) {
|
this.dirConfig.tenant == null) {
|
||||||
done(new Error(this.i18nService.t('dirConfigIncomplete')), null);
|
done(this.i18nService.t('dirConfigIncomplete'), null);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -421,14 +421,9 @@ export class AzureDirectoryService extends BaseDirectoryService implements IDire
|
|||||||
this.setAccessTokenExpiration(d.access_token, d.expires_in);
|
this.setAccessTokenExpiration(d.access_token, d.expires_in);
|
||||||
done(null, d.access_token);
|
done(null, d.access_token);
|
||||||
} else if (d.error != null && d.error_description != null) {
|
} else if (d.error != null && d.error_description != null) {
|
||||||
const shortError = d.error_description?.split('\n', 1)[0];
|
done(d.error + ' (' + res.statusCode + '): ' + d.error_description, null);
|
||||||
const err = new Error(d.error + ' (' + res.statusCode + '): ' + shortError);
|
|
||||||
// tslint: disable-next-line
|
|
||||||
console.error(d.error_description);
|
|
||||||
done(err, null);
|
|
||||||
} else {
|
} else {
|
||||||
const err = new Error('Unknown error (' + res.statusCode + ').')
|
done('Unknown error (' + res.statusCode + ').', null);
|
||||||
done(err, null);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}).on('error', err => {
|
}).on('error', err => {
|
||||||
|
|||||||
Reference in New Issue
Block a user