File tree 2 files changed +89
-0
lines changed 2 files changed +89
-0
lines changed Original file line number Diff line number Diff line change
1
+ # https://docs.github.com/en/actions
2
+
3
+ on :
4
+ push :
5
+ tags :
6
+ - " **"
7
+
8
+ name : Release
9
+
10
+ jobs :
11
+ release :
12
+ name : Release
13
+
14
+ runs-on : ubuntu-latest
15
+
16
+ permissions :
17
+ contents : write
18
+
19
+ steps :
20
+ - name : Checkout
21
+ uses : actions/checkout@v4
22
+
23
+ - name : Install PHP with extensions
24
+ uses : shivammathur/setup-php@v2
25
+ with :
26
+ php-version : 8.3
27
+ coverage : none
28
+ extensions : none
29
+ tools : none
30
+
31
+ - name : Determine tag
32
+ run : echo "RELEASE_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
33
+
34
+ - name : Parse ChangeLog
35
+ run : build/scripts/extract-release-notes.php ${{ env.RELEASE_TAG }} > release-notes.md
36
+
37
+ - name : Create release
38
+ uses : ncipollo/release-action@v1
39
+ with :
40
+ token : ${{ secrets.GITHUB_TOKEN }}
41
+ tag : ${{ env.RELEASE_TAG }}
42
+ name : FOAL ${{ env.RELEASE_TAG }}
43
+ bodyFile : release-notes.md
Original file line number Diff line number Diff line change
1
+ #!/usr/bin/env php
2
+ <?php declare (strict_types=1 );
3
+ if ($ argc !== 2 ) {
4
+ print $ argv [0 ] . ' <tag> ' . PHP_EOL ;
5
+
6
+ exit (1 );
7
+ }
8
+
9
+ $ version = $ argv [1 ];
10
+
11
+ $ file = __DIR__ . '/../../ChangeLog.md ' ;
12
+
13
+ if (!is_file ($ file ) || !is_readable ($ file )) {
14
+ print $ file . ' cannot be read ' . PHP_EOL ;
15
+
16
+ exit (1 );
17
+ }
18
+
19
+ $ buffer = '' ;
20
+ $ append = false ;
21
+
22
+ foreach (file ($ file ) as $ line ) {
23
+ if (str_starts_with ($ line , '## [ ' . $ version . '] ' )) {
24
+ $ append = true ;
25
+
26
+ continue ;
27
+ }
28
+
29
+ if ($ append && (str_starts_with ($ line , '## ' ) || str_starts_with ($ line , '[ ' ))) {
30
+ break ;
31
+ }
32
+
33
+ if ($ append ) {
34
+ $ buffer .= $ line ;
35
+ }
36
+ }
37
+
38
+ $ buffer = trim ($ buffer );
39
+
40
+ if ($ buffer === '' ) {
41
+ print 'Unable to extract release notes ' . PHP_EOL ;
42
+
43
+ exit (1 );
44
+ }
45
+
46
+ print $ buffer . PHP_EOL ;
You can’t perform that action at this time.
0 commit comments