Skip to content

Merge pull request #348 from oslabs-beta/master #23

Merge pull request #348 from oslabs-beta/master

Merge pull request #348 from oslabs-beta/master #23

name: Master Workflow
on:
push:
branches:
- master
jobs:
tests:
strategy:
matrix:
node-version: [16]
os: [macos-latest, ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: npm i && npm ci
- name: Run unit tests
uses: coactions/setup-xvfb@v1
with:
run: npm run test-jest
create_release:
needs: tests
runs-on: windows-latest
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: '16.15'
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
with:
tag_name: v1.16.0 # Replace with your desired tag or version number
release_name: Release v1.16.0 # Replace with your desired release name
draft: true
body: |
<Temporary Body for Github Release>
windows:
needs: create_release
runs-on: windows-latest
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: '16.15'
- name: Install Dependencies
run: npm install
- name: Build and Package for Windows
run: npm run package-win
linux:
needs: create_release
runs-on: ubuntu-latest # Using a Linux runner
env: # Adding the environment variable for the GH_TOKEN
GH_TOKEN: ${{ secrets.GH_TOKEN }}
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: '16.15' # Use the specific version of Node that your project requires
- name: Install Dependencies
run: npm install
- name: Build and Package for Linux
run: npm run package-linux
# Optional step to upload the Linux package as an artifact
- name: Upload Linux Package
uses: actions/upload-artifact@v2
with:
name: linux-app
path: release/Swell-1.15.0.AppImage # Change the path according to your Linux build output
mac:
needs: create_release
runs-on: macOS-latest
env: # Adding the environment variable for the GH_TOKEN
GH_TOKEN: ${{ secrets.GH_TOKEN }}
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: '16.15' # Use the specific version of Node that your project requires
- name: Install Dependencies
run: npm install
- name: Build and Package for Mac
run: npm run package-mac