From e753d563a1e642a4460436e25b68e81c1d73a754 Mon Sep 17 00:00:00 2001 From: mauricius Date: Sun, 14 Jan 2024 15:26:31 +0100 Subject: [PATCH] Add publish action --- .github/workflows/cypress.yml | 6 +++--- .github/workflows/pages.yml | 6 +++--- .github/workflows/publish.yml | 35 +++++++++++++++++++++++++++++++++++ .github/workflows/test.yml | 4 ++-- CHANGELOG.md | 8 ++++---- 5 files changed, 47 insertions(+), 12 deletions(-) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/cypress.yml b/.github/workflows/cypress.yml index 3a14a0e..5631421 100644 --- a/.github/workflows/cypress.yml +++ b/.github/workflows/cypress.yml @@ -4,12 +4,12 @@ on: push: branches: - master - pull_request: - workflow_dispatch: + pull_request: + workflow_dispatch: jobs: cypress-run: - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index a49aa64..bb32071 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -1,9 +1,9 @@ name: Publish GitHub pages on: - push: - pull_request: - workflow_dispatch: + release: + types: [published] + workflow_dispatch: permissions: contents: read diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..363bc1a --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,35 @@ +name: Publish Package to NPM + +on: + release: + types: [published] + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup .npmrc file to publish to npm + uses: actions/setup-node@v4 + with: + node-version: 18 + cache: npm + registry-url: 'https://registry.npmjs.org' + + - id: get_version + uses: battila7/get-version-action@v2 + + - run: npm --no-git-tag-version version ${{ steps.get_version.outputs.version-without-v }} + + - name: Install dependencies + run: npm ci + + - name: Build + run: npm run build + + - name: Publish the package with public visibility + run: npm publish --access public + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e0669df..eb080d0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,8 +2,8 @@ name: Continuous tests on: push: - pull_request: - workflow_dispatch: + pull_request: + workflow_dispatch: concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 1faa58f..556ca94 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,11 +2,11 @@ All notable changes to `vue-draggable-resizable` will be documented in this file -## 3.0.0 - ? -- Migrates to vue 3 +## 3.0.0 - 2024-01-14 +- Migrates to Vue 3 - Updates all packages -- Adds vitest instead of mocha and karma for testing -- Adds vite instead of webpack +- Adds Vitest instead of Mocha and Karma for testing +- Adds Vite instead of Webpack - Adds Cypress to component-test the package in real browsers - Fix `drag-stop` and `resize-stop` events - And minor changes