diff --git a/.github/workflows/release-package.yml b/.github/workflows/release-package.yml new file mode 100644 index 0000000..f7d923c --- /dev/null +++ b/.github/workflows/release-package.yml @@ -0,0 +1,26 @@ +name: Tweet Harvest Package + +on: + release: + types: [created] + +jobs: + build-publish: + needs: build + runs-on: ubuntu-latest + permissions: + packages: write + contents: read + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 16 + registry-url: https://npm.pkg.github.com/ + - run: npm install -g pnpm + - run: pnpm install + - run: pnpm run build + - run: pnpm run build:pkg + - run: npm publish + env: + NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/package.json b/package.json index ad7e945..b17d35b 100644 --- a/package.json +++ b/package.json @@ -1,11 +1,12 @@ { "name": "tweet-harvest", "description": "A Twitter crawler helper with auth", - "version": "0.0.21", + "version": "0.0.23", "license": "MIT", "author": "Helmi Satria", "publishConfig": { - "registry": "https://registry.npmjs.org/" + "registry": "https://registry.npmjs.org/", + "@helmisatria:registry": "https://npm.pkg.github.com/" }, "repository": { "type": "git", @@ -37,6 +38,7 @@ "scripts": { "start": "ts-node src/crawl.ts", "dev": "ts-node-dev --respawn --transpile-only src/crawl.ts", - "build": "tsc" + "build": "tsc", + "build:pkg": "pkg . --out-path dist/bin" } }