From 5f421aaac0fcb26c86e1c121cbd2f2444b75f692 Mon Sep 17 00:00:00 2001 From: Diogo Simoes Date: Fri, 4 Oct 2024 12:10:51 +0100 Subject: [PATCH] chore: migrate CI to gh actions --- .circleci/config.yml | 31 ----------------------------- .github/workflows/release.yaml | 36 ++++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 31 deletions(-) delete mode 100644 .circleci/config.yml create mode 100644 .github/workflows/release.yaml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index c4a6ff9..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,31 +0,0 @@ -version: 2.1 - -jobs: - test: - docker: - - image: cimg/node:lts - steps: - - checkout - - run: npm install - - run: npm test - release: - docker: - - image: cimg/node:lts - steps: - - checkout - - run: npm install - - run: npx semantic-release - -workflows: - version: 2 - build: - jobs: - - test - - release: - context: opensource - filters: - branches: - only: - - master - requires: - - test \ No newline at end of file diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..c58c725 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,36 @@ +name: Release + +on: + push: + branches: + - master + +jobs: + release: + runs-on: ubuntu-latest + needs: test + if: github.ref_name == 'master' + environment: + name: release + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: 'npm' + cache-dependency-path: package-lock.json + + - name: Install dependencies + run: npm ci + + - name: Run tests + run: npm test + + - name: Run semantic release + run: npx semantic-release + env: + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} \ No newline at end of file