Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating build and release actions #1

Merged
merged 3 commits into from
Nov 21, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Build

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.x, 18.x, 20.x]

steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm run build-release
31 changes: 31 additions & 0 deletions .github/workflows/release.yml
aidanm3341 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Create Release

on:
push:
branches: [ main ]
workflow_dispatch:

jobs:
build:
name: Create Release
runs-on: ubuntu-latest
steps:

- name: Checkout
uses: actions/checkout@v2
aidanm3341 marked this conversation as resolved.
Show resolved Hide resolved
with:
fetch-depth: 0

- name: Setup Node
uses: actions/setup-node@v2
aidanm3341 marked this conversation as resolved.
Show resolved Hide resolved
with:
node-version: '16.x'
aidanm3341 marked this conversation as resolved.
Show resolved Hide resolved

- name: Install node modules and verify build
run: npm install && npm run build-release

- name: Publish
if: steps.release.outputs.released == 'true'
uses: JS-DevTools/npm-publish@v1
aidanm3341 marked this conversation as resolved.
Show resolved Hide resolved
with:
token: ${{ secrets.NPM_TOKEN }}