Skip to content

Package

Package #7

Workflow file for this run

name: Package
on:
workflow_dispatch:
env:
SigningCertificate: cert.pfx
jobs:
build:
runs-on: windows-latest
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true # Allows AddPAth and SetEnv commands
CERT_PATH: Release
strategy:
matrix:
dotnet-version: [ 6.0.x ]
steps:
- uses: actions/checkout@v3
with:
submodules: "recursive"
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '16.x'
cache: "yarn"
- name: Install dependencies
run: yarn --frozen-lockfile --network-timeout 600000 install
- name: Print debug info
run: dotnet --info
- name: Decode PFX
shell: pwsh
id: decode-pfx
run: |
$certBytes = [System.Convert]::FromBase64String("${{ secrets.PFX_BASE64 }}")
$certPath = Join-Path -Path $env:RUNNER_TEMP -ChildPath $env:SigningCertificate
[IO.File]::WriteAllBytes("$certPath", $certBytes)
Write-Output "cert-path=$($certPath)" >> $Env:GITHUB_OUTPUT
- name: Build API
run: yarn --non-interactive build_api
- name: Build Install
run: yarn --non-interactive _install_app
# - name: Build Subprojects
# run: yarn --non-interactive subprojects_app
# - name: Build Assets
# run: yarn --non-interactive _assets_app
- name: Webpack
run: yarn build_dist
- name: Sign
shell: pwsh
run: |
$signtool = "C:\Program Files (x86)\Microsoft SDKs\ClickOnce\SignTool\signtool.exe"
$timestamp = "http://timestamp.digicert.com"
$certPath = Join-Path -Path $env:RUNNER_TEMP -ChildPath $env:SigningCertificate
& $signtool sign /f $certPath /p "${{ secrets.PFX_KEY }}" /td sha256 /fd sha256 /tr $timestamp "app\node_modules\winapi-bindings\build\Release\winapi.node"
- name: Package
run: yarn package
env:
# CSC_LINK: ${{ steps.decode-pfx.output.cert-path }}
CSC_LINK: ${{ secrets.PFX_BASE64 }}
CSC_KEY_PASSWORD: ${{ secrets.PFX_KEY }}
- name: Extract Sourcemaps
run: yarn extract_sourcemaps
- name: Test
run: yarn test
- name: Remove PFX
shell: pwsh
run: |
$certPath = Join-Path -Path $env:RUNNER_TEMP -ChildPath $env:SigningCertificate
Remove-Item -Path $certPath
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: production
path: ./dist