diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..af188fb --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,28 @@ +name: Build + +on: + push: + branches: + - "**" # matches every branch + +jobs: + build-and-publish: + 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: "18" # Specify your Node.js version + cache: "pnpm" + - name: Install pnpm + uses: pnpm/action-setup@v4 + with: + version: 9.1.1 + - name: Install dependencies + run: pnpm i + + - name: Build the package + run: pnpm run build diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..989e1b9 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,34 @@ +name: Build and Publish + +on: + push: + tags: + - "v*" + +jobs: + build-and-publish: + runs-on: ubuntu-latest + environment: production + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: "18" # Specify your Node.js version + cache: "pnpm" + - name: Install pnpm + uses: pnpm/action-setup@v4 + with: + version: 9.1.1 + - name: Install dependencies + run: pnpm i + + - name: Build the package + run: pnpm run build + + - name: Publish to npm + run: pnpm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/jsr.json b/jsr.json index 5f8629f..7308c39 100644 --- a/jsr.json +++ b/jsr.json @@ -1,6 +1,6 @@ { "name": "@slalombuild/react-mailto", - "version": "0.2.6", + "version": "0.2.7", "exports": { ".": "./src/index.tsx" }, diff --git a/package.json b/package.json index 4b0f9ef..034b0bd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@slalombuild/react-mailto", - "version": "0.2.6", + "version": "0.2.7", "publishConfig": { "access": "public" },