|
| 1 | +name: Prepare Release |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + inputs: |
| 6 | + version: |
| 7 | + description: 'Version to bump to (e.g. patch, minor, major, or specific version)' |
| 8 | + required: true |
| 9 | + default: 'patch' |
| 10 | + |
| 11 | +jobs: |
| 12 | + prepare-release: |
| 13 | + runs-on: ubuntu-latest |
| 14 | + steps: |
| 15 | + - uses: actions/checkout@v4 |
| 16 | + with: |
| 17 | + fetch-depth: 0 |
| 18 | + |
| 19 | + - name: Setup Node.js |
| 20 | + uses: actions/setup-node@v4 |
| 21 | + with: |
| 22 | + node-version: 20 |
| 23 | + |
| 24 | + - name: Install dependencies |
| 25 | + run: npm ci |
| 26 | + |
| 27 | + - name: Update version |
| 28 | + run: | |
| 29 | + npm version ${{ github.event.inputs.version }} --no-git-tag-version |
| 30 | + NEW_VERSION=$(node -p "require('./package.json').version") |
| 31 | + echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV |
| 32 | + |
| 33 | + - name: Generate changelog |
| 34 | + id: changelog |
| 35 | + run: | |
| 36 | + npx conventional-changelog-cli -p angular -i CHANGELOG.md -s |
| 37 | + |
| 38 | + - name: Create Pull Request |
| 39 | + uses: peter-evans/create-pull-request@v7 |
| 40 | + with: |
| 41 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 42 | + commit-message: "chore(release): v${{ env.NEW_VERSION }}" |
| 43 | + title: "chore(release): prepare release v${{ env.NEW_VERSION }}" |
| 44 | + body: | |
| 45 | + Prepare release v${{ env.NEW_VERSION }} |
| 46 | + |
| 47 | + - Update version in package.json |
| 48 | + - Update CHANGELOG.md |
| 49 | + base: main |
| 50 | + branch: release/v${{ env.NEW_VERSION }} |
0 commit comments