From 99ea5dfda4306844b9323a01461a3d4ed5e40aeb Mon Sep 17 00:00:00 2001 From: mararok <5163714+Mararok@users.noreply.github.com> Date: Mon, 4 Nov 2024 19:59:18 +0100 Subject: [PATCH] chore: prepare release --- .github/CODEOWNERS | 1 + .github/actions/test/action.yaml | 10 ++++++++ .github/workflows/pr.yaml | 19 ++++++++++++++++ .github/workflows/publish.yaml | 39 ++++++++++++++++++++++++++++++++ .yarnrc.yml | 6 +++++ package.json | 6 ++--- 6 files changed, 77 insertions(+), 4 deletions(-) create mode 100644 .github/CODEOWNERS create mode 100644 .github/actions/test/action.yaml create mode 100644 .github/workflows/pr.yaml create mode 100644 .github/workflows/publish.yaml diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..bf30a23 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1 @@ +/.github/ @Mararok \ No newline at end of file diff --git a/.github/actions/test/action.yaml b/.github/actions/test/action.yaml new file mode 100644 index 0000000..9690654 --- /dev/null +++ b/.github/actions/test/action.yaml @@ -0,0 +1,10 @@ +name: Test +description: 'execute tests' +runs: + using: 'composite' + steps: + # Yarn test + - name: Test + shell: bash + run: yarn test + diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml new file mode 100644 index 0000000..3a348c3 --- /dev/null +++ b/.github/workflows/pr.yaml @@ -0,0 +1,19 @@ +name: Pull Request +on: + pull_request: + branches: [master] + +jobs: + check: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # 4.1.6 + - name: Yarn install + uses: hexancore/yarn-ci-install@ba9baf131eba84b6c86efb46375a530a3098bb04 # 0.1.0 + - name: Lint + run: yarn lint + - name: test + uses: ./.github/actions/test + - name: build + run: yarn build diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml new file mode 100644 index 0000000..a611a98 --- /dev/null +++ b/.github/workflows/publish.yaml @@ -0,0 +1,39 @@ +name: Publish +env: + HUSKY: 0 +on: + release: + types: [published] + +jobs: + check: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # 4.1.6 + + - name: Yarn install + uses: hexancore/yarn-ci-install@ba9baf131eba84b6c86efb46375a530a3098bb04 # 0.1.0 + - name: Test + uses: ./.github/actions/test + publish: + needs: [check] + permissions: + contents: write + id-token: write + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # 4.1.6 + - name: Yarn install + uses: hexancore/yarn-ci-install@ba9baf131eba84b6c86efb46375a530a3098bb04 # 0.1.0 + - name: Build + run: yarn build + + # Publish package + - name: Publish + shell: bash + run: | + npm publish --provenance --access public --tag latest + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.yarnrc.yml b/.yarnrc.yml index 3186f3f..c57f29a 100644 --- a/.yarnrc.yml +++ b/.yarnrc.yml @@ -1 +1,7 @@ nodeLinker: node-modules + +npmPublishRegistry: "https://registry.npmjs.org" + +npmRegistryServer: "https://registry.npmjs.org" + +yarnPath: .yarn/releases/yarn-4.1.0.cjs diff --git a/package.json b/package.json index e4c0944..78bfe16 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@hexancore/mocker", - "version": "1.1.2", + "version": "1.2.0", "keywords": [ "mock", "typescript", @@ -20,9 +20,7 @@ "engine-strict": true, "description": "Simple and magical mocks for TypeScript, works with jest and vitest", "author": { - "name": "Andrzej Wasiak", - "email": "contact@andrzejwasiak.pl", - "url": "https://andrzejwasiak.pl" + "name": "Andrzej Wasiak" }, "license": "MIT", "main": "lib/index.js",