diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 90dca55..feff899 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,7 @@ jobs: - name: Checkout code uses: actions/checkout@v4 with: - fetch-depth: 0 # Fetch full history for semantic-release + fetch-depth: 1 - name: Install pnpm uses: pnpm/action-setup@v4 @@ -58,52 +58,3 @@ jobs: exit 1 fi echo "Build successful: lib directory created with $(find lib -name '*.js' | wc -l) JavaScript files" - - release: - runs-on: ubuntu-latest - needs: build - if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' - - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - fetch-depth: 0 - persist-credentials: false - - - name: Install pnpm - uses: pnpm/action-setup@v4 - with: - version: latest - run_install: false - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: 20 - cache: "pnpm" - - - name: Get pnpm store directory - shell: bash - run: | - echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV - - - name: Setup pnpm cache - uses: actions/cache@v4 - with: - path: ${{ env.STORE_PATH }} - key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} - restore-keys: | - ${{ runner.os }}-pnpm-store- - - - name: Install dependencies - run: pnpm install --frozen-lockfile - - - name: Build TypeScript - run: pnpm run compile - - - name: Release - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - run: pnpm run semantic-release diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..4a39d75 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,57 @@ +name: Release + +on: + push: + branches: [master, main] + +permissions: + contents: write + issues: write + pull-requests: write + id-token: write + +jobs: + release: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Install pnpm + uses: pnpm/action-setup@v4 + with: + version: latest + run_install: false + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: "pnpm" + + - name: Get pnpm store directory + shell: bash + run: | + echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV + + - name: Setup pnpm cache + uses: actions/cache@v4 + with: + path: ${{ env.STORE_PATH }} + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm-store- + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Build TypeScript + run: pnpm run compile + + - name: Release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: pnpm run semantic-release diff --git a/package.json b/package.json index fab14e1..704f1c5 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,8 @@ }, "publishConfig": { "registry": "https://registry.npmjs.org/", - "tag": "next" + "tag": "next", + "provenance": true }, "repository": { "type": "git",