-
-
Notifications
You must be signed in to change notification settings - Fork 10
71 lines (65 loc) · 2.16 KB
/
create_release_page.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
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
name: Create Release Page
on:
workflow_call:
inputs:
draft:
required: true
type: boolean
outputs:
upload_url:
description: "Release page URL"
value: ${{ jobs.release.outputs.upload_url }}
version:
description: "Latest tag name"
value: ${{ jobs.release.outputs.version }}
build_number:
description: "Count of made commits"
value: ${{ jobs.release.outputs.build_number }}
jobs:
release:
name: Create Release Page
runs-on: ubuntu-latest
outputs:
version: ${{ steps.tag.outputs.name }}
upload_url: ${{ steps.create_release.outputs.upload_url }}
build_number: ${{ steps.build_number.outputs.build_number }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
cache: 'gradle'
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
cache: true
- run: flutter pub get
- name: Get Tag Name
id: tag
run: echo "name=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
- name: Set Build Number
id: build_number
run: echo "build_number=$(git rev-list --count HEAD)" >> $GITHUB_OUTPUT
- name: Prepare Release Notes
run: |
dart run grinder release-notes --tag=v${{ steps.tag.outputs.name }} --output=release_notes.log
echo "RELEASE_NOTES<<EOF" >> $GITHUB_ENV
while IFS= read -r line; do
echo "$line" >> $GITHUB_ENV
done < "release_notes.log"
echo "EOF" >> $GITHUB_ENV
rm release_notes.log
- name: Create Release Page
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ steps.tag.outputs.name }}
release_name: Release ${{ steps.tag.outputs.name }}
body: ${{ env.RELEASE_NOTES }}
draft: ${{ inputs.draft }}
prerelease: false