diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 0b59cce..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,44 +0,0 @@ -version: 2.1 -executors: - node18: - docker: - - image: cimg/node:18.19 - -orbs: - codecov: codecov/codecov@3.3.0 - -commands: - setup: - steps: - - checkout - - run: - name: Installing Dependencies - command: npm ci - - run: - name: prepare test git user - command: git config --global user.email "circleci@example.com" && git config --global user.name "CircleCi Build" - -jobs: - build: - executor: node18 - - steps: - - setup - - run: mkdir junit - - run: - name: Lint - command: npm run lint - - run: - name: Getting Code Coverage - command: npm run test - - codecov/upload - - store_test_results: - path: junit - - store_artifacts: - path: junit - -workflows: - version: 2 - build: - jobs: - - build diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml new file mode 100644 index 0000000..3fb8c5e --- /dev/null +++ b/.github/workflows/main.yaml @@ -0,0 +1,44 @@ +name: Build +on: [push] + +env: + CI_BUILD_NUM: ${{ github.run_id }} + CI_BRANCH: ${{ github.ref_name }} + +jobs: + test: + name: Test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Use Node.js 20.x + uses: actions/setup-node@v4 + with: + node-version: '20.x' + - run: npm ci + - run: npm test + - uses: codecov/codecov-action@v3 + with: + token: ${{ secrets.CODECOV_TOKEN }} + - name: Semantic Release (Dry Run) + run: npm run semantic-release-dry + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.ADOBE_BOT_NPM_TOKEN }} + + release: + name: Release + runs-on: ubuntu-latest + needs: test + if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/1.x' + steps: + - uses: actions/checkout@v4 + - name: Use Node.js 20.x + uses: actions/setup-node@v4 + with: + node-version: '20.x' + - run: npm ci + - run: npm run semantic-release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.ADOBE_BOT_NPM_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/semantic-release.yaml b/.github/workflows/semantic-release.yaml deleted file mode 100644 index ee70f60..0000000 --- a/.github/workflows/semantic-release.yaml +++ /dev/null @@ -1,23 +0,0 @@ -name: Semantic Release -on: - push: - branches: - - 'main' - - '1.x' - -jobs: - build: - runs-on: ubuntu-latest - if: "!contains(github.event.head_commit.message, '[skip ci]')" - steps: - - uses: actions/checkout@v4 - - name: Use Node.js 18.x - uses: actions/setup-node@v4 - with: - node-version: '18.x' - - run: npm install - - run: npm test - - run: npm run semantic-release - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - NPM_TOKEN: ${{ secrets.ADOBE_BOT_NPM_TOKEN }} diff --git a/package.json b/package.json index 3690615..357bf42 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,7 @@ "lint": "eslint .", "docs": "npx jsdoc2md -c .jsdoc.json --files 'src/*.js' > docs/API.md", "semantic-release": "semantic-release", + "semantic-release-dry": "semantic-release --dry-run --branches $CI_BRANCH", "prepare": "husky install" }, "repository": {