aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/draft_new_release.yml
blob: 0e91926b1eecefd06367ee16700f8ff76c2bdef5 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
name: "Draft new release"

on:
  milestone:
    types: [closed]

jobs:
  draft-new-release:
    name: "Draft a new release"
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
        with:
          ref: 'release'
      - name: Extract version from milestone
        run: |
          VERSION="${{ github.event.milestone.title }}"
          echo "::set-env name=RELEASE_VERSION::$VERSION"

      - name: Create release branch
        run: git checkout -b release-${{ env.RELEASE_VERSION }}

      - name: Update changelog
        uses: thomaseizinger/keep-a-changelog-new-release@1.1.0
        with:
          version: ${{ env.RELEASE_VERSION }}

      - name: Initialize git config
        run: |
          git config user.name "GitHub Actions"
          git config user.email noreply@github.com

      - name: Commit changelog
        run: |
          git add CHANGELOG.md
          git commit --message "Prepare release ${{ env.RELEASE_VERSION }}"

      - name: Push new branch
        run: git push origin release-${{ env.RELEASE_VERSION }}

      - name: Create pull request
        uses: thomaseizinger/create-pull-request@1.0.0
        with:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          head: release-${{ env.RELEASE_VERSION }}
          base: release
          title: Release ${{ env.RELEASE_VERSION }}