From 5b81ed0811e94fc6c7acdc1d06c109a413f29894 Mon Sep 17 00:00:00 2001 From: Jesus Vilar Date: Tue, 1 Oct 2024 19:49:02 +0200 Subject: [PATCH 1/4] ci: add gh actions --- .github/workflows/publish.yaml | 26 +++++++++++++++++++++ .github/workflows/pull-request.yaml | 35 +++++++++++++++++++++++++++++ .github/workflows/push.yaml | 26 +++++++++++++++++++++ .gitignore | 2 ++ 4 files changed, 89 insertions(+) create mode 100644 .github/workflows/publish.yaml create mode 100644 .github/workflows/pull-request.yaml create mode 100644 .github/workflows/push.yaml diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml new file mode 100644 index 000000000..335ba92c3 --- /dev/null +++ b/.github/workflows/publish.yaml @@ -0,0 +1,26 @@ +name: "Publish package to registry" + +on: + release: + types: [published] + +jobs: + build-and-publish: + runs-on: "ubuntu-latest" + steps: + - uses: actions/checkout@v3 + - uses: stafftastic/google-artifact-registry-npmrc-action@v1.0.0 + with: + scope: stafftastic + project: stafftastic + repository: npm + serviceAccountKey: ${{secrets.GOOGLE_ARTIFACT_REGISTRY_SA_KEY}} + - uses: actions/setup-node@v3 + with: + node-version: "20" + registry-url: "https://europe-west3-npm.pkg.dev/stafftastic/npm/" + scope: "@stafftastic" + - run: npm version --no-git-tag-version ${GITHUB_REF_NAME#v} + - run: npm ci + - run: npm run build + - run: npm publish diff --git a/.github/workflows/pull-request.yaml b/.github/workflows/pull-request.yaml new file mode 100644 index 000000000..2b467bfe9 --- /dev/null +++ b/.github/workflows/pull-request.yaml @@ -0,0 +1,35 @@ +name: "Pull Request checks" + +on: + - pull_request + +jobs: + build: + runs-on: "ubuntu-latest" + steps: + - uses: actions/checkout@v3 + - uses: stafftastic/google-artifact-registry-npmrc-action@v1.0.0 + with: + scope: stafftastic + project: stafftastic + repository: npm + serviceAccountKey: ${{secrets.GOOGLE_ARTIFACT_REGISTRY_SA_KEY}} + - uses: actions/setup-node@v3 + with: + node-version: 20 + - run: npm install + - run: npm run build + cyclic-dependencies: + runs-on: "ubuntu-latest" + steps: + - uses: actions/checkout@v3 + - uses: stafftastic/google-artifact-registry-npmrc-action@v1.0.0 + with: + scope: stafftastic + project: stafftastic + repository: npm + serviceAccountKey: ${{secrets.GOOGLE_ARTIFACT_REGISTRY_SA_KEY}} + - uses: actions/setup-node@v3 + with: + node-version: 20 + - run: npx dpdm --exit-code circular:1 ./src/index.ts diff --git a/.github/workflows/push.yaml b/.github/workflows/push.yaml new file mode 100644 index 000000000..4c5a79465 --- /dev/null +++ b/.github/workflows/push.yaml @@ -0,0 +1,26 @@ +name: "Push checks" + +on: "push" + +jobs: + chromatic-deployment: + runs-on: "ubuntu-latest-m" + steps: + - name: Checkout repository + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - uses: stafftastic/google-artifact-registry-npmrc-action@v1.0.0 + with: + scope: stafftastic + project: stafftastic + repository: npm + serviceAccountKey: ${{secrets.GOOGLE_ARTIFACT_REGISTRY_SA_KEY}} + - name: Install dependencies + run: | + npm install + - name: Publish to Chromatic + uses: chromaui/action@v1 + with: + projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} + onlyChanged: true diff --git a/.gitignore b/.gitignore index bfba3972a..e8caa7a05 100644 --- a/.gitignore +++ b/.gitignore @@ -29,3 +29,5 @@ pnpm-debug.log* .eslintcache # Local Netlify folder .netlify + +.npmrc \ No newline at end of file From 564d0da5caa3404de599b83836f166ffc3aaaa34 Mon Sep 17 00:00:00 2001 From: Jesus Vilar Date: Tue, 1 Oct 2024 19:49:27 +0200 Subject: [PATCH 2/4] feat: adjust package name --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 228b44d94..5aab97f76 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "v-calendar", + "name": "@stafftastic/v-calendar", "type": "module", "version": "3.1.2", "description": "A calendar and date picker plugin for Vue.js.", From 26a58426ee4162dd75793e6f91c2d0cb8b68ca5d Mon Sep 17 00:00:00 2001 From: Jesus Vilar Date: Tue, 1 Oct 2024 20:16:40 +0200 Subject: [PATCH 3/4] ci: use npmjs --- .github/workflows/publish.yaml | 27 +++++++++++---------------- .github/workflows/pull-request.yaml | 12 ------------ .github/workflows/push.yaml | 26 -------------------------- 3 files changed, 11 insertions(+), 54 deletions(-) delete mode 100644 .github/workflows/push.yaml diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 335ba92c3..8c24e3d91 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -8,19 +8,14 @@ jobs: build-and-publish: runs-on: "ubuntu-latest" steps: - - uses: actions/checkout@v3 - - uses: stafftastic/google-artifact-registry-npmrc-action@v1.0.0 - with: - scope: stafftastic - project: stafftastic - repository: npm - serviceAccountKey: ${{secrets.GOOGLE_ARTIFACT_REGISTRY_SA_KEY}} - - uses: actions/setup-node@v3 - with: - node-version: "20" - registry-url: "https://europe-west3-npm.pkg.dev/stafftastic/npm/" - scope: "@stafftastic" - - run: npm version --no-git-tag-version ${GITHUB_REF_NAME#v} - - run: npm ci - - run: npm run build - - run: npm publish + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: "20.x" + registry-url: "https://registry.npmjs.org" + - run: npm version --no-git-tag-version ${GITHUB_REF_NAME#v} + - run: npm ci + - run: npm run build + - run: npm publish --access public + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/pull-request.yaml b/.github/workflows/pull-request.yaml index 2b467bfe9..fceb50455 100644 --- a/.github/workflows/pull-request.yaml +++ b/.github/workflows/pull-request.yaml @@ -8,12 +8,6 @@ jobs: runs-on: "ubuntu-latest" steps: - uses: actions/checkout@v3 - - uses: stafftastic/google-artifact-registry-npmrc-action@v1.0.0 - with: - scope: stafftastic - project: stafftastic - repository: npm - serviceAccountKey: ${{secrets.GOOGLE_ARTIFACT_REGISTRY_SA_KEY}} - uses: actions/setup-node@v3 with: node-version: 20 @@ -23,12 +17,6 @@ jobs: runs-on: "ubuntu-latest" steps: - uses: actions/checkout@v3 - - uses: stafftastic/google-artifact-registry-npmrc-action@v1.0.0 - with: - scope: stafftastic - project: stafftastic - repository: npm - serviceAccountKey: ${{secrets.GOOGLE_ARTIFACT_REGISTRY_SA_KEY}} - uses: actions/setup-node@v3 with: node-version: 20 diff --git a/.github/workflows/push.yaml b/.github/workflows/push.yaml deleted file mode 100644 index 4c5a79465..000000000 --- a/.github/workflows/push.yaml +++ /dev/null @@ -1,26 +0,0 @@ -name: "Push checks" - -on: "push" - -jobs: - chromatic-deployment: - runs-on: "ubuntu-latest-m" - steps: - - name: Checkout repository - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - uses: stafftastic/google-artifact-registry-npmrc-action@v1.0.0 - with: - scope: stafftastic - project: stafftastic - repository: npm - serviceAccountKey: ${{secrets.GOOGLE_ARTIFACT_REGISTRY_SA_KEY}} - - name: Install dependencies - run: | - npm install - - name: Publish to Chromatic - uses: chromaui/action@v1 - with: - projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} - onlyChanged: true From c2e1726f5d0d87cdd1ce59da90353e1d18030816 Mon Sep 17 00:00:00 2001 From: Jesus Vilar Date: Tue, 1 Oct 2024 20:20:34 +0200 Subject: [PATCH 4/4] ci: skip cyclic deps check --- .github/workflows/pull-request.yaml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/pull-request.yaml b/.github/workflows/pull-request.yaml index fceb50455..561af972d 100644 --- a/.github/workflows/pull-request.yaml +++ b/.github/workflows/pull-request.yaml @@ -13,11 +13,3 @@ jobs: node-version: 20 - run: npm install - run: npm run build - cyclic-dependencies: - runs-on: "ubuntu-latest" - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: 20 - - run: npx dpdm --exit-code circular:1 ./src/index.ts