From a89c8c4eb4ccff90f2e9e7ba6c4c189ae183fcb5 Mon Sep 17 00:00:00 2001 From: Adrian Date: Wed, 13 Sep 2023 14:27:45 +0200 Subject: [PATCH] Bumbped version to 1.0.2. Added cicd github action. --- .github/workflows/{release.yml => cicd.yml} | 24 ++++++++++++++---- .github/workflows/test.yml | 25 ------------------- package.json | 2 +- third_party_licenses/dev_detailed.json | 2 +- third_party_licenses/production_detailed.json | 2 +- 5 files changed, 22 insertions(+), 33 deletions(-) rename .github/workflows/{release.yml => cicd.yml} (60%) delete mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/release.yml b/.github/workflows/cicd.yml similarity index 60% rename from .github/workflows/release.yml rename to .github/workflows/cicd.yml index 8dcaad7..e8c608a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/cicd.yml @@ -1,13 +1,27 @@ -name: Publish release +name: CI/CD on: push: - branches: [ release ] + pull_request: jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [16.x, 18.x] + steps: + - uses: actions/checkout@v3 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + - run: npm ci + - run: npm test publish: name: Publish runs-on: ubuntu-latest + needs: test if: startsWith(github.ref, 'refs/tags/v') steps: - name: Checkout the repository @@ -19,17 +33,17 @@ jobs: - name: Install dependencies run: npm ci - name: Publish package to NPM - run: npm publish + run: npm publish --access=public env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - name: Build package to upload to GitHub releases run: | npm pack - mv @acpr/rate-limit-postgresql-*.tgz rate-limit-postgresql.tgz + mv acpr-rate-limit-postgresql-*.tgz acpr-rate-limit-postgresql.tgz - name: Create a Github release uses: softprops/action-gh-release@v1 with: - files: rate-limit-postgresql.tgz + files: acpr-rate-limit-postgresql.tgz body: You can view the changelog [here](https://github.com/adrianprelipcean/express-rate-limit-postgresql/blob/master/changelog.md). \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index 8c0955e..0000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: Run tests - -on: - push: - branches: [ master ] - pull_request: - branches: [ master, release ] - -jobs: - build: - - runs-on: ubuntu-latest - - strategy: - matrix: - node-version: [16.x, 18.x] - - steps: - - uses: actions/checkout@v3 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node-version }} - - run: npm ci - - run: npm test diff --git a/package.json b/package.json index 83df77c..20a475c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@acpr/rate-limit-postgresql", - "version": "1.0.0", + "version": "1.0.2", "description": "A PostgreSQL store for the `express-rate-limit` middleware", "homepage": "https://github.com/adrianprelipcean/express-rate-limit-postgresql", "repository": "https://github.com/adrianprelipcean/express-rate-limit-postgresql", diff --git a/third_party_licenses/dev_detailed.json b/third_party_licenses/dev_detailed.json index ef4f9d1..5ec2c03 100644 --- a/third_party_licenses/dev_detailed.json +++ b/third_party_licenses/dev_detailed.json @@ -1,5 +1,5 @@ { - "@acpr/rate-limit-postgresql@1.0.0": { + "@acpr/rate-limit-postgresql@1.0.2": { "licenses": "MIT", "repository": "https://github.com/adrianprelipcean/express-rate-limit-postgresql", "publisher": "Adrian C. Prelipcean" diff --git a/third_party_licenses/production_detailed.json b/third_party_licenses/production_detailed.json index e612c09..6ce662c 100644 --- a/third_party_licenses/production_detailed.json +++ b/third_party_licenses/production_detailed.json @@ -1,5 +1,5 @@ { - "@acpr/rate-limit-postgresql@1.0.0": { + "@acpr/rate-limit-postgresql@1.0.2": { "licenses": "MIT", "repository": "https://github.com/adrianprelipcean/express-rate-limit-postgresql", "publisher": "Adrian C. Prelipcean"