Skip to content

Commit

Permalink
ci: add github action
Browse files Browse the repository at this point in the history
  • Loading branch information
haloivanid committed Aug 10, 2023
1 parent 705c19d commit a5722bc
Show file tree
Hide file tree
Showing 5 changed files with 2,817 additions and 49 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Publish to NPM

on:
push:
branches:
- master

jobs:
publish:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18.16'
registry-url: 'https://registry.npmjs.org'
scope: '@haloivanid'

- name: Install dependencies
run: npm ci

- run: npm i -g semantic-release

- name: Build lib folder
run: ./build.sh

- name: Publish to NPM
run: |
cd lib
npx semantic-release
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
1 change: 0 additions & 1 deletion .npmrc

This file was deleted.

2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ mkdir ./lib
yarn build

cp ./package.lib.json ./lib/package.json
cp .npmrc ./lib/.npmrc
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> ~/lib/.npmrc
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ingress-prime-stat",
"description": "A lightweight conversion for Ingress Prime stat in TypeScript",
"version": "0.0.0-development-rev",
"version": "0.0.0-development",
"main": "src/main.ts",
"author": "haloivanid <[email protected]>",
"repository": {
Expand All @@ -21,7 +21,8 @@
"dev": "nodemon --watch 'src/**/*.ts' --exec 'ts-node' src/main.ts",
"test": "jest",
"lint": "eslint --ext .ts src --fix",
"format": "prettier --write \"**/*.ts\""
"format": "prettier --write \"**/*.ts\"",
"semantic-release": "semantic-release"
},
"dependencies": {
"dayjs": "^1.11.9"
Expand All @@ -38,6 +39,7 @@
"eslint-plugin-prettier": "^5.0.0",
"jest": "^29.6.2",
"prettier": "^3.0.1",
"semantic-release": "^21.0.7",
"terser": "^5.19.2",
"ts-jest": "^29.1.1",
"ts-node": "^10.9.1",
Expand Down
Loading

0 comments on commit a5722bc

Please sign in to comment.