Skip to content

Commit

Permalink
Added build action
Browse files Browse the repository at this point in the history
  • Loading branch information
elumixor committed Apr 26, 2024
1 parent dee1c58 commit 6d90cd8
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 19 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Node.js CI

on: [push]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v1
- run: bun install
- run: bun run build

test:
needs: build
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: oven-sh/setup-bun@v1
- run: bun install
- run: bun test

publish:
needs: [build, test]
if: github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v1
- uses: actions/setup-node@v4
with:
node-version: "20.x"
registry-url: "https://registry.npmjs.org"

- name: Check if version has been updated
id: check
uses: EndBug/version-check@v2

- run: bun install
if: steps.check.outputs.changed == 'true'

- run: bun run build
if: steps.check.outputs.changed == 'true'

- run: npm publish --access public
if: steps.check.outputs.changed == 'true'
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- run: 'echo "Package version has not been updated, skipping publish"'
if: steps.check.outputs.changed == 'false'
19 changes: 0 additions & 19 deletions .github/workflows/workflow.yml

This file was deleted.

4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
"main": "dist/index.js",
"types": "dist/index.d.ts",
"type": "module",
"repository": {
"type": "git",
"url": "git+https://github.com/elumixor/angular-server.git"
},
"scripts": {
"build": "tsup",
"test": "bun test",
Expand Down

0 comments on commit 6d90cd8

Please sign in to comment.