From c9c803d698cb28ae16e58ff20ced87ecc6755ce0 Mon Sep 17 00:00:00 2001 From: lovrozagar Date: Mon, 4 Mar 2024 12:51:21 -0800 Subject: [PATCH] config: github actions --- .changeset/config.json | 11 +++++++++++ .github/workflows/main.yml | 17 +++++++++++++++++ .github/workflows/publish.yml | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 61 insertions(+) create mode 100644 .changeset/config.json create mode 100644 .github/workflows/main.yml create mode 100644 .github/workflows/publish.yml diff --git a/.changeset/config.json b/.changeset/config.json new file mode 100644 index 0000000..91b6a95 --- /dev/null +++ b/.changeset/config.json @@ -0,0 +1,11 @@ +{ + "$schema": "https://unpkg.com/@changesets/config@3.0.0/schema.json", + "changelog": "@changesets/cli/changelog", + "commit": false, + "fixed": [], + "linked": [], + "access": "restricted", + "baseBranch": "main", + "updateInternalDependencies": "patch", + "ignore": [] +} diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..a2d35d7 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,17 @@ +name: CI +on: + push: + branches: + - '**' + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: 20.9.0 + cache: 'yarn' + - run: yarn install --immutable diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..29df608 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,33 @@ +name: Publish +on: + workflow_run: + workflows: [CI] + branches: [main] + types: [completed] + +concurrency: ${{ github.workflow }}-${{ github.ref }} + +permissions: + contents: write + pull-requests: write + +jobs: + publish: + if: ${{ github.event.workflow_run.conclusion == 'success' }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: 20.9.0 + cache: 'yarn' + - run: yarn install --immutable + - name: Create Release Pull Request or Publish + id: changesets + uses: changesets/action@v1 + with: + publish: yarn run release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }}