Skip to content

Commit e4790fd

Browse files
committed
fix: tmpfs cleanup, add github workflow
Signed-off-by: WindSpiritSR <simon343riley@gmail.com>
1 parent 569b10f commit e4790fd

2 files changed

Lines changed: 60 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
17+
- name: Get tag
18+
id: tag
19+
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> "$GITHUB_OUTPUT"
20+
21+
- name: Update update.json
22+
env:
23+
VERSION: ${{ steps.tag.outputs.VERSION }}
24+
REPO: ${{ github.repository }}
25+
run: |
26+
NEW_CODE=$(( $(jq -r '.versionCode' update.json) + 1 ))
27+
jq --arg v "$VERSION" \
28+
--argjson c "$NEW_CODE" \
29+
--arg z "https://github.com/${REPO}/releases/download/${VERSION}/CustomCACert-${VERSION}.zip" \
30+
--arg cl "https://github.com/${REPO}/releases/tag/${VERSION}" \
31+
'.version=$v | .versionCode=$c | .zipUrl=$z | .changelog=$cl' \
32+
update.json > tmp.json && mv tmp.json update.json
33+
34+
- name: Commit update.json
35+
run: |
36+
git config user.name "github-actions[bot]"
37+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
38+
git add update.json
39+
git diff --cached --quiet || git commit -m "Update update.json for ${{ steps.tag.outputs.VERSION }}"
40+
git push origin HEAD:main
41+
42+
- name: Build zip
43+
run: |
44+
zip -r "CustomCACert-${{ steps.tag.outputs.VERSION }}.zip" \
45+
META-INF \
46+
module.prop \
47+
post-fs-data.sh \
48+
system \
49+
LICENSE \
50+
update.json
51+
52+
- name: Create release
53+
uses: softprops/action-gh-release@v2
54+
with:
55+
files: CustomCACert-${{ steps.tag.outputs.VERSION }}.zip
56+
generate_release_notes: true

post-fs-data.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ if [ -d /apex/com.android.conscrypt/cacerts ]; then
4848
else
4949
echo "Cancelling replacing CA storage due to safety"
5050
fi
51+
for pid in 1 $(pgrep zygote) $(pgrep zygote64); do
52+
nsenter --mount=/proc/${pid}/ns/mnt -- \
53+
umount /data/local/tmp/sys-ca-copy
54+
done
5155
umount /data/local/tmp/sys-ca-copy
5256
rmdir /data/local/tmp/sys-ca-copy
5357
fi

0 commit comments

Comments
 (0)