Skip to content

Commit

Permalink
fix: testing CI
Browse files Browse the repository at this point in the history
  • Loading branch information
gremp committed Dec 9, 2023
1 parent 8593753 commit 3707c0f
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 61 deletions.
9 changes: 3 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 8
- uses: actions/setup-node@v3
with:
node-version: 18.x

- run: pnpm install --no-frozen-lockfile
- run: pnpm run tsc
- run: pnpm run test
- run: npm install
- run: npm run tsc -- --noEmit
- run: npm run test
44 changes: 18 additions & 26 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
name: Release Workflow
name: Release & Publish ro NPM

on:
push:
branches:
- main
on: workflow_dispatch

jobs:
release:
Expand All @@ -17,36 +14,31 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18' # specify your Node.js version here
node-version: '18'

# Installing dependencies
- name: Install Dependencies
run: npm install
run: npm ci

# Building the project
- name: Build
run: npm build

# Preparing package for release
- name: Prepare Package
run: cp package.json README.md pkg/
# Initializing git config
- name: Initialize git user
run: |
git config --global user.email "[email protected]"
git config --global user.name "Release n Publish Workflow"
# Switching to 'releases' branch
- name: Switch to Releases Branch
run: git checkout releases
# Initializing the npm with the $NPM_TOKEN
- name: Initialize the NPM config
run: npm config set //registry.npmjs.org/:_authToken $NPM_TOKEN
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

# Cleaning and updating the branch
- name: Update Releases Branch
run: |
git rm -rf ./*
cp -R pkg/* .
git add .
git commit -m "auto-generate release $(git rev-parse --short HEAD)"
git push origin releases
# Building the project
- name: Build
run: npm tsc

# Running release-it
- name: Release to NPM
run: npm run release
run: npm run release -- --ci
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -132,3 +132,4 @@ dist
/pkg
.idea
.DS_Store
.npmrc
30 changes: 30 additions & 0 deletions .release-it.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"git": {
"requireBranch": "main",
"commitMessage": "chore: release v${version}"
},
"github": {
"release": true
},
"npm": {
"publish": true
},
"plugins": {
"@release-it/conventional-changelog": {
"infile": "CHANGELOG.md",
"preset": {
"name": "conventionalcommits",
"types": [
{
"type": "feat",
"section": "Features"
},
{
"type": "fix",
"section": "Bug Fixes"
}
]
}
}
}
}
29 changes: 0 additions & 29 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,34 +53,5 @@
"express": "^4.18.2",
"lodash": "^4.17.21",
"reflect-metadata": "^0.1.13"
},
"release-it": {
"git": {
"commitMessage": "chore: release v${version}"
},
"github": {
"release": true
},
"npm": {
"publish": true
},
"plugins": {
"@release-it/conventional-changelog": {
"infile": "CHANGELOG.md",
"preset": {
"name": "conventionalcommits",
"types": [
{
"type": "feat",
"section": "Features"
},
{
"type": "fix",
"section": "Bug Fixes"
}
]
}
}
}
}
}

0 comments on commit 3707c0f

Please sign in to comment.