Skip to content

Commit

Permalink
Merge pull request #25 from SSLcom/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
bayrakmustafa authored Apr 3, 2024
2 parents 45d6844 + 3282507 commit a272724
Show file tree
Hide file tree
Showing 10 changed files with 310 additions and 90 deletions.
227 changes: 201 additions & 26 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ name: 'esigner-codesign'

on: [push]

env:
FILE_NAME: codesign.ps1

jobs:
build:
runs-on: ubuntu-latest
Expand All @@ -28,7 +25,41 @@ jobs:
shell: bash
run: |
mkdir -p ${GITHUB_WORKSPACE}/example
echo 'Write-Output -InputObject "Happy Signing From ESigner.com!"' > ${GITHUB_WORKSPACE}/example/${{env.FILE_NAME}}
echo 'Write-Output -InputObject "Happy Signing From ESigner.com!"' > ${GITHUB_WORKSPACE}/example/codesign1.ps1
- uses: ./
with:
command: sign
username: ${{ secrets.ES_USERNAME }}
password: ${{ secrets.ES_PASSWORD }}
credential_id: ${{ secrets.CREDENTIAL_ID }}
totp_secret: ${{ secrets.ES_TOTP_SECRET }}
file_path: ${GITHUB_WORKSPACE}/example/codesign1.ps1
output_path: ${GITHUB_WORKSPACE}/artifacts
malware_block: false
environment_name: TEST
jvm_max_memory: 2048M

- name: Upload Signed Files
uses: actions/upload-artifact@v3
with:
name: sign1.ps1
path: ./artifacts/codesign1.ps1

sign-v2:
strategy:
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]
runs-on: ${{ matrix.os }}
needs: ['build']
steps:
- uses: actions/checkout@v4

- name: Create Input file for test signing
shell: bash
run: |
mkdir -p ${GITHUB_WORKSPACE}/example
echo 'Write-Output -InputObject "Happy Signing From ESigner.com!"' > ${GITHUB_WORKSPACE}/example/codesign2.ps1
- uses: ./
with:
Expand All @@ -37,17 +68,18 @@ jobs:
password: ${{ secrets.ES_PASSWORD }}
credential_id: ${{ secrets.CREDENTIAL_ID }}
totp_secret: ${{ secrets.ES_TOTP_SECRET }}
file_path: ${GITHUB_WORKSPACE}/example/${{env.FILE_NAME}}
file_path: ${GITHUB_WORKSPACE}/example/codesign2.ps1
output_path: ${GITHUB_WORKSPACE}/artifacts
malware_block: false
environment_name: TEST
jvm_max_memory: 2048M
signing_method: v2

- name: Upload Signed Files
uses: actions/upload-artifact@v3
with:
name: sign.ps1
path: ./artifacts/codesign.ps1
name: sign1.ps1
path: ./artifacts/codesign2.ps1

sign-input-space:
strategy:
Expand All @@ -62,7 +94,8 @@ jobs:
shell: bash
run: |
mkdir -p ${GITHUB_WORKSPACE}/example
cp "./sample/sample file.exe" "${GITHUB_WORKSPACE}/example/sample file.exe"
cp "./sample/sample file.exe" "${GITHUB_WORKSPACE}/example/sample file1.exe"
cp "./sample/sample file.exe" "${GITHUB_WORKSPACE}/example/sample file2.exe"
- uses: ./
with:
Expand All @@ -71,17 +104,37 @@ jobs:
password: ${{ secrets.ES_PASSWORD }}
credential_id: ${{ secrets.CREDENTIAL_ID }}
totp_secret: ${{ secrets.ES_TOTP_SECRET }}
file_path: ${GITHUB_WORKSPACE}/example/sample file.exe
file_path: ${GITHUB_WORKSPACE}/example/sample file1.exe
output_path: ${GITHUB_WORKSPACE}/artifacts
malware_block: false
environment_name: TEST
jvm_max_memory: 2048M

