2021-01-05 17:13:08 +01:00
|
|
|
name: Build & Sign
|
|
|
|
|
2021-01-05 17:28:24 +01:00
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
2021-01-05 17:13:08 +01:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
windows:
|
|
|
|
runs-on: windows-latest
|
2021-01-05 19:53:40 +01:00
|
|
|
environment: test
|
2021-01-05 17:13:08 +01:00
|
|
|
steps:
|
2021-01-05 18:23:12 +01:00
|
|
|
- name: Set up dotnet
|
|
|
|
uses: actions/setup-dotnet@v1
|
|
|
|
with:
|
2021-01-05 18:40:02 +01:00
|
|
|
dotnet-version: "3.1.x"
|
2021-01-05 18:23:12 +01:00
|
|
|
|
2021-01-05 17:13:08 +01:00
|
|
|
- name: Set up Node
|
|
|
|
uses: actions/setup-node@v1
|
|
|
|
with:
|
|
|
|
node-version: '10.x'
|
|
|
|
|
|
|
|
- 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
|
|
|
|
|
2021-01-05 19:03:23 +01:00
|
|
|
- name: Install AST
|
|
|
|
shell: pwsh
|
|
|
|
run: |
|
|
|
|
cd $HOME
|
|
|
|
|
2021-01-05 19:07:53 +01:00
|
|
|
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"
|
2021-01-05 19:03:23 +01:00
|
|
|
|
2021-01-05 19:07:53 +01:00
|
|
|
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 "--------"
|
2021-01-05 19:03:23 +01:00
|
|
|
|
2021-01-05 19:13:48 +01:00
|
|
|
dotnet restore
|
2021-01-05 19:17:58 +01:00
|
|
|
dotnet pack --output ./nupkg
|
2021-01-05 19:13:48 +01:00
|
|
|
dotnet tool install --global --ignore-failed-sources --add-source ./nupkg --version $latest_version azuresigntool
|
|
|
|
|
2021-01-05 19:03:23 +01:00
|
|
|
cd $HOME
|
2021-01-05 17:13:08 +01:00
|
|
|
|
2021-01-05 19:13:48 +01:00
|
|
|
- name: Test AST
|
|
|
|
run: azuresigntool sign --help
|
|
|
|
|
2021-01-05 17:13:08 +01:00
|
|
|
- name: Checkout repo
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Load package version
|
2021-01-05 19:53:40 +01:00
|
|
|
run: ./.github/scripts/load-version.ps1
|
2021-01-05 17:13:08 +01:00
|
|
|
shell: pwsh
|
|
|
|
|
|
|
|
- name: Install Node dependencies
|
|
|
|
run: npm install
|
|
|
|
|
|
|
|
- name: Run linter
|
|
|
|
run: npm run lint
|
|
|
|
|
|
|
|
- name: Build application
|
|
|
|
run: |
|
2021-01-05 19:53:40 +01:00
|
|
|
npm run build
|
|
|
|
npm run clean:dist
|
2021-01-05 17:13:08 +01:00
|
|
|
|
2021-01-05 19:53:40 +01:00
|
|
|
- name: Build & Sign
|
2021-01-05 21:50:29 +01:00
|
|
|
shell: pwsh
|
|
|
|
run: npx electron-builder --win --x64 --ia32 -p never -c.win.certificateSubjectName=''Bitwarden Inc''
|
2021-01-05 17:13:08 +01:00
|
|
|
env:
|
2021-01-05 19:53:40 +01:00
|
|
|
CSC_LINK: ${{ secrets.EB_SIGNING_CERT_IDENTIFIER_URL }}
|
|
|
|
CSC_KEY_PASSWORD: ${{ secrets.EB_SIGNING_CERT_KEY }}
|
|
|
|
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 }}
|
|
|
|
SECRET_TEST: ${{ secrets.SECRET_TEST }}
|
|
|
|
|
|
|
|
#- name: Upload portable exe artifact
|
|
|
|
# if: github.ref == 'refs/heads/master' || github.event_name == 'release'
|
|
|
|
# uses: actions/upload-artifact@v2
|
|
|
|
# with:
|
|
|
|
# name: Bitwarden-Portable-${{ env.PACKAGE_VERSION }}.exe
|
|
|
|
# path: ./dist/Bitwarden-Portable-${{ env.PACKAGE_VERSION }}.exe
|
|
|
|
|
|
|
|
#- name: Upload installer exe artifact
|
|
|
|
# if: github.ref == 'refs/heads/master' || github.event_name == 'release'
|
|
|
|
# uses: actions/upload-artifact@v2
|
|
|
|
# with:
|
|
|
|
# name: Bitwarden-Installer-${{ env.PACKAGE_VERSION }}.exe
|
|
|
|
# path: ./dist/nsis-web/Bitwarden-Installer-${{ env.PACKAGE_VERSION }}.exe
|
|
|
|
|
|
|
|
#- name: Upload release assets
|
|
|
|
# if: github.event_name == 'release'
|
|
|
|
# run: |
|
|
|
|
# hub release edit `
|
|
|
|
# -a ./dist/chocolatey/bitwarden.${{ env.PACKAGE_VERSION }}.nupkg `
|
|
|
|
# -a ./dist/Bitwarden-${{ env.PACKAGE_VERSION }}-ia32-store.appx `
|
|
|
|
# -a ./dist/Bitwarden-${{ env.PACKAGE_VERSION }}-x64-store.appx `
|
|
|
|
# -m "$($env:RELEASE_TAG_NAME.TrimStart('v'))" `
|
|
|
|
# $env:RELEASE_TAG_NAME
|
|
|
|
# shell: pwsh
|
|
|
|
# env:
|
|
|
|
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
# RELEASE_TAG_NAME: ${{ github.event.release.tag_name }}
|