-
-
Notifications
You must be signed in to change notification settings - Fork 102
112 lines (93 loc) · 3.37 KB
/
Copy pathgenerate-amalgamation.yml
File metadata and controls
112 lines (93 loc) · 3.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
name: Generate amalgamation (Manual)
on:
workflow_dispatch:
env:
CONFIG_FILE: config.json
AMALGAMATION: amalgamation
ARCHIVES: archives
jobs:
generate:
runs-on: ubuntu-latest
env:
MODE: ${{ github.event.inputs.mode }}
steps:
# -------------------------------------------------
# Checkout repository
# -------------------------------------------------
- name: Checkout repository
uses: actions/checkout@v7
with:
fetch-depth: 0
# -------------------------------------------------
# Setup Python
# -------------------------------------------------
- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: "3.12"
# -------------------------------------------------
# Create environment variables
# -------------------------------------------------
- name: Build context
shell: bash
run: |
set -euo pipefail
python scripts/build_context.py
# -------------------------------------------------
# Display environment variables
# -------------------------------------------------
- name: Show environment
shell: bash
run: |
echo "SQLite Version: $SQLITE_VERSION"
echo "SQLite Version Raw: $SQLITE_VERSION_RAW"
echo "SQLite URL Official: $SQLITE_URL_OFFICIAL"
echo "SQLite URL GitHub: $SQLITE_URL_GITHUB"
# -------------------------------------------------
# Create directories for intermediate files
# -------------------------------------------------
- name: Create directories
shell: bash
run: |
set -euo pipefail
mkdir -p "$AMALGAMATION"
mkdir -p "$ARCHIVES"
# -------------------------------------------------
# Generate source amalgamation
# -------------------------------------------------
- name: Generate amalgamation
shell: bash
working-directory: ${{ env.AMALGAMATION }}
run: |
set -euo pipefail
python ../scripts/amalgamate.py -v yes -c ../scripts/sqlite3mc.c.json -s ../src
python ../scripts/amalgamate.py -v yes -c ../scripts/sqlite3mc.h.json -s ../src
python ../scripts/amalgamate.py -v yes -c ../scripts/shell3mc.c.json -s ../src
ls -l
sed -i 's/[[:space:]]*$//' "sqlite3mc_amalgamation.c"
sed -i 's/[[:space:]]*$//' "sqlite3mc_amalgamation.h"
sed -i 's/[[:space:]]*$//' "shell3mc_amalgamation.c"
ls -l
# -------------------------------------------------
# Create ZIP archive(s) for the source amalgamation
# -------------------------------------------------
- name: Create amalgamation ZIP archive
shell: bash
run: |
set -euo pipefail
DESTPATH="$ARCHIVES"
(
SOURCEPATH="$AMALGAMATION"
cd "$SOURCEPATH"
zip -r "../$DESTPATH/amalgamation.zip" .
)
ls -l "$DESTPATH"
# -------------------------------------------------
# Upload ZIP archive
# -------------------------------------------------
- name: Upload amalgamation
uses: actions/upload-artifact@v7
with:
name: amalgamation
path: |
${{ env.ARCHIVES }}/amalgamation.zip