mirror of
https://github.com/bitwarden/directory-connector
synced 2025-12-05 23:53:21 +00:00
29
.github/scripts/decrypt-secret.ps1
vendored
29
.github/scripts/decrypt-secret.ps1
vendored
@@ -1,29 +0,0 @@
|
|||||||
param (
|
|
||||||
[Parameter(Mandatory=$true)]
|
|
||||||
[string] $filename,
|
|
||||||
[string] $output
|
|
||||||
)
|
|
||||||
|
|
||||||
$homePath = Resolve-Path "~" | Select-Object -ExpandProperty Path
|
|
||||||
$rootPath = $env:GITHUB_WORKSPACE
|
|
||||||
|
|
||||||
$secretInputPath = $rootPath + "/.github/secrets"
|
|
||||||
$input = $secretInputPath + "/" + $filename
|
|
||||||
|
|
||||||
$passphrase = $env:DECRYPT_FILE_PASSWORD
|
|
||||||
$secretOutputPath = $homePath + "/secrets"
|
|
||||||
|
|
||||||
if ([string]::IsNullOrEmpty($output)) {
|
|
||||||
if ($filename.EndsWith(".gpg")) {
|
|
||||||
$output = $secretOutputPath + "/" + $filename.TrimEnd(".gpg")
|
|
||||||
} else {
|
|
||||||
$output = $secretOutputPath + "/" + $filename + ".plaintext"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!(Test-Path -Path $secretOutputPath))
|
|
||||||
{
|
|
||||||
New-Item -ItemType Directory -Path $secretOutputPath
|
|
||||||
}
|
|
||||||
|
|
||||||
gpg --quiet --batch --yes --decrypt --passphrase="$passphrase" --output $output $input
|
|
||||||
5
.github/scripts/load-version.ps1
vendored
5
.github/scripts/load-version.ps1
vendored
@@ -1,5 +0,0 @@
|
|||||||
$rootPath = $env:GITHUB_WORKSPACE;
|
|
||||||
$packageVersion = (Get-Content -Raw -Path $rootPath\src\package.json | ConvertFrom-Json).version;
|
|
||||||
|
|
||||||
Write-Output "Setting package version to $packageVersion";
|
|
||||||
Write-Output "PACKAGE_VERSION=$packageVersion" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append;
|
|
||||||
7
.github/scripts/macos/decrypt-secrets.ps1
vendored
7
.github/scripts/macos/decrypt-secrets.ps1
vendored
@@ -1,7 +0,0 @@
|
|||||||
$rootPath = $env:GITHUB_WORKSPACE;
|
|
||||||
|
|
||||||
$decryptSecretPath = $($rootPath + "/.github/scripts/decrypt-secret.ps1");
|
|
||||||
|
|
||||||
Invoke-Expression "& `"$decryptSecretPath`" -filename devid-app-cert.p12.gpg"
|
|
||||||
Invoke-Expression "& `"$decryptSecretPath`" -filename devid-installer-cert.p12.gpg"
|
|
||||||
Invoke-Expression "& `"$decryptSecretPath`" -filename macdev-cert.p12.gpg"
|
|
||||||
15
.github/scripts/macos/setup-keychain.ps1
vendored
15
.github/scripts/macos/setup-keychain.ps1
vendored
@@ -1,15 +0,0 @@
|
|||||||
$homePath = Resolve-Path "~" | Select-Object -ExpandProperty Path;
|
|
||||||
$secretsPath = $homePath + "/secrets"
|
|
||||||
|
|
||||||
$devidAppCertPath = $($secretsPath + "/devid-app-cert.p12");
|
|
||||||
$devidInstallerCertPath = $($secretsPath + "/devid-installer-cert.p12");
|
|
||||||
$macdevCertPath = $($secretsPath + "/macdev-cert.p12");
|
|
||||||
|
|
||||||
security create-keychain -p $env:KEYCHAIN_PASSWORD build.keychain
|
|
||||||
security default-keychain -s build.keychain
|
|
||||||
security unlock-keychain -p $env:KEYCHAIN_PASSWORD build.keychain
|
|
||||||
security set-keychain-settings -lut 1200 build.keychain
|
|
||||||
security import $devidAppCertPath -k build.keychain -P $env:DEVID_CERT_PASSWORD -T /usr/bin/codesign -T /usr/bin/security -T /usr/bin/productbuild
|
|
||||||
security import $devidInstallerCertPath -k build.keychain -P $env:DEVID_CERT_PASSWORD -T /usr/bin/codesign -T /usr/bin/security -T /usr/bin/productbuild
|
|
||||||
security import $macdevCertPath -k build.keychain -P $env:MACDEV_CERT_PASSWORD -T /usr/bin/codesign -T /usr/bin/security -T /usr/bin/productbuild
|
|
||||||
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k $env:KEYCHAIN_PASSWORD build.keychain
|
|
||||||
202
.github/workflows/build.yml
vendored
202
.github/workflows/build.yml
vendored
@@ -5,8 +5,6 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches-ignore:
|
branches-ignore:
|
||||||
- 'l10n_master'
|
- 'l10n_master'
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
@@ -15,12 +13,13 @@ jobs:
|
|||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
|
||||||
|
|
||||||
- name: Set up cloc
|
- name: Set up CLOC
|
||||||
run: |
|
run: |
|
||||||
sudo apt update
|
sudo apt update
|
||||||
sudo apt -y install cloc
|
sudo apt -y install cloc
|
||||||
|
|
||||||
- name: Print lines of code
|
- name: Print lines of code
|
||||||
run: cloc --include-lang TypeScript,JavaScript,HTML,Sass,CSS --vcs git
|
run: cloc --include-lang TypeScript,JavaScript,HTML,Sass,CSS --vcs git
|
||||||
|
|
||||||
@@ -32,14 +31,13 @@ jobs:
|
|||||||
package_version: ${{ steps.get_version.outputs.package_version }}
|
package_version: ${{ steps.get_version.outputs.package_version }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
|
||||||
|
|
||||||
- name: Get Package Version
|
- name: Get Package Version
|
||||||
id: get_version
|
id: get_version
|
||||||
shell: pwsh
|
|
||||||
run: |
|
run: |
|
||||||
$env:pkgVersion = (Get-Content -Raw -Path ./src/package.json | ConvertFrom-Json).version
|
PKG_VERSION=$(jq -r .version src/package.json)
|
||||||
echo "::set-output name=package_version::$env:pkgVersion"
|
echo "::set-output name=PACKAGE_VERSION::$PKG_VERSION"
|
||||||
|
|
||||||
|
|
||||||
cli:
|
cli:
|
||||||
@@ -48,11 +46,11 @@ jobs:
|
|||||||
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_FETCH_VERSION: 14.17.6
|
||||||
_WIN_PKG_VERSION: 3.1
|
_WIN_PKG_VERSION: 3.2
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
|
||||||
|
|
||||||
- name: Setup Windows builder
|
- name: Setup Windows builder
|
||||||
run: |
|
run: |
|
||||||
@@ -62,7 +60,7 @@ jobs:
|
|||||||
- name: Set up Node
|
- name: Set up Node
|
||||||
uses: actions/setup-node@46071b5c7a2e0c34e49c3cb8a0e792e86e18d5ea
|
uses: actions/setup-node@46071b5c7a2e0c34e49c3cb8a0e792e86e18d5ea
|
||||||
with:
|
with:
|
||||||
node-version: '14.x'
|
node-version: '14'
|
||||||
|
|
||||||
- name: Update NPM
|
- name: Update NPM
|
||||||
run: |
|
run: |
|
||||||
@@ -70,6 +68,13 @@ jobs:
|
|||||||
npm install -g node-gyp
|
npm install -g node-gyp
|
||||||
node-gyp install $(node -v)
|
node-gyp install $(node -v)
|
||||||
|
|
||||||
|
- 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
|
- name: Get pkg-fetch
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
run: |
|
run: |
|
||||||
@@ -78,7 +83,8 @@ jobs:
|
|||||||
|
|
||||||
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/v$env:_WIN_PKG_VERSION
|
||||||
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/v$env:_WIN_PKG_VERSION/fetched-v$env:_WIN_PKG_FETCH_VERSION-win-x64"
|
||||||
|
|
||||||
- name: Keytar
|
- name: Keytar
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
@@ -107,7 +113,40 @@ jobs:
|
|||||||
|
|
||||||
- name: Setup Version Info
|
- name: Setup Version Info
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
run: ./scripts/make-versioninfo.ps1
|
run: |
|
||||||
|
$major, $minor, $patch = $env:_PACKAGE_VERSION.split('.')
|
||||||
|
|
||||||
|
$versionInfo = @"
|
||||||
|
|
||||||
|
1 VERSIONINFO
|
||||||
|
FILEVERSION $major,$minor,$patch,0
|
||||||
|
PRODUCTVERSION $major,$minor,$patch,0
|
||||||
|
FILEOS 0x40004
|
||||||
|
FILETYPE 0x1
|
||||||
|
{
|
||||||
|
BLOCK "StringFileInfo"
|
||||||
|
{
|
||||||
|
BLOCK "040904b0"
|
||||||
|
{
|
||||||
|
VALUE "CompanyName", "Bitwarden Inc."
|
||||||
|
VALUE "ProductName", "Bitwarden"
|
||||||
|
VALUE "FileDescription", "Bitwarden Directory Connector CLI"
|
||||||
|
VALUE "FileVersion", "$env:_PACKAGE_VERSION"
|
||||||
|
VALUE "ProductVersion", "$env:_PACKAGE_VERSION"
|
||||||
|
VALUE "OriginalFilename", "bwdc.exe"
|
||||||
|
VALUE "InternalName", "bwdc"
|
||||||
|
VALUE "LegalCopyright", "Copyright Bitwarden Inc."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
BLOCK "VarFileInfo"
|
||||||
|
{
|
||||||
|
VALUE "Translation", 0x0409 0x04B0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
"@
|
||||||
|
|
||||||
|
$versionInfo | Out-File ./version-info.rc
|
||||||
|
|
||||||
- name: Resource Hacker
|
- name: Resource Hacker
|
||||||
shell: cmd
|
shell: cmd
|
||||||
@@ -152,54 +191,65 @@ jobs:
|
|||||||
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
|
||||||
uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700
|
uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700 # v2.2.4
|
||||||
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
|
||||||
|
if-no-files-found: error
|
||||||
|
|
||||||
- name: Upload mac zip to GitHub
|
- name: Upload Mac Zip to GitHub
|
||||||
uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700
|
uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700 # v2.2.4
|
||||||
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
|
||||||
|
if-no-files-found: error
|
||||||
|
|
||||||
- name: Upload linux zip to GitHub
|
- name: Upload Linux Zip to GitHub
|
||||||
uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700
|
uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700 # v2.2.4
|
||||||
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
|
||||||
|
if-no-files-found: error
|
||||||
|
|
||||||
- name: Upload windows checksum to GitHub
|
- name: Upload Windows checksum to GitHub
|
||||||
uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700
|
uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700 # v2.2.4
|
||||||
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
|
||||||
|
if-no-files-found: error
|
||||||
|
|
||||||
- name: Upload mac checksum to GitHub
|
- name: Upload Mac checksum to GitHub
|
||||||
uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700
|
uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700 # v2.2.4
|
||||||
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
|
||||||
|
if-no-files-found: error
|
||||||
|
|
||||||
- name: Upload linux checksum to GitHub
|
- name: Upload Linux checksum to GitHub
|
||||||
uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700
|
uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700 # v2.2.4
|
||||||
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
|
||||||
|
if-no-files-found: error
|
||||||
|
|
||||||
|
|
||||||
windows_gui:
|
windows-gui:
|
||||||
name: Windows GUI
|
name: Windows GUI
|
||||||
runs-on: windows-2019
|
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 .NET
|
||||||
|
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:
|
||||||
node-version: '14.x'
|
node-version: '14'
|
||||||
|
|
||||||
- name: Update NPM
|
- name: Update NPM
|
||||||
run: |
|
run: |
|
||||||
@@ -221,7 +271,7 @@ jobs:
|
|||||||
uses: bitwarden/gh-actions/install-ast@f135c42c8596cb535c5bcb7523c0b2eef89709ac
|
uses: bitwarden/gh-actions/install-ast@f135c42c8596cb535c5bcb7523c0b2eef89709ac
|
||||||
|
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
|
||||||
|
|
||||||
- name: Install Node dependencies
|
- name: Install Node dependencies
|
||||||
run: npm install
|
run: npm install
|
||||||
@@ -242,17 +292,19 @@ jobs:
|
|||||||
- name: List Dist
|
- name: List Dist
|
||||||
run: dir ./dist
|
run: dir ./dist
|
||||||
|
|
||||||
- name: Publish Portable Exe to GitHub
|
- name: Upload Portable Executable to GitHub
|
||||||
uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700
|
uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700 # v2.2.4
|
||||||
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
|
||||||
|
if-no-files-found: error
|
||||||
|
|
||||||
- name: Publish Installer Exe to GitHub
|
- name: Upload Installer Executable to GitHub
|
||||||
uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700
|
uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700 # v2.2.4
|
||||||
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
|
||||||
|
if-no-files-found: error
|
||||||
|
|
||||||
|
|
||||||
linux:
|
linux:
|
||||||
@@ -265,7 +317,7 @@ jobs:
|
|||||||
- name: Set up Node
|
- name: Set up Node
|
||||||
uses: actions/setup-node@46071b5c7a2e0c34e49c3cb8a0e792e86e18d5ea
|
uses: actions/setup-node@46071b5c7a2e0c34e49c3cb8a0e792e86e18d5ea
|
||||||
with:
|
with:
|
||||||
node-version: '14.x'
|
node-version: '14'
|
||||||
|
|
||||||
- name: Update NPM
|
- name: Update NPM
|
||||||
run: |
|
run: |
|
||||||
@@ -283,22 +335,23 @@ jobs:
|
|||||||
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 # v2.3.4
|
||||||
|
|
||||||
- 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: Upload AppImage
|
||||||
uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700
|
uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700 # v2.2.4
|
||||||
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
|
||||||
|
if-no-files-found: error
|
||||||
|
|
||||||
|
|
||||||
macos:
|
macos:
|
||||||
@@ -311,7 +364,7 @@ jobs:
|
|||||||
- name: Set up Node
|
- name: Set up Node
|
||||||
uses: actions/setup-node@46071b5c7a2e0c34e49c3cb8a0e792e86e18d5ea
|
uses: actions/setup-node@46071b5c7a2e0c34e49c3cb8a0e792e86e18d5ea
|
||||||
with:
|
with:
|
||||||
node-version: '14.x'
|
node-version: '14'
|
||||||
|
|
||||||
- name: Update NPM
|
- name: Update NPM
|
||||||
run: |
|
run: |
|
||||||
@@ -326,32 +379,58 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
node --version
|
node --version
|
||||||
npm --version
|
npm --version
|
||||||
Write-Output "GitHub ref: $env:GITHUB_REF"
|
echo "GitHub ref: $GITHUB_REF"
|
||||||
Write-Output "GitHub event: $env:GITHUB_EVENT"
|
echo "GitHub event: $GITHUB_EVENT"
|
||||||
shell: pwsh
|
shell: bash
|
||||||
env:
|
|
||||||
GITHUB_REF: ${{ github.ref }}
|
|
||||||
GITHUB_EVENT: ${{ github.event_name }}
|
|
||||||
|
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
|
||||||
|
|
||||||
- name: Decrypt secrets
|
- name: Decrypt secrets
|
||||||
run: ./.github/scripts/macos/decrypt-secrets.ps1
|
|
||||||
shell: pwsh
|
|
||||||
env:
|
env:
|
||||||
DECRYPT_FILE_PASSWORD: ${{ secrets.DECRYPT_FILE_PASSWORD }}
|
DECRYPT_FILE_PASSWORD: ${{ secrets.DECRYPT_FILE_PASSWORD }}
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
mkdir -p $HOME/secrets
|
||||||
|
|
||||||
|
gpg --quiet --batch --yes --decrypt --passphrase="$DECRYPT_FILE_PASSWORD" \
|
||||||
|
--output "$HOME/secrets/devid-app-cert.p12" \
|
||||||
|
"$GITHUB_WORKSPACE/.github/secrets/devid-app-cert.p12.gpg"
|
||||||
|
|
||||||
|
gpg --quiet --batch --yes --decrypt --passphrase="$DECRYPT_FILE_PASSWORD" \
|
||||||
|
--output "$HOME/secrets/devid-installer-cert.p12" \
|
||||||
|
"$GITHUB_WORKSPACE/.github/secrets/devid-installer-cert.p12.gpg"
|
||||||
|
|
||||||
|
gpg --quiet --batch --yes --decrypt --passphrase="$DECRYPT_FILE_PASSWORD" \
|
||||||
|
--output "$HOME/secrets/macdev-cert.p12" \
|
||||||
|
"$GITHUB_WORKSPACE/.github/secrets/macdev-cert.p12.gpg"
|
||||||
|
|
||||||
- name: Set up keychain
|
- name: Set up keychain
|
||||||
run: ./.github/scripts/macos/setup-keychain.ps1
|
|
||||||
shell: pwsh
|
|
||||||
env:
|
env:
|
||||||
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
|
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
|
||||||
DEVID_CERT_PASSWORD: ${{ secrets.DEVID_CERT_PASSWORD }}
|
DEVID_CERT_PASSWORD: ${{ secrets.DEVID_CERT_PASSWORD }}
|
||||||
MACDEV_CERT_PASSWORD: ${{ secrets.MACDEV_CERT_PASSWORD }}
|
MACDEV_CERT_PASSWORD: ${{ secrets.MACDEV_CERT_PASSWORD }}
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
security create-keychain -p $KEYCHAIN_PASSWORD build.keychain
|
||||||
|
security default-keychain -s build.keychain
|
||||||
|
security unlock-keychain -p $KEYCHAIN_PASSWORD build.keychain
|
||||||
|
security set-keychain-settings -lut 1200 build.keychain
|
||||||
|
security import "$HOME/secrets/devid-app-cert.p12" -k build.keychain -P $DEVID_CERT_PASSWORD \
|
||||||
|
-T /usr/bin/codesign -T /usr/bin/security -T /usr/bin/productbuild
|
||||||
|
security import "$HOME/secrets/devid-installer-cert.p12" -k build.keychain -P $DEVID_CERT_PASSWORD \
|
||||||
|
-T /usr/bin/codesign -T /usr/bin/security -T /usr/bin/productbuild
|
||||||
|
security import "$HOME/secrets/macdev-cert.p12" -k build.keychain -P $MACDEV_CERT_PASSWORD \
|
||||||
|
-T /usr/bin/codesign -T /usr/bin/security -T /usr/bin/productbuild
|
||||||
|
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k $KEYCHAIN_PASSWORD build.keychain
|
||||||
|
|
||||||
- name: Load package version
|
- name: Load package version
|
||||||
run: ./.github/scripts/load-version.ps1
|
run: |
|
||||||
|
$rootPath = $env:GITHUB_WORKSPACE;
|
||||||
|
$packageVersion = (Get-Content -Raw -Path $rootPath\src\package.json | ConvertFrom-Json).version;
|
||||||
|
|
||||||
|
Write-Output "Setting package version to $packageVersion";
|
||||||
|
Write-Output "PACKAGE_VERSION=$packageVersion" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append;
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
|
|
||||||
- name: Install Node dependencies
|
- name: Install Node dependencies
|
||||||
@@ -360,27 +439,22 @@ jobs:
|
|||||||
- name: Run linter
|
- name: Run linter
|
||||||
run: npm run lint
|
run: npm run lint
|
||||||
|
|
||||||
- name: Build application (dev)
|
- name: Build application
|
||||||
if: github.ref != 'refs/heads/master'
|
|
||||||
run: npm run build
|
|
||||||
|
|
||||||
- name: Build application (dist)
|
|
||||||
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/rc'
|
|
||||||
run: npm run dist:mac
|
run: npm run dist:mac
|
||||||
env:
|
env:
|
||||||
APPLE_ID_USERNAME: ${{ secrets.APPLE_ID_USERNAME }}
|
APPLE_ID_USERNAME: ${{ secrets.APPLE_ID_USERNAME }}
|
||||||
APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
|
APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
|
||||||
|
|
||||||
- name: Upload .zip artifact
|
- name: Upload .zip artifact
|
||||||
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/rc'
|
uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700 # v2.2.4
|
||||||
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 Directory Connector-${{ env._PACKAGE_VERSION }}-mac.zip
|
||||||
|
if-no-files-found: error
|
||||||
|
|
||||||
- name: Upload .dmg artifact
|
- name: Upload .dmg artifact
|
||||||
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/rc'
|
uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700 # v2.2.4
|
||||||
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
|
||||||
|
if-no-files-found: error
|
||||||
|
|||||||
318
.github/workflows/release.yml
vendored
318
.github/workflows/release.yml
vendored
@@ -3,20 +3,13 @@ name: Release
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
|
||||||
release_tag_name_input:
|
|
||||||
description: "Release Tag Name <X.X.X>"
|
|
||||||
required: true
|
|
||||||
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
setup:
|
setup:
|
||||||
name: Setup
|
name: Setup
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
outputs:
|
outputs:
|
||||||
package_version: ${{ steps.create_tags.outputs.package_version }}
|
package_version: ${{ steps.retrieve-connector-version.outputs.connector_version }}
|
||||||
tag_version: ${{ steps.create_tags.outputs.tag_version }}
|
|
||||||
release_upload_url: ${{ steps.create_release.outputs.upload_url }}
|
|
||||||
steps:
|
steps:
|
||||||
- name: Branch check
|
- name: Branch check
|
||||||
run: |
|
run: |
|
||||||
@@ -29,287 +22,56 @@ jobs:
|
|||||||
|
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
||||||
|
with:
|
||||||
|
ref: rc
|
||||||
|
|
||||||
- name: Create Release Vars
|
- name: Retrieve Directory Connector release version
|
||||||
id: create_tags
|
id: retrieve-connector-version
|
||||||
run: |
|
run: |
|
||||||
case "${RELEASE_TAG_NAME_INPUT:0:1}" in
|
PKG_VERSION=$(jq -r .version src/package.json)
|
||||||
v)
|
echo "::set-output name=connector_version::$PKG_VERSION"
|
||||||
echo "RELEASE_NAME=${RELEASE_TAG_NAME_INPUT:1}" >> $GITHUB_ENV
|
|
||||||
echo "RELEASE_TAG_NAME=$RELEASE_TAG_NAME_INPUT" >> $GITHUB_ENV
|
|
||||||
echo "::set-output name=package_version::${RELEASE_TAG_NAME_INPUT:1}"
|
|
||||||
echo "::set-output name=tag_version::$RELEASE_TAG_NAME_INPUT"
|
|
||||||
;;
|
|
||||||
[0-9])
|
|
||||||
echo "RELEASE_NAME=$RELEASE_TAG_NAME_INPUT" >> $GITHUB_ENV
|
|
||||||
echo "RELEASE_TAG_NAME=v$RELEASE_TAG_NAME_INPUT" >> $GITHUB_ENV
|
|
||||||
echo "::set-output name=package_version::$RELEASE_TAG_NAME_INPUT"
|
|
||||||
echo "::set-output name=tag_version::v$RELEASE_TAG_NAME_INPUT"
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
env:
|
|
||||||
RELEASE_TAG_NAME_INPUT: ${{ github.event.inputs.release_tag_name_input }}
|
|
||||||
|
|
||||||
- name: Create Draft Release
|
- name: Check to make sure Mobile release version has been bumped
|
||||||
id: create_release
|
|
||||||
uses: actions/create-release@0cb9c9b65d5d1901c1f53e5e66eaf4afd303e70e
|
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
with:
|
run: |
|
||||||
tag_name: ${{ env.RELEASE_TAG_NAME }}
|
latest_ver=$(hub release -L 1 -f '%T')
|
||||||
release_name: ${{ env.RELEASE_NAME }}
|
latest_ver=${latest_ver:1}
|
||||||
draft: true
|
echo "Latest version: $latest_ver"
|
||||||
prerelease: false
|
ver=${{ steps.retrieve-connector-version.outputs.connector_version }}
|
||||||
|
echo "Version: $ver"
|
||||||
|
if [ "$latest_ver" = "$ver" ]; then
|
||||||
|
echo "Version has not been bumped!"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
shell: bash
|
||||||
|
|
||||||
cli:
|
- name: Download all artifacts
|
||||||
name: CLI
|
|
||||||
runs-on: windows-2019
|
|
||||||
needs: setup
|
|
||||||
env:
|
|
||||||
_PACKAGE_VERSION: ${{ needs.setup.outputs.package_version }}
|
|
||||||
steps:
|
|
||||||
- name: Checkout repo
|
|
||||||
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
|
||||||
|
|
||||||
- name: Download latest RC build artifacts
|
|
||||||
uses: dawidd6/action-download-artifact@b9571484721e8187f1fd08147b497129f8972c74 # v2.14.0
|
uses: dawidd6/action-download-artifact@b9571484721e8187f1fd08147b497129f8972c74 # v2.14.0
|
||||||
with:
|
with:
|
||||||
workflow: build.yml
|
workflow: build.yml
|
||||||
workflow_conclusion: success
|
workflow_conclusion: success
|
||||||
branch: rc
|
branch: rc
|
||||||
path: ./dist-cli
|
|
||||||
|
|
||||||
- name: Upload Windows zip release asset
|
- name: Create release
|
||||||
uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5
|
uses: ncipollo/release-action@95215a3cb6e6a1908b3c44e00b4fdb15548b1e09 # v2.8.5
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
PKG_VERSION: ${{ steps.retrieve-connector-version.outputs.connector_version }}
|
||||||
with:
|
with:
|
||||||
upload_url: ${{ needs.setup.outputs.release_upload_url }}
|
artifacts: "./bwdc-windows-${{ env.PKG_VERSION }}.zip/bwdc-windows-${{ env.PKG_VERSION }}.zip,
|
||||||
asset_path: ./dist-cli/bwdc-windows-${{ env._PACKAGE_VERSION }}.zip/bwdc-windows-${{ env._PACKAGE_VERSION }}.zip
|
./bwdc-macos-${{ env.PKG_VERSION }}.zip/bwdc-macos-${{ env.PKG_VERSION }}.zip,
|
||||||
asset_name: bwdc-windows-${{ env._PACKAGE_VERSION }}.zip
|
./bwdc-linux-${{ env.PKG_VERSION }}.zip/bwdc-linux-${{ env.PKG_VERSION }}.zip,
|
||||||
asset_content_type: application/zip
|
./bwdc-windows-sha256-${{ env.PKG_VERSION }}.txt/bwdc-windows-sha256-${{ env.PKG_VERSION }}.txt,
|
||||||
|
./bwdc-macos-sha256-${{ env.PKG_VERSION }}.txt/bwdc-macos-sha256-${{ env.PKG_VERSION }}.txt,
|
||||||
- name: Upload MacOS zip release asset
|
./bwdc-linux-sha256-${{ env.PKG_VERSION }}.txt/bwdc-linux-sha256-${{ env.PKG_VERSION }}.txt,
|
||||||
uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5
|
./Bitwarden-Connector-Portable-${{ env.PKG_VERSION }}.exe/Bitwarden-Connector-Portable-${{ env.PKG_VERSION }}.exe,
|
||||||
env:
|
./Bitwarden-Connector-Installer-${{ env.PKG_VERSION }}.exe/Bitwarden-Connector-Installer-${{ env.PKG_VERSION }}.exe,
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
./Bitwarden-Connector-${{ env.PKG_VERSION }}-x86_64.AppImage/Bitwarden-Connector-${{ env.PKG_VERSION }}-x86_64.AppImage,
|
||||||
with:
|
./Bitwarden-Connector-${{ env.PKG_VERSION }}-mac.zip/Bitwarden-Connector-${{ env.PKG_VERSION }}-mac.zip,
|
||||||
upload_url: ${{ needs.setup.outputs.release_upload_url }}
|
./Bitwarden-Connector-${{ env.PKG_VERSION }}.dmg/Bitwarden-Connector-${{ env.PKG_VERSION }}.dmg"
|
||||||
asset_path: ./dist-cli/bwdc-macos-${{ env._PACKAGE_VERSION }}.zip/bwdc-macos-${{ env._PACKAGE_VERSION }}.zip
|
commit: ${{ github.sha }}
|
||||||
asset_name: bwdc-macos-${{ env._PACKAGE_VERSION }}.zip
|
tag: v${{ env.PKG_VERSION }}
|
||||||
asset_content_type: application/zip
|
name: Test Version ${{ env.PKG_VERSION }}
|
||||||
|
body: "<insert release notes here>"
|
||||||
- name: Upload Linux zip release asset
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5
|
draft: true
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
with:
|
|
||||||
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_name: bwdc-linux-${{ env._PACKAGE_VERSION }}.zip
|
|
||||||
asset_content_type: application/zip
|
|
||||||
|
|
||||||
- name: Upload Windows checksum release asset
|
|
||||||
uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
with:
|
|
||||||
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_name: bwdc-windows-sha256-${{ env._PACKAGE_VERSION }}.txt
|
|
||||||
asset_content_type: text/plain
|
|
||||||
|
|
||||||
- name: Upload MacOS checksum release asset
|
|
||||||
uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
with:
|
|
||||||
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_name: bwdc-macos-sha256-${{ env._PACKAGE_VERSION }}.txt
|
|
||||||
asset_content_type: text/plain
|
|
||||||
|
|
||||||
- name: Upload Linux checksum release asset
|
|
||||||
uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
with:
|
|
||||||
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_name: bwdc-linux-sha256-${{ env._PACKAGE_VERSION }}.txt
|
|
||||||
asset_content_type: text/plain
|
|
||||||
|
|
||||||
|
|
||||||
windows-gui:
|
|
||||||
name: Windows GUI
|
|
||||||
runs-on: windows-2019
|
|
||||||
needs: setup
|
|
||||||
env:
|
|
||||||
_PACKAGE_VERSION: ${{ needs.setup.outputs.package_version }}
|
|
||||||
steps:
|
|
||||||
- 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 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
|
|
||||||
dotnet --version
|
|
||||||
|
|
||||||
- name: Install AST
|
|
||||||
uses: bitwarden/gh-actions/install-ast@f135c42c8596cb535c5bcb7523c0b2eef89709ac
|
|
||||||
|
|
||||||
- name: Checkout repo
|
|
||||||
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
|
||||||
|
|
||||||
- name: Install Node dependencies
|
|
||||||
run: npm install
|
|
||||||
|
|
||||||
- name: Run linter
|
|
||||||
run: npm run lint
|
|
||||||
|
|
||||||
- name: NPM rebuild
|
|
||||||
run: npm run rebuild
|
|
||||||
|
|
||||||
- name: Build & Sign
|
|
||||||
run: |
|
|
||||||
npm run publish:win
|
|
||||||
env:
|
|
||||||
ELECTRON_BUILDER_SIGN: 1
|
|
||||||
SIGNING_VAULT_URL: ${{ secrets.SIGNING_VAULT_URL }}
|
|
||||||
SIGNING_CLIENT_ID: ${{ secrets.SIGNING_CLIENT_ID }}
|
|
||||||
SIGNING_TENANT_ID: ${{ secrets.SIGNING_TENANT_ID }}
|
|
||||||
SIGNING_CLIENT_SECRET: ${{ secrets.SIGNING_CLIENT_SECRET }}
|
|
||||||
SIGNING_CERT_NAME: ${{ secrets.SIGNING_CERT_NAME }}
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
|
|
||||||
linux:
|
|
||||||
name: Linux
|
|
||||||
runs-on: ubuntu-20.04
|
|
||||||
needs: setup
|
|
||||||
env:
|
|
||||||
_PACKAGE_VERSION: ${{ needs.setup.outputs.package_version }}
|
|
||||||
steps:
|
|
||||||
- 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 Node options
|
|
||||||
run: echo "NODE_OPTIONS=--max_old_space_size=4096" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: Set up environment
|
|
||||||
run: |
|
|
||||||
sudo apt-get update
|
|
||||||
sudo apt-get -y install pkg-config libxss-dev libsecret-1-dev
|
|
||||||
sudo apt-get -y install rpm
|
|
||||||
|
|
||||||
- name: Checkout repo
|
|
||||||
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
|
||||||
|
|
||||||
- name: Set Package version
|
|
||||||
shell: pwsh
|
|
||||||
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 "version: $env:pkgVersion"
|
|
||||||
|
|
||||||
- name: NPM install
|
|
||||||
run: npm install
|
|
||||||
|
|
||||||
- name: NPM rebuild
|
|
||||||
run: npm run rebuild
|
|
||||||
|
|
||||||
- name: NPM package
|
|
||||||
run: npm run publish:lin
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
|
|
||||||
macos:
|
|
||||||
name: MacOS
|
|
||||||
runs-on: macos-11
|
|
||||||
needs: setup
|
|
||||||
env:
|
|
||||||
_PACKAGE_VERSION: ${{ needs.setup.outputs.package_version }}
|
|
||||||
steps:
|
|
||||||
- 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 Node options
|
|
||||||
run: echo "NODE_OPTIONS=--max_old_space_size=4096" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: Print environment
|
|
||||||
run: |
|
|
||||||
node --version
|
|
||||||
npm --version
|
|
||||||
Write-Output "GitHub ref: $env:GITHUB_REF"
|
|
||||||
Write-Output "GitHub event: $env:GITHUB_EVENT"
|
|
||||||
shell: pwsh
|
|
||||||
env:
|
|
||||||
GITHUB_REF: ${{ github.ref }}
|
|
||||||
GITHUB_EVENT: ${{ github.event_name }}
|
|
||||||
|
|
||||||
- name: Checkout repo
|
|
||||||
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
|
||||||
|
|
||||||
- name: Decrypt secrets
|
|
||||||
run: ./.github/scripts/macos/decrypt-secrets.ps1
|
|
||||||
shell: pwsh
|
|
||||||
env:
|
|
||||||
DECRYPT_FILE_PASSWORD: ${{ secrets.DECRYPT_FILE_PASSWORD }}
|
|
||||||
|
|
||||||
- name: Set up keychain
|
|
||||||
run: ./.github/scripts/macos/setup-keychain.ps1
|
|
||||||
shell: pwsh
|
|
||||||
env:
|
|
||||||
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
|
|
||||||
DEVID_CERT_PASSWORD: ${{ secrets.DEVID_CERT_PASSWORD }}
|
|
||||||
MACDEV_CERT_PASSWORD: ${{ secrets.MACDEV_CERT_PASSWORD }}
|
|
||||||
|
|
||||||
- name: Load package version
|
|
||||||
run: ./.github/scripts/load-version.ps1
|
|
||||||
shell: pwsh
|
|
||||||
|
|
||||||
- name: Install Node dependencies
|
|
||||||
run: npm install
|
|
||||||
|
|
||||||
- name: Run linter
|
|
||||||
run: npm run lint
|
|
||||||
|
|
||||||
- name: Build application (dist)
|
|
||||||
run: npm run publish:mac
|
|
||||||
env:
|
|
||||||
APPLE_ID_USERNAME: ${{ secrets.APPLE_ID_USERNAME }}
|
|
||||||
APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|||||||
@@ -1,33 +0,0 @@
|
|||||||
$major, $minor, $patch = $env:_PACKAGE_VERSION.split('.')
|
|
||||||
|
|
||||||
$versionInfo = @"
|
|
||||||
|
|
||||||
1 VERSIONINFO
|
|
||||||
FILEVERSION $major,$minor,$patch,0
|
|
||||||
PRODUCTVERSION $major,$minor,$patch,0
|
|
||||||
FILEOS 0x40004
|
|
||||||
FILETYPE 0x1
|
|
||||||
{
|
|
||||||
BLOCK "StringFileInfo"
|
|
||||||
{
|
|
||||||
BLOCK "040904b0"
|
|
||||||
{
|
|
||||||
VALUE "CompanyName", "Bitwarden Inc."
|
|
||||||
VALUE "ProductName", "Bitwarden"
|
|
||||||
VALUE "FileDescription", "Bitwarden Directory Connector CLI"
|
|
||||||
VALUE "FileVersion", "$env:_PACKAGE_VERSION"
|
|
||||||
VALUE "ProductVersion", "$env:_PACKAGE_VERSION"
|
|
||||||
VALUE "OriginalFilename", "bwdc.exe"
|
|
||||||
VALUE "InternalName", "bwdc"
|
|
||||||
VALUE "LegalCopyright", "Copyright Bitwarden Inc."
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
BLOCK "VarFileInfo"
|
|
||||||
{
|
|
||||||
VALUE "Translation", 0x0409 0x04B0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
"@
|
|
||||||
|
|
||||||
$versionInfo | Out-File ./version-info.rc
|
|
||||||
Reference in New Issue
Block a user