Skip to content

Commit 12c05f0

Browse files
committed
Updated github actions
1 parent e5dabf6 commit 12c05f0

File tree

4 files changed

+70
-327
lines changed

4 files changed

+70
-327
lines changed

.github/actions/release-wa-sqlite/action.yml

-110
This file was deleted.

.github/overlay.patch

-133
This file was deleted.

.github/workflows/release-wa-sqlite.yml

+70-18
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,29 @@
22
# It does the following things:
33
# 1. Creates a release notes file (NOTES) that contain the release notes of the rhashimoto/wa-sqlite
44
# 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
109

1110
name: Release wa-sqlite workflow
1211

1312
on:
14-
workflow_call:
1513
workflow_dispatch:
1614
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'
2017
required: true
2118
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'
2421
required: true
2522
type: string
23+
em_version:
24+
description: 'EMSDK version'
25+
default: 'latest'
26+
required: false
27+
type: string
2628

2729
env:
2830
EM_CACHE_FOLDER: 'emsdk-cache'
@@ -32,14 +34,64 @@ jobs:
3234
build:
3335
runs-on: ubuntu-latest
3436
steps:
35-
# Check out wa-sqlite
37+
# Check out wa-sqlite
3638
- uses: actions/checkout@v4
3739
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`
4049
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
4269
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

Comments
 (0)