Merge pull request #22 from rimonhanna/dependabot/npm_and_yarn/json5-… #128
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 is a basic workflow to help you get started with Actions | |
name: Release | |
# Controls when the action will run. Triggers the workflow on push or pull request | |
# events but only for the master branch | |
on: | |
workflow_dispatch: | |
push: | |
branches: [master] | |
jobs: | |
build: | |
name: Release | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [macos-latest, windows-latest] | |
steps: | |
- name: Cache multiple paths | |
uses: actions/cache@v2 | |
with: | |
path: | | |
~/cache | |
!~/cache/exclude | |
**/node_modules | |
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }} | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: "14" | |
check-latest: true | |
- name: Increment version | |
run: npm version patch --no-git-tag-version | |
- name: Install dependancies | |
run: npm install | |
- name: Prepare for app notarization | |
if: matrix.os == 'macos-latest' | |
run: | | |
mkdir -p ~/private_keys/ | |
echo '${{ secrets.APPLE_API_KEY }}' > ~/private_keys/AuthKey_${{ secrets.APPLE_API_KEY_ID }}.p8 | |
- name: Get package version | |
id: package_version | |
shell: bash | |
run: | | |
PACKAGE_VERSION=$(cat package.json \ | |
| grep version \ | |
| head -1 \ | |
| awk -F: '{ print $2 }' \ | |
| sed 's/[",]//g' \ | |
| tr -d '[[:space:]]') | |
echo "$PACKAGE_VERSION" | |
echo "::set-output name=PACKAGE_VERSION::$PACKAGE_VERSION" | |
- name: Build/release Electron app | |
if: matrix.os == 'macos-latest' | |
run: npm run publish | |
env: | |
# macOS Code signing certificates | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
CSC_LINK: ${{ secrets.CERTIFICATE_OSX_APPLICATION }} | |
CSC_KEY_PASSWORD: ${{ secrets.CERTIFICATE_OSX_PASSWORD }} | |
# macOS notarization API key | |
API_KEY_ID: ${{ secrets.APPLE_API_KEY_ID }} | |
API_KEY_ISSUER_ID: ${{ secrets.APPLE_API_KEY_ISSUER_ID }} | |
- name: Build/release Electron app | |
if: matrix.os == 'windows-latest' | |
run: npm run publish | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: "Commit updated package.json to repo" | |
uses: stefanzweifel/[email protected] | |
with: | |
commit_message: "Created new package version" | |
file_pattern: ./package*.json | |
push_options: "--force" |