Skip to content

Commit

Permalink
Merge pull request #703 from mountaindude/master
Browse files Browse the repository at this point in the history
build(deps): Upgrade to latest versions of build tools
  • Loading branch information
mountaindude authored Feb 17, 2024
2 parents 0d13889 + f2f268c commit ad12afd
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 17 deletions.
47 changes: 35 additions & 12 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
- sp53
# timeout-minutes: 15

if: ${{ needs.release-please.outputs.releases_created }}
if: needs.release-please.outputs.releases_created == 'true'
env:
DIST_FILE_NAME: butler-sos
GITHUB_TOKEN: ${{ secrets.PAT }}
Expand Down Expand Up @@ -177,7 +177,7 @@ jobs:
- windows
- sp53
# timeout-minutes: 15
if: ${{ needs.release-please.outputs.releases_created }}
if: needs.release-please.outputs.releases_created == 'true'
env:
DIST_FILE_NAME: butler-sos
GITHUB_TOKEN: ${{ secrets.PAT }}
Expand All @@ -202,6 +202,7 @@ jobs:
- name: Install tool for creating stand-alone executables
run: |
npm install pkg --location=global
npm install --save-exact esbuild
- name: Install dependencies
run: |
Expand All @@ -213,23 +214,44 @@ jobs:
./node_modules/.bin/esbuild src/bundle.js --bundle --external:axios --external:xdg-open --external:enigma.js --outfile=build.cjs --format=cjs --platform=node --target=node18 --minify
pkg --output "./${env:DIST_FILE_NAME}.exe" -t node18-win-x64 ./build.cjs --config package.json --compress GZip
# # Extract signing certificate to files on disk
# New-Item -ItemType directory -Path certificate
# Set-Content -Path certificate\certificate.txt -Value $env:CODESIGN_BASE64
# certutil -decode certificate\certificate.txt certificate\certificate.pfx
# Set-Content -Path certificate\intermediate.txt -Value $env:CODESIGN_INTERMEDIATE_BASE64
# certutil -decode certificate\intermediate.txt certificate\intermediate.crt
# $processOptions = @{
# FilePath = "C:\Program Files (x86)/Windows Kits/10/bin/10.0.22621.0/x64/signtool.exe"
# Wait = $true
# ArgumentList = "sign", "/fd", "SHA256", "/p", "$env:CODESIGN_PWD", "/ac", "certificate\intermediate.crt", "/f", "certificate\certificate.pfx", "/tr", "http://timestamp.sectigo.com/rfc3161", "/td", "sha256", "./${env:DIST_FILE_NAME}.exe"
# WorkingDirectory = "."
# NoNewWindow = $true
# }
# Start-Process @processOptions
# Sign the executable
New-Item -ItemType directory -Path certificate
Set-Content -Path certificate\certificate.txt -Value $env:CODESIGN_BASE64
certutil -decode certificate\certificate.txt certificate\certificate.pfx
Set-Content -Path certificate\intermediate.txt -Value $env:CODESIGN_INTERMEDIATE_BASE64
certutil -decode certificate\intermediate.txt certificate\intermediate.crt
# 1st signing
$processOptions1 = @{
FilePath = "C:\Program Files (x86)/Windows Kits/10/bin/10.0.22621.0/x64/signtool.exe"
Wait = $true
ArgumentList = "sign", "/sha1", "$env:CODESIGN_WIN_THUMBPRINT", "/tr", "http://time.certum.pl", "/td", "sha256", "/fd", "sha1", "/v", "./${env:DIST_FILE_NAME}.exe"
WorkingDirectory = "."
NoNewWindow = $true
}
Start-Process @processOptions1
$processOptions = @{
# 2nd signing
$processOptions2 = @{
FilePath = "C:\Program Files (x86)/Windows Kits/10/bin/10.0.22621.0/x64/signtool.exe"
Wait = $true
ArgumentList = "sign", "/fd", "SHA256", "/p", "$env:CODESIGN_PWD", "/ac", "certificate\intermediate.crt", "/f", "certificate\certificate.pfx", "/tr", "http://timestamp.sectigo.com/rfc3161", "/td", "sha256", "./${env:DIST_FILE_NAME}.exe"
ArgumentList = "sign", "/sha1", "$env:CODESIGN_WIN_THUMBPRINT", "/tr", "http://time.certum.pl", "/td", "sha256", "/fd", "sha256", "/v", "./${env:DIST_FILE_NAME}.exe"
WorkingDirectory = "."
NoNewWindow = $true
}
Start-Process @processOptions
Start-Process @processOptions2
Remove-Item -Recurse -Force certificate
# Remove-Item -Recurse -Force certificate
# Create release binary zip
$compress = @{
Expand Down Expand Up @@ -273,7 +295,7 @@ jobs:
runs-on: ubuntu-latest
# timeout-minutes: 15

if: ${{ needs.release-please.outputs.releases_created }}
if: needs.release-please.outputs.releases_created == 'true'
env:
DIST_FILE_NAME: butler-sos
GITHUB_TOKEN: ${{ secrets.PAT }}
Expand All @@ -294,6 +316,7 @@ jobs:
- name: Install tool for creating stand-alone executables
run: |
npm install pkg --location=global
npm install --save-exact esbuild
- name: Install dependencies
run: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
Expand All @@ -44,7 +48,7 @@ jobs:

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -55,7 +59,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2
uses: github/codeql-action/autobuild@v3

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
Expand All @@ -69,4 +73,4 @@ jobs:
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
5 changes: 3 additions & 2 deletions .github/workflows/insiders-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,8 @@ jobs:
if: |
github.repository_owner == 'ptarmiganlabs' &&
matrix.os == 'ubuntu-latest'
uses: snyk/actions/node@master
continue-on-error: true
uses: snyk/actions/node@master
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
with:
Expand All @@ -204,7 +204,8 @@ jobs:
if: |
github.repository_owner == 'ptarmiganlabs' &&
matrix.os == 'ubuntu-latest'
uses: github/codeql-action/upload-sarif@v2
continue-on-error: true
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: snyk.sarif

Expand Down

0 comments on commit ad12afd

Please sign in to comment.