diff --git a/.github/workflows/chrome.yml b/.github/workflows/chrome-tests.yml similarity index 86% rename from .github/workflows/chrome.yml rename to .github/workflows/chrome-tests.yml index a4ea12a..f6ace9a 100644 --- a/.github/workflows/chrome.yml +++ b/.github/workflows/chrome-tests.yml @@ -1,6 +1,13 @@ name: Chrome -on: [push] +on: + pull_request: + push: + branches: + - '*' + tags-ignore: + - '*' + workflow_call: jobs: cypress-ct: diff --git a/.github/workflows/firefox.yml b/.github/workflows/firefox-tests.yml similarity index 85% rename from .github/workflows/firefox.yml rename to .github/workflows/firefox-tests.yml index 0f14bb5..56dd772 100644 --- a/.github/workflows/firefox.yml +++ b/.github/workflows/firefox-tests.yml @@ -1,6 +1,13 @@ name: Firefox -on: [push] +on: + pull_request: + push: + branches: + - '*' + tags-ignore: + - '*' + workflow_call: jobs: cypress-ct: diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..a110980 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,39 @@ +name: Publish to NPM + +on: + push: + tags: ['v*'] + workflow_dispatch: + +jobs: + chrome-tests-workflow: + uses: ./.github/workflows/chrome-tests.yml + firefox-tests-workflow: + uses: ./.github/workflows/firefox-tests.yml + publish: + needs: [chrome-tests-workflow, firefox-tests-workflow] + runs-on: ubuntu-latest + permissions: + contents: read + id-token: write + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: '20.x' + registry-url: 'https://registry.npmjs.org' + - uses: pnpm/action-setup@v2 + name: Install pnpm + with: + version: 8 + run_install: true + - name: Build package + run: pnpm build + - name: Copy README and LICENSE + run: cp README.md LICENSE packages/vue-use-fixed-header + - name: Pack + run: cd packages/vue-use-fixed-header && rm -rf *.tgz && npm pack + - name: Publish + run: cd packages/vue-use-fixed-header && npm publish *.tgz --provenance --access public + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/README.md b/README.md index 4737660..3fb0340 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -![npm](https://img.shields.io/npm/v/vue-use-fixed-header?color=46c119) ![dependency-count](https://img.shields.io/badge/dependencies-0-success) ![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/smastrom/vue-use-fixed-header/chrome.yml?branch=main&label=chrome) ![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/smastrom/vue-use-fixed-header/firefox.yml?branch=main&label=firefox) +![npm](https://img.shields.io/npm/v/vue-use-fixed-header?color=46c119) ![dependency-count](https://img.shields.io/badge/dependencies-0-success) ![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/smastrom/vue-use-fixed-header/chrome-tests.yml?branch=main&label=chrome) ![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/smastrom/vue-use-fixed-header/firefox-tests.yml?branch=main&label=firefox) # Vue Use Fixed Header