Skip to content

Commit

Permalink
fix pipeline issue
Browse files Browse the repository at this point in the history
Signed-off-by: seven <[email protected]>
  • Loading branch information
Blankll committed Jan 27, 2024
1 parent e47a29d commit bf1490f
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 20 deletions.
14 changes: 0 additions & 14 deletions .github/workflows/node.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
name: Node.js CI

on:
push:
branches: [master]
pull_request:
branches: [master]

Expand Down Expand Up @@ -35,15 +33,3 @@ jobs:
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- run: npm run build
- name: Compare Versions
run: |
TAG_VERSION=$(echo ${{env.TAG}} | tr -dc '0-9')
PACKAGE_VERSION=$(echo ${{env.PACKAGE}} | tr -dc '0-9')
if (( $((10#$PACKAGE_VERSION + 1)) > $((10#$TAG_VERSION + 1)) )); then
echo "new version start release"
echo "RELEASE=true" >> "$GITHUB_ENV"
else
echo "no new version to release"
echo "RELEASE=false" >> "$GITHUB_ENV"
fi
58 changes: 58 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: release

on:
push:
branches: [master]

jobs:
release:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
node-version: [20.x]

runs-on: ${{ matrix.os }}
timeout-minutes: 20

steps:
- name: Github checkout
uses: actions/checkout@v4
if: matrix.os == 'ubuntu-latest'
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Install dependencies
run: npm ci
- run: npm run lint:check
- run: npm audit --audit-level=critical
- run: npm run test:ci
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: build 🔧
run: npm run build
- name: Generate changelog
uses: jaywcjlove/changelog-generator@main
id: changelog
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Build Release
uses: jaywcjlove/create-tag-action@main
id: tag_release
with:
release: true
token: ${{ secrets.GITHUB_TOKEN }}
body: |
${{ steps.changelog.outputs.compareurl }}
${{ steps.changelog.outputs.changelog }}
- name: Publish package on NPM 📦
if: steps.tag_release.outputs.successful
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
{
"name": "hostsless",
"name": "@geek-fun/hostsless",
"version": "0.0.0",
"description": "Full life cycle cross providers serverless application management for your fast-growing business.",
"main": "index.js",
"homepage": "https://hostsless.geekfun.club",
"main": "dist/src/index.js",
"types": "dist/src/index.d.ts",
"bin": {
"hls": "dist/src/commands/index.js"
},
Expand All @@ -15,7 +17,7 @@
},
"repository": {
"type": "git",
"url": "git@github.com:geek-fun/hostsless.git"
"url": "git+https://github.com/geek-fun/hostsless.git"
},
"author": "geekfun <[email protected]>",
"license": "Apache-2.0",
Expand All @@ -27,7 +29,6 @@
"i18n": "^0.15.1",
"pino": "^8.17.2"
},
"homepage": "https://hostsless.geekfun.club",
"devDependencies": {
"@types/i18n": "^0.13.10",
"@types/jest": "^29.5.11",
Expand Down
2 changes: 2 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"compilerOptions": {
"target": "ES2020",
"module": "commonjs",
"declaration": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
Expand All @@ -12,3 +13,4 @@
},
"include": ["src/**/*"]
}

0 comments on commit bf1490f

Please sign in to comment.