-
Notifications
You must be signed in to change notification settings - Fork 44
28 lines (24 loc) · 1.24 KB
/
create_release.yml
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
name: Create CLI Release
on:
pull_request:
branches:
- main
types: [closed]
jobs:
create-release:
if: ${{ github.event.pull_request.merged == true && startsWith(github.head_ref, 'release/') && github.repository_owner == 'codecov' }}
name: Create Github Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- id: get-release-vars
name: Configure Release Vars
run: |
echo release_version=v$(grep -E "version=\"[0-9]+\.[0-9]+\.[0-9]+\"" setup.py | grep -Eo "[0-9]+\.[0-9]+\.[0-9]+") >> "$GITHUB_OUTPUT"
echo previous_version=$(git tag --sort=-creatordate | head -n 2 | tail -n 1) >> "$GITHUB_OUTPUT
- name: Create GitHub Release
env:
GITHUB_TOKEN: ${{ secrets.CODECOV_RELEASE_PAT }}
run: |
gh release create ${{ steps.get-release-vars.outputs.release_version }} --title "Release ${{ steps.get-release-vars.outputs.release_version }}" --notes "Autogenerated for ${{ steps.get-release-vars.outputs.release_version }}. Created for ${{ github.event.pull_request.html_url }}" --generate-notes --notes-start-tag ${{steps.get-release-vars.outputs.previous_version}} --target ${{ github.event.pull_request.head.sha }}