Skip to content

Commit

Permalink
Merge pull request #4 from haqq-network/feat/release-publish
Browse files Browse the repository at this point in the history
feat: release and publish
  • Loading branch information
olegshilov committed Apr 30, 2024
2 parents 4537635 + 500afa2 commit cf7bad3
Show file tree
Hide file tree
Showing 13 changed files with 4,136 additions and 73 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,13 @@ on:
- master
pull_request:

env:
HUSKY: 0

jobs:
checks:
runs-on: ubuntu-latest
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }}
strategy:
matrix:
node-version: [18.x, 20.x]
Expand All @@ -20,7 +24,7 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
cache: yarn
- name: Setup dependencies
- name: Install dependencies
run: yarn install --immutable
# - name: Run lint
# run: yarn lint
Expand Down
48 changes: 48 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Manual Release

on:
workflow_dispatch:
inputs:
releaseType:
description: 'Type of release (major, minor, patch)'
required: true
default: 'patch'

env:
HUSKY: 0

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout the repo
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: 'yarn'

- name: Install dependencies
run: yarn install --immutable

- name: Build package
run: yarn build

- name: Print npm packed tarball info
run: npm pack --dry-run

# - name: Configure bot
# run: |
# git config user.name ${{ secrets.GITHUB_BOT_USERNAME }}
# git config user.email ${{ secrets.GITHUB_BOT_EMAIL }}
# git remote set-url origin https://${{ secrets.GITHUB_BOT_TOKEN }}@github.com/haqq-network/app-store-scraper.git

- name: Release
run: yarn semantic-release --release-type ${{ github.event.inputs.releaseType }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "${0%/*}/_/h"

yarn commitlint --edit $1
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "${0%/*}/_/h"

yarn lint-staged
5 changes: 5 additions & 0 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env sh
. "${0%/*}/_/h"

yarn lint
yarn test
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
20.12.2
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.old_tests
.yarn
.yarnrc.yml
2 changes: 2 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ nodeLinker: node-modules

tsEnableAutoTypes: true

npmRegistryServer: 'https://registry.npmjs.org'

yarnPath: .yarn/releases/yarn-4.1.1.cjs

npmPublishRegistry: https://registry.npmjs.org/
3 changes: 3 additions & 0 deletions commitlint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default {
extends: ['@commitlint/config-conventional'],
};
6 changes: 6 additions & 0 deletions lint-staged.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export default {
'*.{ts,js,tsx,jsx,cjs,mjs,css,json,md,mdx,html,yaml,yml}': [
'yarn lint --fix',
'yarn prettier --write',
],
};
39 changes: 27 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{
"name": "@haqq/app-store-scraper",
"version": "0.19.0",
"description": "scrape data from the itunes app store",
"license": "MIT",
"description": "Scrape data from the itunes app store",
"homepage": "https://github.com/haqq-network/app-store-scraper#readme",
"source": "src/index.ts",
"main": "dist/main.js",
"module": "dist/module.js",
Expand All @@ -11,47 +13,60 @@
"build": "yarn parcel build",
"test": "yarn ts-node test",
"lint": "yarn eslint",
"format": "yarn prettier --write '**/*.{ts,js,tsx,jsx,cjs,mjs,css,json,md,mdx,html,yaml,yml}'"
},
"repository": {
"type": "git",
"url": "git+https://github.com/haqq-network/app-store-scraper.git"
"format": "yarn prettier --write '**/*.{ts,js,tsx,jsx,cjs,mjs,css,json,md,mdx,html,yaml,yml}'",
"install:husky": "husky || true",
"prepare": "yarn install:husky",
"postinstall": "yarn prepare",
"prepack": "yarn pinst --disable",
"postpack": "yarn pinst --enable"
},
"keywords": [
"mac",
"app",
"store",
"app store",
"itunes",
"scraper"
],
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/haqq-network/app-store-scraper.git"
},
"bugs": {
"url": "https://github.com/haqq-network/app-store-scraper/issues"
},
"homepage": "https://github.com/haqq-network/app-store-scraper#readme",
"dependencies": {
"axios": "1.6.8",
"cheerio": "1.0.0-rc.12",
"got": "14.2.1",
"ramda": "0.29.0",
"ramda": "0.30.0",
"xml2js": "0.6.2"
},
"devDependencies": {
"@eslint/js": "9.1.1",
"@parcel/packager-ts": "2.12.0",
"@parcel/transformer-typescript-types": "2.12.0",
"@semantic-release/changelog": "6.0.3",
"@semantic-release/git": "10.0.1",
"@semantic-release/npm": "12.0.0",
"@types/cheerio": "0.22.35",
"@types/node": "20.12.7",
"@types/ramda": "0.29.12",
"@types/xml2js": "0.4.14",
"eslint": "9.1.1",
"eslint-config-prettier": "9.1.0",
"globals": "15.1.0",
"husky": "9.0.11",
"lint-staged": "15.2.2",
"parcel": "2.12.0",
"pinst": "3.0.0",
"prettier": "3.2.5",
"semantic-release": "23.0.8",
"ts-node": "10.9.2",
"typescript": "5.4.5",
"typescript-eslint": "7.8.0"
},
"packageManager": "yarn@4.1.1"
"packageManager": "yarn@4.1.1",
"engines": {
"node": ">=20.10",
"yarn": ">=4.0"
}
}
17 changes: 17 additions & 0 deletions release.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
export default {
branches: ['master'],
plugins: [
'@semantic-release/commit-analyzer',
'@semantic-release/release-notes-generator',
'@semantic-release/changelog',
['@semantic-release/npm'],
[
'@semantic-release/git',
{
assets: ['package.json', 'CHANGELOG.md'],
message:
'chore(release): ${nextRelease.version}\n\n${nextRelease.notes}\n\n[skip ci]',
},
],
],
};
Loading

0 comments on commit cf7bad3

Please sign in to comment.