name: Release on: workflow_dispatch jobs: release: name: Release runs-on: ubuntu-latest strategy: matrix: node-version: [19.x] # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ steps: - name: Checkout uses: actions/checkout@v2 with: persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token fetch-depth: 0 # otherwise, you will failed to push refs to dest repo - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v2 with: node-version: ${{ matrix.node-version }} - name: Cache .pnpm-store uses: actions/cache@v1 with: path: ~/.pnpm-store key: ${{ runner.os }}-node${{ matrix.node-version }}-${{ hashFiles('**/pnpm-lock.yaml') }} - name: Install pnpm run: curl -f https://get.pnpm.io/v6.js | node - add --global pnpm@6 - name: Install dependencies run: pnpm install - name: Pre-release run: pnpm pre-release - name: Release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} run: pnpm semantic-release - name: Add lib, types and docs to Git if: ${{ github.ref == 'refs/heads/main' }} run: | git add --force docs/ git add --force lib/ - name: Commit files if: ${{ github.ref == 'refs/heads/main' }} run: | git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" git config --local user.name "github-actions[bot]" git commit -m "chore(gh-bot): :rocket: release" -a - name: Push changes if: ${{ github.ref == 'refs/heads/main' }} uses: ad-m/github-push-action@master with: github_token: ${{ secrets.GITHUB_TOKEN }} branch: ${{ github.ref }}