From 1f9ec689775fb02cfba8eb616cfe1ce1496c99a1 Mon Sep 17 00:00:00 2001 From: Ayooluwa Isaiah Date: Mon, 2 Oct 2023 19:01:22 +0200 Subject: [PATCH] automate publishing to NPM --- .github/workflows/npm.yml | 29 +++++++++++++++++++++++++++++ package.json | 22 ++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 .github/workflows/npm.yml create mode 100644 package.json diff --git a/.github/workflows/npm.yml b/.github/workflows/npm.yml new file mode 100644 index 0000000..4dce44e --- /dev/null +++ b/.github/workflows/npm.yml @@ -0,0 +1,29 @@ +name: Publish to NPM + +on: + workflow_dispatch: + push: + tags: + - 'v*' + +jobs: + build: + name: Publish new Focus version + runs-on: ubuntu-latest + + steps: + - name: Check out the code + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + registry-url: https://registry.npmjs.org/ + node-version: '20' + + - name: Publish + run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/package.json b/package.json new file mode 100644 index 0000000..1e8cbf7 --- /dev/null +++ b/package.json @@ -0,0 +1,22 @@ +{ + "name": "@ayoisaiah/focus", + "version": "1.3.0", + "description": "Focus is a command-line productivity timer based on the Pomodoro Technique", + "main": "", + "repository": "https://github.com/ayoisaiah/focus", + "author": "Ayooluwa Isaiah ", + "license": "MIT", + "dependencies": { + "@ayoisaiah/go-npm": "^0.1.13" + }, + "scripts": { + "postinstall": "go-npm install", + "preuninstall": "go-npm uninstall" + }, + "goBinary": { + "name": "focus", + "path": "./bin", + "url": "https://github.com/ayoisaiah/focus/releases/download/v{{version}}/focus_{{version}}_{{platform}}_{{arch}}.tar.gz" + }, + "private": false +}