Skip to content

Commit

Permalink
ci: Add github action workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
nizarfadlan committed Apr 3, 2024
1 parent 027cd05 commit c3bf613
Show file tree
Hide file tree
Showing 2 changed files with 83 additions and 4 deletions.
77 changes: 77 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Release

on:
push:
tags:
- "v*"

permissions: write-all

jobs:
release:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Fetching tags
run: git fetch --tags -f || true

- name: Setup Node
uses: actions/setup-node@v3.6.0
with:
node-version: ${{ matrix.node-version}}

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT

- uses: actions/cache@v3
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install Dependencies
run: yarn install

- name: Check linting
run: yarn run lint

- name: Generate Changelog
uses: scottbrenner/generate-changelog-action@master
id: generate_changelog
env:
REPO: ${{ github.repository }}

- name: Check package version
uses: technote-space/package-version-check-action@v1

- name: Make Package
run: npm pack

- name: Rename Pack
run: mv *.tgz baileys-api.tgz

- name: Create Release
uses: meeDamian/github-release@2.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref }}
name: ${{ github.ref_name }}
body: ${{ steps.generate_changelog.outputs.changelog }}
draft: false
prerelease: false
files: >
baileys-api.tgz
gzip: folders
allow_override: true
10 changes: 6 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
{
"name": "baileys-express",
"version": "1.1.0",
"description": "baileys ",
"name": "baileys-api",
"version": "1.1.2",
"description": "Simple WhatsApp REST API with multiple device support",
"main": "dist/index.js",
"scripts": {
"build": "tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./src",
"start": "node -r tsconfig-paths/register -r ts-node ./dist/index.js",
"dev": "nodemon src/index.ts",
"lint": "eslint . --ext .ts",
"format": "prettier . --write",
"generate": "prisma generate"
"generate": "prisma generate",
"version": "npm run build && git add -A dist",
"postversion": "git push && git push --tags && rm -rf build/temp"
},
"keywords": [],
"author": "Nizar",
Expand Down

0 comments on commit c3bf613

Please sign in to comment.