- uses: ./
with:
command: sign
username: ${{ secrets.ES_USERNAME }}
password: ${{ secrets.ES_PASSWORD }}
credential_id: ${{ secrets.CREDENTIAL_ID }}
totp_secret: ${{ secrets.ES_TOTP_SECRET }}
file_path: ${GITHUB_WORKSPACE}/example/sample file2.exe
output_path: ${GITHUB_WORKSPACE}/artifacts
malware_block: false
environment_name: TEST
jvm_max_memory: 2048M
signing_method: v2

- name: Upload Signed Files
uses: actions/upload-artifact@v3
with:
name: sign-space.exe
path: ./artifacts/sample file.exe
path: ./artifacts/sample file1.exe

- name: Upload Signed Files
uses: actions/upload-artifact@v3
with:
name: sign-space.exe
path: ./artifacts/sample file2.exe

sign-override:
strategy:
Expand All @@ -96,7 +149,8 @@ jobs:
shell: bash
run: |
mkdir -p ${GITHUB_WORKSPACE}/example
echo 'Write-Output -InputObject "Happy Signing From ESigner.com!"' > ${GITHUB_WORKSPACE}/example/${{env.FILE_NAME}}
echo 'Write-Output -InputObject "Happy Signing From ESigner.com!"' > ${GITHUB_WORKSPACE}/example/codesign1.ps1
echo 'Write-Output -InputObject "Happy Signing From ESigner.com!"' > ${GITHUB_WORKSPACE}/example/codesign2.ps1
- uses: ./
with:
Expand All @@ -105,17 +159,37 @@ jobs:
password: ${{ secrets.ES_PASSWORD }}
credential_id: ${{ secrets.CREDENTIAL_ID }}
totp_secret: ${{ secrets.ES_TOTP_SECRET }}
file_path: ${GITHUB_WORKSPACE}/example/${{env.FILE_NAME}}
file_path: ${GITHUB_WORKSPACE}/example/codesign1.ps1
malware_block: false
override: true
environment_name: TEST
clean_logs: true

- name: Upload Signed Files
- uses: ./
with:
command: sign
username: ${{ secrets.ES_USERNAME }}
password: ${{ secrets.ES_PASSWORD }}
credential_id: ${{ secrets.CREDENTIAL_ID }}
totp_secret: ${{ secrets.ES_TOTP_SECRET }}
file_path: ${GITHUB_WORKSPACE}/example/codesign2.ps1
malware_block: false
override: true
environment_name: TEST
clean_logs: true
signing_method: v2

- name: Upload Signed Files (1)
uses: actions/upload-artifact@v3
with:
name: sign-override.ps1
path: ./example/codesign.ps1
name: sign-override1.ps1
path: ./example/codesign1.ps1

- name: Upload Signed Files (2)
uses: actions/upload-artifact@v3
with:
name: sign-override2.ps1
path: ./example/codesign2.ps1

sign-external:
strategy:
Expand All @@ -128,7 +202,8 @@ jobs:
shell: bash
run: |
mkdir -p ${GITHUB_WORKSPACE}/example
echo 'Write-Output -InputObject "Happy Signing From ESigner.com!"' > ${GITHUB_WORKSPACE}/example/${{env.FILE_NAME}}
echo 'Write-Output -InputObject "Happy Signing From ESigner.com!"' > ${GITHUB_WORKSPACE}/example/codesign1.ps1
echo 'Write-Output -InputObject "Happy Signing From ESigner.com!"' > ${GITHUB_WORKSPACE}/example/codesign2.ps1
- uses: sslcom/esigner-codesign@develop
with:
Expand All @@ -137,17 +212,37 @@ jobs:
password: ${{ secrets.ES_PASSWORD }}
credential_id: ${{ secrets.CREDENTIAL_ID }}
totp_secret: ${{ secrets.ES_TOTP_SECRET }}
file_path: ${GITHUB_WORKSPACE}/example/${{env.FILE_NAME}}
file_path: ${GITHUB_WORKSPACE}/example/codesign1.ps1
output_path: ${GITHUB_WORKSPACE}/artifacts
malware_block: false
environment_name: TEST
jvm_max_memory: 2048M

