1+ name : Release Drafter
2+
3+ on :
4+ push :
5+ # branches to consider in the event; optional, defaults to all
6+ branches :
7+ - master
8+ # # pull_request event is required only for autolabeler
9+ # pull_request:
10+ # # Only following types are handled by the action, but one can default to all as well
11+ # types: all # [opened, reopened, synchronize]
12+ # # pull_request_target event is required for autolabeler to support PRs from forks
13+ # # pull_request_target:
14+ # # types: [opened, reopened, synchronize]
15+
16+ permissions :
17+ contents : read
18+
19+ jobs :
20+ update_release_draft :
21+ permissions :
22+ # write permission is required to create a github release
23+ contents : write
24+ # write permission is required for autolabeler
25+ # otherwise, read permission is required at least
26+ pull-requests : write
27+ runs-on : ubuntu-latest
28+ steps :
29+ - name : Check out the repository
30+ uses : actions/checkout@v3
31+ with :
32+ fetch-depth : 2
33+
34+ - name : Detect new version
35+ id : check-version
36+ # if: steps.check-parent-commit.outputs.sha
37+ 38+ with :
39+ create-tag : false
40+ version-command : |
41+ grep -Eo '^__version__ = \"(.*)\"$' micro_sam/__version__.py | cut -d\" -f2
42+
43+ - name : Push tag
44+ id : tag-version
45+ if : steps.check-version.outputs.previous-version != steps.check-version.outputs.current-version
46+ uses :
mathieudutour/[email protected] 47+ with :
48+ github_token : ${{ secrets.GITHUB_TOKEN }}
49+ custom_tag : ${{ steps.check-version.outputs.current-version }}
50+
51+ # Drafts your next Release notes as Pull Requests are merged into "master"
52+ - name : Publish the release notes
53+ uses :
release-drafter/[email protected] 54+ with :
55+ config-name : release_config.yaml
56+ publish : " ${{ steps.tag-version.outputs.new_tag != '' }}"
57+ tag : " ${{ steps.tag-version.outputs.new_tag }}"
58+ env :
59+ GITHUB_TOKEN : " ${{ secrets.GITHUB_TOKEN }}"
0 commit comments