diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 65ff3b8..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,126 +0,0 @@ -version: 2.1 - -executors: - basic: - docker: - - image: cimg/base:stable - -commands: - bootstrap: - description: Bootstraps the NodeJS environment along with Yarn and the project dependencies - parameters: - nodejs: - description: The NodeJS version to install - type: string - default: "" - - steps: - - checkout: - path: ~/repos/rxjs-axios - - - run: - name: Install NVM and NodeJS - command: | - curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash - echo 'export NVM_DIR="$HOME/.nvm"' >> $BASH_ENV - echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" --install' >> $BASH_ENV - source $BASH_ENV - - - when: - condition: << parameters.nodejs >> - steps: - - run: - name: Install NodeJS v<< parameters.nodejs >> - command: | - nvm install << parameters.nodejs >> - nvm use << parameters.nodejs >> - nvm alias default << parameters.nodejs >> - node --version - - - run: - name: Install yarn - command: npm install -g yarn - - - restore_cache: - keys: - - yarn-v1-{{ checksum "yarn.lock" }} - - - run: - name: Install packages - command: yarn install --immutable - - - save_cache: - paths: - - ~/repos/rxjs-axios/.yarn/cache - key: yarn-v1-{{ checksum "yarn.lock" }} - -jobs: - build: - working_directory: ~/repos/rxjs-axios - executor: basic - parameters: - nodejs: - description: The NodeJS version to install - type: string - rxjs: - description: The RxJS version to use - type: string - axios: - description: The Axios version to use - type: string - - steps: - - bootstrap: - nodejs: << parameters.nodejs >> - - - run: - name: Install RxJS v<< parameters.rxjs >> - command: yarn add --dev rxjs@^<< parameters.rxjs >> - - - run: - name: Install Axios v<< parameters.axios >> - command: yarn add --dev axios@^<< parameters.axios >> - - - run: - name: Compile - command: yarn compile - - - run: - name: Lint - command: yarn lint - - - run: - name: Test - command: yarn test --forbid-only - - release: - working_directory: ~/repos/rxjs-axios - executor: basic - - steps: - - bootstrap - - - run: - name: Build - command: yarn build - - - run: - name: Release - command: yarn release - -workflows: - main: - jobs: - - build: - matrix: - parameters: - nodejs: ["16", "17", "18", "19", "20"] - rxjs: ["5.5.12", "6.6.7", "7.8.1"] - axios: ["1.0.0", "1.1.3", "1.2.6", "1.3.6", "1.4.0"] - - - release: - requires: - - build - filters: - branches: - only: release diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..e9b97a0 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,42 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + workflow_call: + +concurrency: + group: ci-${{ github.ref_name }} + cancel-in-progress: true + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + nodejs: [16, 17, 18, 19, 20] + rxjs: [5, 6, 7] + axios: ["1.0", 1.1, 1.2, 1.3, 1.4] + + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.nodejs }} + cache: yarn + - run: yarn install --immutable + - run: yarn add --dev rxjs@~${{ matrix.rxjs }} + - run: yarn add --dev axios@^${{ matrix.axios }} + - run: yarn compile + - run: yarn lint + - run: yarn test --forbid-only + + check: + runs-on: ubuntu-latest + needs: build + + steps: + - uses: re-actors/alls-green@release/v1 + with: + jobs: ${{ toJson(needs) }} diff --git a/.github/workflows/owner-approve.yml b/.github/workflows/owner-approve.yml index 4e9aad9..b21829c 100644 --- a/.github/workflows/owner-approve.yml +++ b/.github/workflows/owner-approve.yml @@ -8,8 +8,6 @@ jobs: approve: if: github.actor == github.repository_owner runs-on: ubuntu-latest - permissions: - pull-requests: write steps: - uses: hmarr/auto-approve-action@v3 with: diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index b84a27d..ff81371 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -1,10 +1,8 @@ ---- - name: Pages on: - push: - branches: [release] + workflow_call: + workflow_dispatch: permissions: contents: read @@ -13,24 +11,20 @@ permissions: concurrency: group: pages - cancel-in-progress: true + cancel-in-progress: false jobs: build: runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Setup Pages - uses: actions/configure-pages@v3 - - name: Build with Jekyll - uses: actions/jekyll-build-pages@v1 + - uses: actions/checkout@v4 + - uses: actions/configure-pages@v3 + - uses: actions/jekyll-build-pages@v1 with: source: ./ destination: ./_site - - name: Upload artifact - uses: actions/upload-pages-artifact@v1 + - uses: actions/upload-pages-artifact@v2 deploy: environment: @@ -40,8 +34,5 @@ jobs: needs: build steps: - - name: Deploy to GitHub Pages + - uses: actions/deploy-pages@v2 id: deployment - uses: actions/deploy-pages@v2 - -... diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..733df76 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,38 @@ +name: Release + +on: + workflow_dispatch: + +concurrency: + group: release + cancel-in-progress: true + +jobs: + build: + uses: ./.github/workflows/ci.yml + + release: + runs-on: ubuntu-latest + needs: build + permissions: + contents: write + issues: write + pull-requests: write + id-token: write + + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version-file: .nvmrc + cache: yarn + - run: yarn install --immutable + - run: yarn build + - run: yarn release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + YARN_NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + + pages: + needs: release + uses: ./.github/workflows/pages.yml diff --git a/.releaserc.json b/.releaserc.json index 950be22..59a12ae 100644 --- a/.releaserc.json +++ b/.releaserc.json @@ -1,6 +1,10 @@ { "$schema": "https://json.schemastore.org/semantic-release", - "branches": [ - "release" + "branches": ["main"], + "plugins": [ + "@semantic-release/commit-analyzer", + "@semantic-release/release-notes-generator", + "semantic-release-yarn", + "@semantic-release/github" ] } diff --git a/package.json b/package.json index bf28f16..425298d 100644 --- a/package.json +++ b/package.json @@ -34,6 +34,7 @@ "release": "semantic-release", "test": "NODE_ENV=test mocha" }, + "packageManager": "yarn@3.6.0", "devDependencies": { "@stackbuilders/assertive-ts": "^1.2.0", "@types/mocha": "^10.0.1", @@ -53,6 +54,7 @@ "msw": "^1.2.2", "rxjs": "^7.8.1", "semantic-release": "^21.0.7", + "semantic-release-yarn": "^3.0.2", "sinon": "^15.2.0", "ts-node": "^10.9.1", "tslib": "^2.6.0", @@ -70,5 +72,8 @@ "optional": false } }, - "packageManager": "yarn@3.6.0" + "publishConfig": { + "access": "public", + "provenance": true + } } diff --git a/yarn.lock b/yarn.lock index 5ff57f9..f83095e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1317,6 +1317,16 @@ __metadata: languageName: node linkType: hard +"aggregate-error@npm:^5.0.0": + version: 5.0.0 + resolution: "aggregate-error@npm:5.0.0" + dependencies: + clean-stack: ^5.2.0 + indent-string: ^5.0.0 + checksum: 37834eb0dac6ebd05ca8aa82e00deeb65fb7b1462c68ccb620221ba1753640fcb249e46c03401b470701a58826b65426deda83783fc2e8347c4b5037b2724d9b + languageName: node + linkType: hard + "ajv@npm:^6.10.0, ajv@npm:^6.12.4": version: 6.12.6 resolution: "ajv@npm:6.12.6" @@ -1907,6 +1917,15 @@ __metadata: languageName: node linkType: hard +"clean-stack@npm:^5.2.0": + version: 5.2.0 + resolution: "clean-stack@npm:5.2.0" + dependencies: + escape-string-regexp: 5.0.0 + checksum: 9b16c9d56ef673b1666030d04afc5a382c7ec6b5fb8df2dd361090c3ac79273695d6db9867938bb3268903dcebf401e2c6034b2f56f27673f6032b5e89217b81 + languageName: node + linkType: hard + "cli-columns@npm:^4.0.0": version: 4.0.0 resolution: "cli-columns@npm:4.0.0" @@ -2186,6 +2205,23 @@ __metadata: languageName: node linkType: hard +"cosmiconfig@npm:^8.1.0": + version: 8.3.6 + resolution: "cosmiconfig@npm:8.3.6" + dependencies: + import-fresh: ^3.3.0 + js-yaml: ^4.1.0 + parse-json: ^5.2.0 + path-type: ^4.0.0 + peerDependencies: + typescript: ">=4.9.5" + peerDependenciesMeta: + typescript: + optional: true + checksum: dc339ebea427898c9e03bf01b56ba7afbac07fc7d2a2d5a15d6e9c14de98275a9565da949375aee1809591c152c0a3877bb86dbeaf74d5bd5aaa79955ad9e7a0 + languageName: node + linkType: hard + "create-require@npm:^1.1.0": version: 1.1.1 resolution: "create-require@npm:1.1.1" @@ -2913,6 +2949,23 @@ __metadata: languageName: node linkType: hard +"execa@npm:^8.0.1": + version: 8.0.1 + resolution: "execa@npm:8.0.1" + dependencies: + cross-spawn: ^7.0.3 + get-stream: ^8.0.1 + human-signals: ^5.0.0 + is-stream: ^3.0.0 + merge-stream: ^2.0.0 + npm-run-path: ^5.1.0 + onetime: ^6.0.0 + signal-exit: ^4.1.0 + strip-final-newline: ^3.0.0 + checksum: cac1bf86589d1d9b73bdc5dda65c52012d1a9619c44c526891956745f7b366ca2603d29fe3f7460bacc2b48c6eab5d6a4f7afe0534b31473d3708d1265545e1f + languageName: node + linkType: hard + "exponential-backoff@npm:^3.1.1": version: 3.1.1 resolution: "exponential-backoff@npm:3.1.1" @@ -3151,7 +3204,7 @@ __metadata: languageName: node linkType: hard -"fs-extra@npm:^11.0.0": +"fs-extra@npm:^11.0.0, fs-extra@npm:^11.1.0": version: 11.1.1 resolution: "fs-extra@npm:11.1.1" dependencies: @@ -3297,6 +3350,13 @@ __metadata: languageName: node linkType: hard +"get-stream@npm:^8.0.1": + version: 8.0.1 + resolution: "get-stream@npm:8.0.1" + checksum: 01e3d3cf29e1393f05f44d2f00445c5f9ec3d1c49e8179b31795484b9c117f4c695e5e07b88b50785d5c8248a788c85d9913a79266fc77e3ef11f78f10f1b974 + languageName: node + linkType: hard + "get-symbol-description@npm:^1.0.0": version: 1.0.0 resolution: "get-symbol-description@npm:1.0.0" @@ -3684,6 +3744,13 @@ __metadata: languageName: node linkType: hard +"human-signals@npm:^5.0.0": + version: 5.0.0 + resolution: "human-signals@npm:5.0.0" + checksum: 6504560d5ed91444f16bea3bd9dfc66110a339442084e56c3e7fa7bbdf3f406426d6563d662bdce67064b165eac31eeabfc0857ed170aaa612cf14ec9f9a464c + languageName: node + linkType: hard + "humanize-ms@npm:^1.2.1": version: 1.2.1 resolution: "humanize-ms@npm:1.2.1" @@ -3734,7 +3801,7 @@ __metadata: languageName: node linkType: hard -"import-fresh@npm:^3.1.0, import-fresh@npm:^3.2.1": +"import-fresh@npm:^3.1.0, import-fresh@npm:^3.2.1, import-fresh@npm:^3.3.0": version: 3.3.0 resolution: "import-fresh@npm:3.3.0" dependencies: @@ -5834,7 +5901,7 @@ __metadata: languageName: node linkType: hard -"parse-json@npm:^5.0.0": +"parse-json@npm:^5.0.0, parse-json@npm:^5.2.0": version: 5.2.0 resolution: "parse-json@npm:5.2.0" dependencies: @@ -6438,6 +6505,7 @@ __metadata: msw: ^1.2.2 rxjs: ^7.8.1 semantic-release: ^21.0.7 + semantic-release-yarn: ^3.0.2 sinon: ^15.2.0 ts-node: ^10.9.1 tslib: ^2.6.0 @@ -6494,6 +6562,26 @@ __metadata: languageName: node linkType: hard +"semantic-release-yarn@npm:^3.0.2": + version: 3.0.2 + resolution: "semantic-release-yarn@npm:3.0.2" + dependencies: + "@semantic-release/error": ^4.0.0 + aggregate-error: ^5.0.0 + cosmiconfig: ^8.1.0 + execa: ^8.0.1 + fs-extra: ^11.1.0 + js-yaml: ^4.1.0 + lodash: ^4.17.21 + nerf-dart: ^1.0.0 + read-pkg: ^8.0.0 + semver: ^7.3.8 + peerDependencies: + semantic-release: ">=19.0.0" + checksum: ac89435f10891dc628e64422332871ede232428788470a0e086c92882b38d90122c0b3af353c28b4af3aeb6f2b4916429386fa0ce00abe4f803facad4c2313dd + languageName: node + linkType: hard + "semantic-release@npm:^21.0.7": version: 21.0.7 resolution: "semantic-release@npm:21.0.7" @@ -6566,7 +6654,7 @@ __metadata: languageName: node linkType: hard -"semver@npm:^7.0.0, semver@npm:^7.1.1, semver@npm:^7.1.2, semver@npm:^7.3.2, semver@npm:^7.3.4, semver@npm:^7.3.5, semver@npm:^7.3.7, semver@npm:^7.5.0, semver@npm:^7.5.1, semver@npm:^7.5.2": +"semver@npm:^7.0.0, semver@npm:^7.1.1, semver@npm:^7.1.2, semver@npm:^7.3.2, semver@npm:^7.3.4, semver@npm:^7.3.5, semver@npm:^7.3.7, semver@npm:^7.3.8, semver@npm:^7.5.0, semver@npm:^7.5.1, semver@npm:^7.5.2": version: 7.5.4 resolution: "semver@npm:7.5.4" dependencies: @@ -6641,6 +6729,13 @@ __metadata: languageName: node linkType: hard +"signal-exit@npm:^4.1.0": + version: 4.1.0 + resolution: "signal-exit@npm:4.1.0" + checksum: 64c757b498cb8629ffa5f75485340594d2f8189e9b08700e69199069c8e3070fb3e255f7ab873c05dc0b3cec412aea7402e10a5990cb6a050bd33ba062a6c549 + languageName: node + linkType: hard + "signale@npm:^1.2.1": version: 1.4.0 resolution: "signale@npm:1.4.0"