From 7537284b560506d3bcc87584126f485b590405b6 Mon Sep 17 00:00:00 2001 From: Sally Mclean Date: Mon, 15 Jul 2024 18:59:27 +0200 Subject: [PATCH] chore: add release (#2) * add tests for passing options * fix workflows * add node version * size * size * fix sizelimit * workflow' * size * fix branch * size * release * test * test * remove version * tests * on push main --- .github/workflows/pull_request.yml | 7 +- .github/workflows/size.yml | 17 - .github/workflows/test_and_release.yml | 44 + .gitignore | 1 + .releaserc.json | 9 + README.md | 4 + package-lock.json | 9256 +++++++++++++++++++----- package.json | 7 +- src/App.vue | 6 +- src/hooks/index.ts | 11 +- src/index.ts | 3 +- src/main.ts | 2 +- src/plugin/index.ts | 10 +- src/tests/App.test.ts | 9 +- src/version.ts | 1 - vitest.config.ts | 3 + 16 files changed, 7376 insertions(+), 2014 deletions(-) delete mode 100644 .github/workflows/size.yml create mode 100644 .github/workflows/test_and_release.yml create mode 100644 .releaserc.json delete mode 100644 src/version.ts diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index d1f14b2..dfb5e2d 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -1,4 +1,4 @@ -name: Test, build, and size limit +name: Test, lint, build on: [pull_request] jobs: build: @@ -26,3 +26,8 @@ jobs: - name: Build run: npm run build + + - name: Size Limit + uses: andresz1/size-limit-action@v1 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/size.yml b/.github/workflows/size.yml deleted file mode 100644 index 3c65328..0000000 --- a/.github/workflows/size.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: "size" -on: - pull_request: - branches: - - main -permissions: - pull-requests: write -jobs: - size: - runs-on: ubuntu-latest - env: - CI_JOB_NUMBER: 1 - steps: - - uses: actions/checkout@v1 - - uses: andresz1/size-limit-action@v1 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/test_and_release.yml b/.github/workflows/test_and_release.yml new file mode 100644 index 0000000..3a823bf --- /dev/null +++ b/.github/workflows/test_and_release.yml @@ -0,0 +1,44 @@ +name: Test and 🚀 Release +on: + push: + branches: + - main +jobs: + build: + name: Build, lint, and test on Node + + runs-on: ubuntu-latest + + steps: + - name: Checkout repo + uses: actions/checkout@v4 + + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version-file: '.nvmrc' + + - name: Install deps and build (with cache) + uses: bahmutov/npm-install@v1 + + - name: Lint + run: npm run lint + + - name: Test + run: npm test + + - name: Build + run: npm run build + + - name: Size Limit + uses: andresz1/size-limit-action@v1 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + + - name: 🚀 Release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + run: | + npm install @semantic-release/changelog @semantic-release/git --ignore-scripts --no-save + npx semantic-release \ No newline at end of file diff --git a/.gitignore b/.gitignore index f9262fe..3221b8e 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ lerna-debug.log* node_modules dist dist-ssr +coverage *.local # Editor directories and files diff --git a/.releaserc.json b/.releaserc.json new file mode 100644 index 0000000..dc1e20a --- /dev/null +++ b/.releaserc.json @@ -0,0 +1,9 @@ +{ + "branches": [{ "name": "beta", "prerelease": true }], + "plugins": [ + "@semantic-release/commit-analyzer", + "@semantic-release/release-notes-generator", + "@semantic-release/github", + "@semantic-release/npm" + ] + } \ No newline at end of file diff --git a/README.md b/README.md index 33895ab..0a49e14 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,9 @@ # Vue 3 + TypeScript + Vite +[![semantic-release: angular](https://img.shields.io/badge/semantic--release-angular-e10079?logo=semantic-release)](https://github.com/semantic-release/semantic-release) + + + This template should help get you started developing with Vue 3 and TypeScript in Vite. The template uses Vue 3 `