2
2
# It does the following things:
3
3
# 1. Creates a release notes file (NOTES) that contain the release notes of the rhashimoto/wa-sqlite
4
4
# repository of the passed version and finds the corresponding tag name
5
- # 2. Checks out the current repository using the same revision as the tag name of that released version
6
- # 3. Creates a branch with the name `release/[tag name]`
7
- # 4. Builds wa-sqlite with environments web, worker and node (this is the reason we do this)
8
- # 5. Commits the build output in the dist folder in that branch
9
- # 6. Creates a release on this repository using this last commit
5
+ # 2. Creates a branch with the name `release/[tag name]`
6
+ # 3. Builds wa-sqlite with environments web, worker and node (this is the reason we do this)
7
+ # 4. Commits the build output in the dist folder in that branch
8
+ # 5. Creates a release on this repository using this last commit
10
9
11
10
name : Release wa-sqlite workflow
12
11
13
12
on :
14
- workflow_call :
15
13
workflow_dispatch :
16
14
inputs :
17
- em_version :
18
- description : ' EMSDK version'
19
- default : ' 3.1.47'
15
+ mendix_wa_sqlite_version :
16
+ description : ' The version of @mendix/wa-sqlite to release'
20
17
required : true
21
18
type : string
22
- wa_sqlite_version :
23
- description : ' The version of wa-sqlite to release'
19
+ original_wa_sqlite_version :
20
+ description : ' The version of the original wa-sqlite on which this release is based on '
24
21
required : true
25
22
type : string
23
+ em_version :
24
+ description : ' EMSDK version'
25
+ default : ' latest'
26
+ required : false
27
+ type : string
26
28
27
29
env :
28
30
EM_CACHE_FOLDER : ' emsdk-cache'
@@ -32,14 +34,64 @@ jobs:
32
34
build :
33
35
runs-on : ubuntu-latest
34
36
steps :
35
- # Check out wa-sqlite
37
+ # Check out wa-sqlite
36
38
- uses : actions/checkout@v4
37
39
with :
38
- path : build
39
- sparse-checkout : .github
40
+ path : wa-sqlite
41
+
42
+ - name : Find latest wa-sqlite release
43
+ shell : bash
44
+ id : prepare
45
+ run : |
46
+ gh release view -R rhashimoto/wa-sqlite --json tagName,body ${{inputs.original_wa_sqlite_version}} > latest.json
47
+
48
+ export TAGNAME=`jq -r .tagName latest.json`
40
49
41
- - uses : ./build/.github/actions/release-wa-sqlite
50
+ export SQLITE_VERSION=`grep "^SQLITE_VERSION = .*" wa-sqlite/Makefile | cut -d = -f 2 | xargs`
51
+
52
+ echo "Node enabled async wa-sqlite build" >> NOTES
53
+ echo "## Dependency information" >> NOTES
54
+ echo "* SQLite version: $SQLITE_VERSION" >> NOTES
55
+ echo "* rhashimoto/wa-sqlite: $TAGNAME" >> NOTES
56
+ jq -r .body latest.json >> NOTES
57
+
58
+ cd wa-sqlite
59
+ git checkout -B release/${{inputs.mendix_wa_sqlite_version}}
60
+
61
+ # Install EMSDK
62
+ - name : Setup Emscripten
63
+ id : cache-system-libraries
64
+ uses : actions/cache@v3
65
+ with :
66
+ path : ${{env.EM_CACHE_FOLDER}}
67
+ key : ${{inputs.em_version}}-${{runner.os}}
68
+ - uses : mymindstorm/setup-emsdk@v14
42
69
with :
43
- em_version : ${{inputs.em_version}}
44
- wa_sqlite_version : ${{inputs.wa_sqlite_version}}
45
- script_dir : $GITHUB_WORKSPACE/build
70
+ version : ${{inputs.em_version}}
71
+ actions-cache-folder : ${{env.EM_CACHE_FOLDER}}
72
+ - run : emcc -v
73
+ shell : bash
74
+
75
+ # Build
76
+ - name : Build wa-sqlite
77
+ working-directory : ./wa-sqlite
78
+ shell : bash
79
+ run : |
80
+ make dist/wa-sqlite-async.mjs clean-deps clean-tmp clean-cache "EMFLAGS_EXTRA=-s ENVIRONMENT=web,worker,node"
81
+
82
+ # Commit dist
83
+ - name : Commit dist
84
+ working-directory : ./wa-sqlite
85
+ shell : bash
86
+ run : |
87
+ git config --global user.name "Release Action"
88
+ git config --global user.email "[email protected] "
89
+ git add *
90
+ git commit -m "Updated build output"
91
+ git push -f -u origin "release/${{inputs.mendix_wa_sqlite_version}}"
92
+
93
+ # Package
94
+ - name : Create release
95
+ working-directory : ./wa-sqlite
96
+ shell : bash
97
+ run : gh release create -R $GITHUB_REPOSITORY "${{inputs.mendix_wa_sqlite_version}}" -t "${{inputs.mendix_wa_sqlite_version}}" --target "release/${{inputs.mendix_wa_sqlite_version}}" --notes-file ../NOTES
0 commit comments