- name: Upload Signed Files
- uses: sslcom/esigner-codesign@develop
with:
command: sign
username: ${{ secrets.ES_USERNAME }}
password: ${{ secrets.ES_PASSWORD }}
credential_id: ${{ secrets.CREDENTIAL_ID }}
totp_secret: ${{ secrets.ES_TOTP_SECRET }}
file_path: ${GITHUB_WORKSPACE}/example/codesign2.ps1
output_path: ${GITHUB_WORKSPACE}/artifacts
malware_block: false
environment_name: TEST
jvm_max_memory: 2048M
signing_method: v2

- name: Upload Signed Files (1)
uses: actions/upload-artifact@v3
with:
name: sign-external1.ps1
path: ./artifacts/codesign1.ps1

- name: Upload Signed Files (2)
uses: actions/upload-artifact@v3
with:
name: sign-external.ps1
path: ./artifacts/codesign.ps1
name: sign-external2.ps1
path: ./artifacts/codesign2.ps1

sign-multi-same-job:
strategy:
Expand Down Expand Up @@ -190,17 +285,18 @@ jobs:
malware_block: false
environment_name: TEST
jvm_max_memory: 2048M
signing_method: v2

- name: Upload Signed Files (1)
uses: actions/upload-artifact@v3
with:
name: sign.ps1
name: sign1.ps1
path: ./artifacts/codesign1.ps1

- name: Upload Signed Files (2)
uses: actions/upload-artifact@v3
with:
name: sign.ps1
name: sign2.ps1
path: ./artifacts/codesign2.ps1

batch-sign:
Expand All @@ -219,8 +315,20 @@ jobs:
echo 'Write-Output -InputObject "Happy Signing From ESigner.com for Batch Sign 1!"' > ${GITHUB_WORKSPACE}/example/batch1.ps1
echo 'Write-Output -InputObject "Happy Signing From ESigner.com for Batch Sign 2!"' > ${GITHUB_WORKSPACE}/example/batch2.ps1
echo 'Write-Output -InputObject "Happy Signing From ESigner.com for Batch Sign 3!"' > ${GITHUB_WORKSPACE}/example/batch3.ps1
cp ./sample/minimal.exe ${GITHUB_WORKSPACE}/example/minimal.exe
cp ./sample/minimal.msi ${GITHUB_WORKSPACE}/example/minimal.msi
cp "./sample/minimal.exe" "${GITHUB_WORKSPACE}/example/minimal.exe"
cp "./sample/minimal.msi" "${GITHUB_WORKSPACE}/example/minimal.msi"
cp "./sample/sample file.exe" "${GITHUB_WORKSPACE}/example/sample file.exe"
- uses: ./
with:
command: batch_sign
username: ${{ secrets.ES_USERNAME }}
password: ${{ secrets.ES_PASSWORD }}
totp_secret: ${{ secrets.ES_TOTP_SECRET }}
dir_path: ${GITHUB_WORKSPACE}/example
output_path: ${GITHUB_WORKSPACE}/artifacts
environment_name: TEST
jvm_max_memory: 4096M

- uses: ./
with:
Expand All @@ -233,6 +341,7 @@ jobs:
output_path: ${GITHUB_WORKSPACE}/artifacts
environment_name: TEST
jvm_max_memory: 4096M
signing_method: v2

- name: Upload Signed Files
uses: actions/upload-artifact@v3
Expand All @@ -256,8 +365,9 @@ jobs:
echo 'Write-Output -InputObject "Happy Signing From ESigner.com for Batch Sign 1!"' > ${GITHUB_WORKSPACE}/example/batch1.ps1
echo 'Write-Output -InputObject "Happy Signing From ESigner.com for Batch Sign 2!"' > ${GITHUB_WORKSPACE}/example/batch2.ps1
echo 'Write-Output -InputObject "Happy Signing From ESigner.com for Batch Sign 3!"' > ${GITHUB_WORKSPACE}/example/batch3.ps1
cp ./sample/minimal.exe ${GITHUB_WORKSPACE}/example/minimal.exe
cp ./sample/minimal.msi ${GITHUB_WORKSPACE}/example/minimal.msi
cp "./sample/minimal.exe" "${GITHUB_WORKSPACE}/example/minimal.exe"
cp "./sample/minimal.msi" "${GITHUB_WORKSPACE}/example/minimal.msi"
cp "./sample/sample file.exe" "${GITHUB_WORKSPACE}/example/sample file.exe"
- uses: ./
with:
Expand All @@ -272,6 +382,71 @@ jobs:
malware_block: true
jvm_max_memory: 4096M

