File: create-release-pull-request.yaml

package info (click to toggle)
sqlfluff 3.5.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 33,984 kB
  • sloc: python: 106,138; sql: 34,188; makefile: 52; sh: 8
file content (79 lines) | stat: -rw-r--r-- 2,987 bytes parent folder | download
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: Create release pull request

on:
  workflow_dispatch:
    inputs:
      newVersionNumber:
        description: 'New version number'
        required: true

jobs:
  run:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Abort if branch already exists
        run: |
            _check_branch=$(git ls-remote --heads origin prep-${{ github.event.inputs.newVersionNumber }})
            if [[ -z ${_check_branch} ]]; then
                echo "Release branch doesn't exist yet, continuing"
            else
                echo "Release branch already exists, aborting. Run the Python release script locally."
                exit 1
            fi

      - name: Set up Python
        uses: actions/setup-python@v5
        with:
          python-version: '3.11'

      - name: Install dependencies
        run: |
          pip install requests click pyyaml ghapi

      - name: Prepare release
        run: |
          python util.py release ${{ github.event.inputs.newVersionNumber }}
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          GITHUB_REPOSITORY_OWNER: ${{ secrets.GITHUB_REPOSITORY_OWNER }}

      - name: Create pull request
        uses: peter-evans/create-pull-request@v7
        with:
          delete-branch: true
          branch: prep-${{ github.event.inputs.newVersionNumber }}
          commit-message: "Bump to version ${{ github.event.inputs.newVersionNumber }}"
          title: Prep version ${{ github.event.inputs.newVersionNumber }}
          body: |
            Prepare version ${{ github.event.inputs.newVersionNumber }}

            Please add all merged changes from [Release Draft][1] to
            the CHANGELOG.md file, along with a short commentary for users.

            * Summarise the main changes made.
            * Call out any specific changes that users should know about.
            * Celebrate new contributors to the project.

            The summary in this PR should also be added to the drafted GitHub release
            after merging this PR. Merging this PR does not trigger the release to pypi,
            that happens when the GitHub release is published.

            - Auto-generated by [create-pull-request][2] GitHub Action

            [1]: https://github.com/sqlfluff/sqlfluff/releases
            [2]: https://github.com/peter-evans/create-pull-request
          labels: |
            release
            skip-changelog

      - name: Update release title and tag
        uses: release-drafter/release-drafter@v6
        with:
          # NOTE: We should eventually actually populate the date here, but that
          # will most likely change before the new pull request actually gets
          # merged, so we just add "YYYY-MM-DD" for now as a placeholder.
          name: "[${{ github.event.inputs.newVersionNumber }}] - YYYY-MM-DD"
          tag: ${{ github.event.inputs.newVersionNumber }}
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}