From 681dfbab92b65d5962073b91f45b0ce2ee7ab455 Mon Sep 17 00:00:00 2001 From: Michael Mannseicher Date: Wed, 2 Aug 2023 14:18:41 +0200 Subject: [PATCH] add: deployment --- .github/workflows/{test.yml => ci.yml} | 31 ++++++++++++++++++++++++++ .gitignore | 1 + LICENSE | 2 +- package.json | 5 +++-- 4 files changed, 36 insertions(+), 3 deletions(-) rename .github/workflows/{test.yml => ci.yml} (54%) diff --git a/.github/workflows/test.yml b/.github/workflows/ci.yml similarity index 54% rename from .github/workflows/test.yml rename to .github/workflows/ci.yml index ac40d00..0851045 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/ci.yml @@ -31,4 +31,35 @@ jobs: - run: yarn install --frozen-lockfile - run: yarn lint - run: yarn build + - name: Add artifact to github + uses: actions/upload-artifact@v2 + with: + name: artifact + path: dist - run: yarn test + npm-publish: + needs: [build] + name: npm-publish + runs-on: ubuntu-latest + # only on master + if: github.ref == 'refs/heads/master' + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v1 + with: + node-version: 10.x + - name: Download build + uses: actions/download-artifact@v2 + with: + name: artifact + path: dist + - run: yarn release:package + - name: Publish if version in package.json change + uses: springtype-org/github-action-npm-publish@master + with: + install_build_packages: false + project_build_dir: release + create_tag: true + auth_token: ${{ secrets.NPM_TOKEN }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore index 7727a46..9b624d8 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ coverage .env /.idea/ /yarn-error.log +release \ No newline at end of file diff --git a/LICENSE b/LICENSE index 058d0b3..3b8d1a2 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2023 Aron Homberg and JS Heaven contributors +Copyright (c) 2023 Michael Mannseicher and JS Heaven contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/package.json b/package.json index 8e58f3d..deb1ccc 100644 --- a/package.json +++ b/package.json @@ -19,17 +19,18 @@ }, "scripts": { "prepare": "husky install", - "pretest": "yarn build --dev", "test": "NODE_OPTIONS='--experimental-vm-modules --enable-source-maps --no-warnings' jest --verbose --coverage ./test/*.test.ts ./test/**/*.test.ts", "clean": "rm -rf ./dist && rm -rf ./coverage", "lint": "prettier --check .", "lint:fix": "prettier --write .", "prebuild": "yarn clean", "build": "yarn node --enable-source-maps ./build.mjs", + "prerelease:package": "rm -rf ./release", + "release:package": "mkdir release && cp -r dist package.json LICENSE README.md release/", "pre-commit": "yarn lint", "pre-push": "yarn lint" }, - "author": "Aron Homberg ", + "author": "Michael Mannseicher", "sideEffects": false, "exports": { ".": {