diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..1bd04e5 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,33 @@ +name: 🎉 Release + +on: + push: + branches: + - main + +concurrency: ${{ github.workflow }}-${{ github.ref }} + +jobs: + release: + if: github.repository == 'loreddev/marknow' + permissions: + contents: write + pull-requests: write + name: Release + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Setup environment + uses: ./.github/actions/pnpm-setup + - name: Create Release PR or Public to NPM + id: changesets + uses: changesets/action@v1 + with: + publish: pnpm release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/package.json b/package.json index 52958a7..0ada154 100644 --- a/package.json +++ b/package.json @@ -14,8 +14,10 @@ "lint": "eslint . && turbo run lint", "lint:fix": "eslint . --fix && turbo run lint -- --fix", "build": "turbo run build --filter=\"@marknow/www\"", + "build:pkg": "turbo run build --filter='./packages/*'", "dev": "turbo run dev --filter=\"@marknow/www\"", - "preview": "turbo run preview --filter=\"@marknow/www\"" + "preview": "turbo run preview --filter=\"@marknow/www\"", + "release": "pnpm run build:pkg && changesets publish" }, "devDependencies": { "@antfu/eslint-config": "^0.39.5",