File tree Expand file tree Collapse file tree 2 files changed +52
-1
lines changed Expand file tree Collapse file tree 2 files changed +52
-1
lines changed Original file line number Diff line number Diff line change @@ -152,7 +152,13 @@ jobs:
152
152
exit 0
153
153
fi &&
154
154
155
- updpkgsums &&
155
+ update_script="$GITHUB_WORKSPACE/update-scripts/$PACKAGE_TO_UPGRADE"
156
+ if test -f "$update_script"
157
+ then
158
+ $update_script "$UPGRADE_TO_VERSION"
159
+ else
160
+ updpkgsums
161
+ fi &&
156
162
msg="$PACKAGE_TO_UPGRADE: update to $UPGRADE_TO_VERSION" &&
157
163
git commit -sm "$msg" PKGBUILD &&
158
164
echo "msg=$msg" >>$GITHUB_OUTPUT &&
Original file line number Diff line number Diff line change
1
+ #!/usr/bin/env node
2
+
3
+ // The `PKGBUILD` file of `mingw-w64-git-lfs` is a bit complicated, as it has
4
+ // separate `case` arms for the different architectures.
5
+
6
+ // Therefore we need to be a bit more careful when updating than just running
7
+ // `updpkgsums`.
8
+
9
+ ( async ( ) => {
10
+ const version = process . argv [ 2 ]
11
+
12
+ const githubApiRequest = require ( '../github-api-request' )
13
+ const { body : releaseNotes } = await githubApiRequest (
14
+ console ,
15
+ null ,
16
+ 'GET' ,
17
+ `/repos/git-lfs/git-lfs/releases/tags/v${ version } `
18
+ )
19
+
20
+ const sha256sums = { }
21
+ let architecture
22
+ let match
23
+ for ( const line of releaseNotes . split ( / \r ? \n / ) ) {
24
+ if ( line . match ( / ^ [ 0 - 9 a - f ] { 64 } $ / ) ) sha256sums [ architecture ] = line
25
+ else if ( ( match = line . match ( / g i t - l f s - w i n d o w s - ( \S + ) - v \S + \. z i p / ) ) ) architecture = match [ 1 ]
26
+ else architecture = undefined
27
+ }
28
+
29
+ const msys2lfsArchitecture = {
30
+ 'i686' : '386' ,
31
+ 'x86_64' : 'amd64' ,
32
+ 'aarch64' : 'arm64' ,
33
+ }
34
+
35
+ const fs = require ( 'fs' )
36
+ const lines = fs . readFileSync ( 'PKGBUILD' ) . toString ( 'utf-8' ) . split ( / \r ? \n / )
37
+ lines . forEach ( ( line , i ) => {
38
+ if ( ( match = line . match ( / ^ ( \S + ) \) $ / ) ) ) {
39
+ architecture = msys2lfsArchitecture [ match [ 1 ] ]
40
+ } else if ( ( match = line . match ( / ^ ( \s * s h a 2 5 6 s u m = ) [ 0 - 9 a - f ] { 64 } $ / ) ) ) {
41
+ lines [ i ] = `${ match [ 1 ] } ${ sha256sums [ architecture ] } `
42
+ }
43
+ } )
44
+ fs . writeFileSync ( 'PKGBUILD' , lines . join ( '\n' ) )
45
+ } ) ( ) . catch ( console . log )
You can’t perform that action at this time.
0 commit comments