forked from twilio/twilio-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: adding windows package signing configurations (twilio#341)
* feat: added windows signing * feat: added windows signing * feat: revert release yml changes Co-authored-by: Sindhura Chamala <[email protected]>
- Loading branch information
Showing
2 changed files
with
92 additions
and
4 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
name: Windows Executable Release | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
formula: | ||
description: 'Artifact Prefix' | ||
default: twilio | ||
workflow_run: | ||
# wait for Cli Release to complete, when it completes, start this workflow | ||
workflows: ["Cli Release"] | ||
branches: [main] | ||
types: | ||
- completed | ||
inputs: | ||
formula: | ||
description: 'Artifact Prefix' | ||
default: twilio | ||
jobs: | ||
get-tag: | ||
runs-on: macos-latest | ||
outputs: | ||
TAG_NAME: ${{steps.get-tag.outputs.TAG_NAME}} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Getting latest tag | ||
id: get-tag | ||
run: | | ||
git fetch --prune --unshallow | ||
echo "::set-output name=TAG_NAME::$(git describe --tags $(git rev-list --tags --max-count=1))" | ||
pack-windows-release: | ||
runs-on: macos-latest | ||
needs: [get-tag] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- run: | | ||
make install | ||
brew install makensis | ||
npx oclif-dev pack:win | ||
- name: upload artifact | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: ${{ github.event.inputs.formula }}-${{ needs.get-tag.outputs.TAG_NAME }}.exe | ||
path: dist/win/${{ github.event.inputs.formula }}-v${{ needs.get-tag.outputs.TAG_NAME }}-x86.exe | ||
retention-days: 1 | ||
|
||
sign-windows-release: | ||
needs: [pack-windows-release, get-tag] | ||
runs-on: windows-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- run: make install | ||
- name: import certificate | ||
run: | | ||
New-Item -ItemType directory -Path certificate | ||
Set-Content -Path certificate\certificate.txt -Value '${{ secrets.WINDOWS_CERTIFICATE }}' | ||
certutil -decode certificate\certificate.txt certificate\certificate.pfx | ||
- name: import Executable | ||
id: download | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: ${{ github.event.inputs.formula }}-${{ needs.get-tag.outputs.TAG_NAME }}.exe | ||
- name: 'Echo download path' | ||
run: ls ${{steps.download.outputs.download-path}} | ||
- name: Code Sign The Executable | ||
run: | | ||
& 'C:/Program Files (x86)/Windows Kits/10/bin/10.0.17763.0/x86/signtool.exe' sign /f certificate\certificate.pfx /p '${{ secrets.WINDOWS_CERTIFICATE_PASS }}' /t http://timestamp.digicert.com ${{steps.download.outputs.download-path}}/${{ github.event.inputs.formula }}-v${{ needs.get-tag.outputs.TAG_NAME }}-x86.exe | ||
- name: Upload binaries to release | ||
run: node .github/scripts/update-platform-executables.js | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
FILE: ${{steps.download.outputs.download-path}}\${{ github.event.inputs.formula }}-v${{ needs.get-tag.outputs.TAG_NAME }}-x86.exe | ||
ASSET_NAME: ${{ github.event.inputs.formula }}-${{ needs.get-tag.outputs.TAG_NAME }}.exe | ||
TAG_NAME: ${{ needs.get-tag.outputs.TAG_NAME }} | ||
REPO_NAME: twilio/twilio-cli | ||
|
||
notify-complete-fail: | ||
if: ${{ failure() || cancelled() }} | ||
needs: [sign-windows-release ] | ||
name: Notify Release Failed | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Slack Notification | ||
uses: rtCamp/action-slack-notify@v2 | ||
env: | ||
SLACK_WEBHOOK: ${{ secrets.ALERT_SLACK_WEB_HOOK }} | ||
SLACK_COLOR: "#ff3333" | ||
SLACK_USERNAME: CLI Release Bot | ||
SLACK_ICON_EMOJI: ":ship:" | ||
SLACK_TITLE: "Twilio Cli" | ||
SLACK_MESSAGE: 'Windows Executable Release Failed' | ||
MSG_MINIMAL: actions url |