File tree Expand file tree Collapse file tree 3 files changed +92
-0
lines changed Expand file tree Collapse file tree 3 files changed +92
-0
lines changed Original file line number Diff line number Diff line change
1
+ # https://help.github.com/en/categories/automating-your-workflow-with-github-actions
2
+
3
+ name : " Create release"
4
+
5
+ on :
6
+ push :
7
+ tags :
8
+ - ' *'
9
+
10
+ concurrency : release
11
+
12
+ jobs :
13
+ create_release :
14
+ name : " Create release"
15
+ runs-on : " ubuntu-latest"
16
+
17
+ steps :
18
+ - name : " Checkout"
19
+ uses : actions/checkout@v3
20
+
21
+ - name : " Generate release notes"
22
+ run : ./tools/extract-release-notes.php > ${{ github.workspace }}-CHANGELOG.txt
23
+
24
+ - name : " Create release"
25
+ uses : softprops/action-gh-release@v1
26
+ with :
27
+ # token: ${{ secrets.BOT_TOKEN }}
28
+ draft : true
29
+ discussion_category_name : " General"
30
+ body_path : ${{ github.workspace }}-CHANGELOG.txt
Original file line number Diff line number Diff line change
1
+ #!/usr/bin/env php
2
+ <?php
3
+
4
+ const NS = 'http://pear.php.net/dtd/package-2.1 ' ;
5
+
6
+ $ doc = new DOMDocument ();
7
+ if (!$ doc ->load (__DIR__ .'/../package.xml ' )) {
8
+ throw new \Exception ('Failed loading package.xml ' );
9
+ }
10
+
11
+ $ notesElem = findOneElement ($ doc , '/ns:package/ns:notes ' );
12
+ echo $ notesElem ->textContent ;
13
+
14
+ function findOneElement (DOMDocument $ doc , string $ path ): DOMElement
15
+ {
16
+ $ xp = new DOMXPath ($ doc , false );
17
+ $ xp ->registerNamespace ('ns ' , NS );
18
+
19
+ $ list = $ xp ->evaluate ($ path );
20
+ if ($ list ->length !== 1 ) {
21
+ throw new \Exception (sprintf (
22
+ 'XPath expression %s expected to find 1 element, but found %d ' ,
23
+ $ path ,
24
+ $ list ->length ,
25
+ ));
26
+ }
27
+
28
+ return $ list ->item (0 );
29
+ }
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ set -e
4
+
5
+ version=" $1 "
6
+ baseBranch=6.x
7
+
8
+ if [[ -z " $version " ]]; then
9
+ printf " Missing version parameter" >&2
10
+ printf " Usage: %s <version>\n" " $0 " >&2
11
+ exit 1
12
+ fi
13
+
14
+ echo " Updating package.xml"
15
+ ./tools/new-package-release.php " $1 "
16
+ pecl package-validate
17
+
18
+ echo " Updating PHP_RDKAFKA_VERSION"
19
+ sed -i ' s/#define PHP_RDKAFKA_VERSION.*/#define PHP_RDKAFKA_VERSION "' " $1 " ' "/' php_rdkafka.h
20
+
21
+ echo " Printing diff"
22
+ git diff
23
+
24
+ read -p " Commit and send pull request for version $version ? [n/N]" -n 1 -r
25
+ echo
26
+ if ! [[ $REPLY =~ ^[Yy]$ ]]; then
27
+ echo " Ok, aborting"
28
+ exit 1
29
+ fi
30
+
31
+ git checkout -b " release/$version " " $baseBranch "
32
+ git commit package.xml php_rdkafka.h -m " $1 "
33
+ gh pr create --fill --label release --base " $baseBranch "
You can’t perform that action at this time.
0 commit comments