Skip to content

action trigger

action trigger #2

Workflow file for this run

name: Build and Release
on:
push:
branches:
- master
paths:
- 'package.json'
jobs:
build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- name: Read Node.js version from package.json
id: node_version
run: echo "NODE_VERSION=$(node -p "require('./package.json').engines.node")" >> $GITHUB_ENV
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- name: Install Dependencies
run: npm install --verbose
- name: Build Electron App
run: npm run build --verbose
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Get Version from package.json
id: package_version
run: echo "VERSION=$(node -p "require('./package.json').version")" >> $GITHUB_ENV
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.VERSION }}
release_name: Release ${{ env.VERSION }}
draft: false
prerelease: true
- name: Upload DMG to Release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: "./dist/Menu Barmaid-${{ env.VERSION }}.dmg"
asset_name: Menu-Barmaid-${{ env.VERSION }}.dmg
asset_content_type: application/x-dmg