From 3822b96205f31d2f13b07ca180d231df1c99fdaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dalibor=20Karlovi=C4=87?= Date: Fri, 17 Feb 2023 19:05:20 +0100 Subject: [PATCH] infra: NPM setup (#111) * infra: NPM setup * fix: ignore package.json * fix: release * fix: release * fix: release NPM * fix: release NPM * fix: release NPM * fix: release NPM --- .gitattributes | 1 + .github/workflows/release.yaml | 15 +++++++++++++++ package.json | 23 +++++++++++++++++++++++ 3 files changed, 39 insertions(+) create mode 100644 .github/workflows/release.yaml create mode 100644 package.json diff --git a/.gitattributes b/.gitattributes index b64f18f..68242c0 100644 --- a/.gitattributes +++ b/.gitattributes @@ -3,3 +3,4 @@ /*dist export-ignore /composer.lock export-ignore /Makefile export-ignore +/package.json export-ignore diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..67ad255 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,15 @@ +on: + release: + +jobs: + ReleaseNPM: + runs-on: ubuntu-latest + steps: + - name: Repo checkout + uses: actions/checkout@v3 + - name: Set release version to package.json + run: jq --indent 4 '.version = "${{ github.ref }}"' < package.json > package.json~ && mv package.json~ package.json + - name: NPM release + run: npm publish + env: + NODE_AUTH_TOKEN: "${{ secrets.NPMJS_SECRET }}" diff --git a/package.json b/package.json new file mode 100644 index 0000000..ff44562 --- /dev/null +++ b/package.json @@ -0,0 +1,23 @@ +{ + "name": "@sigwinhq/infra", + "description": "Sigwin's default per-project infra", + "version": "1.0.0", + "repository": { + "type": "git", + "url": "git@github.com:sigwinhq/infra.git" + }, + "keywords": [ + "sigwin", + "infra" + ], + "license": "MIT", + "bugs": { + "url": "https://github.com/sigwinhq/infra/issues" + }, + "homepage": "https://github.com/sigwinhq/infra#readme", + "files": [ + "resources", + "package.json", + "README.md" + ] +}