Update GitHub Actions workflow to optimize build and release process #20
Workflow file for this run
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
name: Build and Release | |
on: | |
push: | |
tags: | |
- 'v*.*.*' | |
jobs: | |
build: | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '18' | |
- name: Install dependencies | |
run: npm install | |
- name: Build and Package the app | |
run: npm run package | |
env: | |
NODE_ENV: production | |
- name: Upload Build Artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
name: comet-${{ matrix.os }} | |
path: out/make/**/*.* | |
release: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Download Artifacts (Linux) | |
if: matrix.os == 'ubuntu-latest' | |
uses: actions/download-artifact@v2 | |
with: | |
name: comet-ubuntu-latest | |
path: ./artifacts/ubuntu | |
- name: Download Artifacts (Windows) | |
if: matrix.os == 'windows-latest' | |
uses: actions/download-artifact@v2 | |
with: | |
name: comet-windows-latest | |
path: ./artifacts/windows | |
- name: Download Artifacts (macOS) | |
if: matrix.os == 'macos-latest' | |
uses: actions/download-artifact@v2 | |
with: | |
name: comet-macos-latest | |
path: ./artifacts/macos | |
- name: Install Dependencies | |
run: npm ci | |
- name: Publish to GitHub Releases | |
run: npm run publish -- --prerelease | |
env: | |
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} |