From efb09777a2f1c257b2c0ceba00e0e071824fccaf Mon Sep 17 00:00:00 2001 From: igor Date: Tue, 14 Oct 2025 12:02:22 +0300 Subject: [PATCH 1/2] feature: add ci.yml config file for github actions --- .github/workflows/ci.yml | 57 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..30a4cec --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,57 @@ +name: ci + +on: + pull_request: + branches: [ main ] + types: [ opened, synchronize ] + +permissions: + contents: write + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: 'yarn' + - name: Install dependencies + run: yarn --frozen-lockfile + - name: Run lint + run: yarn lint + + test: + needs: [ lint ] + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: 'yarn' + - name: Install dependencies + run: yarn --frozen-lockfile + - name: Run tests + run: yarn test + + build: + needs: [ test ] + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: 'yarn' + - name: Install dependencies + run: yarn --frozen-lockfile + - name: Run build + run: yarn build From 67d4cd6636f10013de16be0472a59e4d32d9489b Mon Sep 17 00:00:00 2001 From: igor Date: Wed, 15 Oct 2025 18:48:07 +0300 Subject: [PATCH 2/2] fix: add cd.yml file --- .github/workflows/cd.yml | 37 +++++++++++++++++++++++++++++++++++++ .github/workflows/ci.yml | 6 ++++++ 2 files changed, 43 insertions(+) create mode 100644 .github/workflows/cd.yml diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml new file mode 100644 index 0000000..e11d0e4 --- /dev/null +++ b/.github/workflows/cd.yml @@ -0,0 +1,37 @@ +name: cd + +on: + push: + branches: [ main ] + +permissions: + contents: read + id-token: write + +jobs: + publish: + runs-on: ubuntu-latest + needs: ci + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Download build artifacts + uses: actions/download-artifact@v4 + with: + name: build-artifacts + path: dist + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + registry-url: 'https://registry.npmjs.org' + + - name: Install dependencies + run: yarn --frozen-lockfile + + - name: Publish to npm + run: npm publish --access public + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 30a4cec..7e4af10 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -55,3 +55,9 @@ jobs: run: yarn --frozen-lockfile - name: Run build run: yarn build + - name: Upload build artifacts + uses: actions/upload-artifact@v4 + with: + name: build-artifacts + path: dist/ + retention-days: 1