diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..8392d15 --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +use flake \ No newline at end of file diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml new file mode 100644 index 0000000..494ddae --- /dev/null +++ b/.github/workflows/publish.yaml @@ -0,0 +1,29 @@ +name: publish package + +on: + release: + types: [published] + +jobs: + publish: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: "18" + registry-url: "https://npm.pkg.github.com" + + - name: Install dependencies + run: npm ci + + - name: Publish package + run: npm publish + env: + NODE_AUTH_TOKEN: ${{ github.token }} diff --git a/.gitignore b/.gitignore index 0dea980..eeb3b0f 100644 --- a/.gitignore +++ b/.gitignore @@ -59,3 +59,5 @@ typings/ .DS_Store lib + +.direnv/ diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000..5445e80 --- /dev/null +++ b/.npmignore @@ -0,0 +1,4 @@ +.envrc +flake.nix +flake.lock +.github/ diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..243fce9 --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +@newredo:registry=https://npm.pkg.github.com/ \ No newline at end of file diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..234dbb2 --- /dev/null +++ b/flake.lock @@ -0,0 +1,60 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1705309234, + "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1707753121, + "narHash": "sha256-av10YDOsYR8/p5r+haQGLCYwUp/6wvlMzOnRCSa7ZQM=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "29f575d7e680cae88c1863fb0a029accd0a1a01d", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..f46051d --- /dev/null +++ b/flake.nix @@ -0,0 +1,10 @@ +{ + inputs = { + flake-utils.url = "github:numtide/flake-utils"; + nixpkgs.url = "github:NixOS/nixpkgs"; + }; + outputs = { self, flake-utils, nixpkgs }: + flake-utils.lib.eachDefaultSystem (system: + let pkgs = import nixpkgs { inherit system; }; + in { devShell = pkgs.mkShell { packages = [ pkgs.nodejs_18 ]; }; }); +} diff --git a/package.json b/package.json index a81b886..dc28e4b 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "multer-cloud-storage", + "name": "@newredo/multer-cloud-storage", "version": "3.1.0", "description": "Multer storage engine for Google Cloud Storage", "main": "lib/index.js",