Repository navigation
changed action #4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: DigiCert test | |
| on: [push] | |
| jobs: | |
| create-bin: | |
| runs-on: windows-latest | |
| steps: | |
| - name: Copy binary to workspace | |
| run: cp c:\\Windows\\notepad.exe ${{ github.workspace }}\\binary.exe | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: my-binary | |
| path: ${{ github.workspace }}\\binary.exe | |
| binary-sign: | |
| runs-on: windows-latest | |
| steps: | |
| - run: echo "The job was automatically triggered by a ${{ github.event_name }} event." | |
| - name: Check out repository code | |
| uses: actions/checkout@v4 | |
| - name: Copy artifact to workspace | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: my-binary | |
| path: ${{ github.workspace }} | |
| - name: List files in the repository | |
| run: | | |
| ls ${{ github.workspace }} | |
| - name: Install DigiCert Client tools from Github Custom Actions marketplace | |
| uses: digicert/code-signing-software-trust-action@v1 | |
| - name: Set up certificate | |
| run: | | |
| echo "${{ secrets.WINDOWS_CERT_DATA }}" | base64 --decode > /d/Certificate_pkcs12.p12 | |
| shell: bash | |
| - name: Set variables | |
| id: variables | |
| run: | | |
| # echo "version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT | |
| echo "SM_HOST=${{ secrets.KEYLOCKER_HOST }}" >> "$GITHUB_ENV" | |
| echo "SM_API_KEY=${{ secrets.KEYLOCKER_API_KEY }}" >> "$GITHUB_ENV" | |
| echo "SM_CLIENT_CERT_FILE=D:\\Certificate_pkcs12.p12" >> "$GITHUB_ENV" | |
| echo "SM_CLIENT_CERT_PASSWORD=${{ secrets.WINDOWS_CERT_PASSWORD }}" >> "$GITHUB_ENV" | |
| shell: bash | |
| # - name: Signing using certificate fingerprint | |
| # run: | | |
| # smctl sign --fingerprint ${{ secrets.KEYLOCKER_CERT_SHA1_HASH }} --input binary.exe --config-file "C:\\Users\\RUNNER~1\\AppData\\Local\\Temp\\smtools-windows-x64\\pkcs11properties.cfg" | |
| # shell: cmd | |
| - name: Signing using keypair alias | |
| run: | | |
| smctl sign --keypair-alias ${{ secrets.KEYLOCKER_KEYPAIR_ALIAS }} --input binary.exe | |
| shell: cmd | |
| - name: upload signed installer | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: Installer-signed | |
| path: | | |
| ${{ github.workspace }}\\binary.exe | |
| if-no-files-found: error | |
| - run: echo "This job's status is ${{ job.status }}." | |