9
9
branches : [ "stable" ]
10
10
11
11
permissions :
12
- contents : write
12
+ contents : read
13
13
14
14
jobs :
15
15
@@ -29,80 +29,19 @@ jobs:
29
29
git merge stable
30
30
git push origin master
31
31
32
- build :
33
- runs-on : ubuntu-latest
34
- name : Build standalone executable
35
-
36
- steps :
37
- - uses : actions/checkout@v3
38
-
39
- - name : Cache Composer packages
40
- id : composer-cache
41
- uses : actions/cache@v3
42
- with :
43
- path : vendor
44
- key : ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
45
- restore-keys : |
46
- ${{ runner.os }}-php-
47
-
48
- - name : Install dependencies
49
- run : composer install --no-interaction --no-progress --no-suggest --prefer-dist
50
-
51
- - name : Get build version
52
- id : build-version
53
- run : |
54
- echo "version=$(php ./bin/get-release-version.php)" >> $GITHUB_OUTPUT
55
- echo "Version: v$(php ./bin/get-release-version.php)"
56
- php ./bin/get-release-version.php > version
57
-
58
- - name : Build executable
59
- run : php hyde standalone:build --build-version-suffix="${{ steps.build-version.outputs.sha_short }}"
60
-
61
- - name : Verify executable
62
- run : php builds/hyde
63
-
64
- - name : Verify executable version
65
- run : php builds/hyde --version
66
-
67
- - name : Calculate checksum
68
- run : |
69
- cd builds
70
- sha256sum hyde > checksum.txt
71
- echo "SHA256 checksum of the application binary: $(cat checksum.txt)"
72
-
73
- - name : Commit executable
74
- uses : EndBug/add-and-commit@v9
75
- with :
76
- add : builds/hyde
77
- message : " Build standalone executable"
78
-
79
- - name : Upload executable
80
- uses : actions/upload-artifact@v3
81
- with :
82
- name : hyde
83
- path : builds/hyde
84
-
85
- - name : Upload the checksum artifact
86
- uses : actions/upload-artifact@v3
87
- with :
88
- name : checksum
89
- path : builds/checksum.txt
90
-
91
- - name : Upload the version number artifact
92
- uses : actions/upload-artifact@v3
93
- with :
94
- name : version
95
- path : version
96
-
97
32
release :
98
- needs : build
99
33
runs-on : ubuntu-latest
100
34
name : Publish release
101
35
102
36
permissions :
103
37
contents : write
104
38
105
39
steps :
40
+ - uses : actions/checkout@v3
41
+ with :
42
+ ssh-key : ${{ secrets.SSH_PRIVATE_KEY }}
43
+ ref : stable
44
+
106
45
- name : Download the application artifact
107
46
uses : actions/download-artifact@v3
108
47
with :
@@ -122,13 +61,11 @@ jobs:
122
61
123
62
- name : Prepare version information
124
63
run : |
125
- echo "CHECKSUM=$(cat builds/checksum.txt | cut -d ' ' -f 1)" >> $GITHUB_ENV
126
- echo "VERSION=$(cat version)" >> $GITHUB_ENV
64
+ echo "VERSION=$(php ./bin/get-release-version.php)" >> $GITHUB_ENV
127
65
128
66
- name : Print version information
129
67
run : |
130
68
echo "Version: v${{ env.VERSION }}"
131
- echo "Checksum: ${{ env.CHECKSUM }}"
132
69
133
70
- name : Create a release
134
71
uses : ncipollo/release-action@v1
138
75
commit : ${{ github.sha }}
139
76
updateOnlyUnreleased : true
140
77
generateReleaseNotes : true
141
- artifacts : builds/hyde, builds/checksum.txt
78
+ artifacts : builds/hyde
0 commit comments