- uses: ./
with:
command: batch_sign
username: ${{ secrets.ES_USERNAME }}
password: ${{ secrets.ES_PASSWORD }}
credential_id: ${{ secrets.CREDENTIAL_ID }}
totp_secret: ${{ secrets.ES_TOTP_SECRET }}
dir_path: ${GITHUB_WORKSPACE}/example
output_path: ${GITHUB_WORKSPACE}/artifacts
environment_name: TEST
malware_block: true
jvm_max_memory: 4096M
signing_method: v2

- name: Upload Signed Files
uses: actions/upload-artifact@v3
with:
name: batch-sign
path: ./artifacts

batch-sign-credential-id:
strategy:
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]
runs-on: ${{ matrix.os }}
needs: ['sign', 'sign-override', 'sign-external']
steps:
- uses: actions/checkout@v4

- name: Create multiple Input file for test signing
shell: bash
run: |
mkdir -p ${GITHUB_WORKSPACE}/example
echo 'Write-Output -InputObject "Happy Signing From ESigner.com for Batch Sign 1!"' > ${GITHUB_WORKSPACE}/example/batch1.ps1
echo 'Write-Output -InputObject "Happy Signing From ESigner.com for Batch Sign 2!"' > ${GITHUB_WORKSPACE}/example/batch2.ps1
echo 'Write-Output -InputObject "Happy Signing From ESigner.com for Batch Sign 3!"' > ${GITHUB_WORKSPACE}/example/batch3.ps1
cp "./sample/minimal.exe" "${GITHUB_WORKSPACE}/example/minimal.exe"
cp "./sample/minimal.msi" "${GITHUB_WORKSPACE}/example/minimal.msi"
cp "./sample/sample file.exe" "${GITHUB_WORKSPACE}/example/sample file.exe"
- uses: ./
with:
command: batch_sign
username: ${{ secrets.ES_USERNAME }}
password: ${{ secrets.ES_PASSWORD }}
credential_id: ${{ secrets.CREDENTIAL_ID }}
totp_secret: ${{ secrets.ES_TOTP_SECRET }}
dir_path: ${GITHUB_WORKSPACE}/example
output_path: ${GITHUB_WORKSPACE}/artifacts
environment_name: TEST
jvm_max_memory: 4096M

- uses: ./
with:
command: batch_sign
username: ${{ secrets.ES_USERNAME }}
password: ${{ secrets.ES_PASSWORD }}
credential_id: ${{ secrets.CREDENTIAL_ID }}
totp_secret: ${{ secrets.ES_TOTP_SECRET }}
dir_path: ${GITHUB_WORKSPACE}/example
output_path: ${GITHUB_WORKSPACE}/artifacts
environment_name: TEST
jvm_max_memory: 4096M
signing_method: v2

- name: Upload Signed Files
uses: actions/upload-artifact@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .prettierrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"printWidth": 180,
"printWidth": 210,
"tabWidth": 4,
"useTabs": false,
"semi": true,
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,8 @@

# Maximumx JVM heap size
jvm_max_memory: 1024M

# Code signing method. Default is v1. Supported values: v1, v2
signing_method: v1
```
<!-- end usage -->
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ inputs:
description: ""
required: false
default: "1024M"
signing_method:
description: ""
required: false
default: "v1"
runs:
using: 'node20'
main: 'dist/index.js'
Loading

0 comments on commit a272724

Please sign in to comment.