(fix): workflows
This commit is contained in:
parent
29f1ff2d54
commit
14518978d2
2 changed files with 50 additions and 4 deletions
|
|
@ -68,8 +68,31 @@ jobs:
|
||||||
KEYSTORE_BASE64: ${{ secrets.ANDROID_KEYSTORE_BASE64 }}
|
KEYSTORE_BASE64: ${{ secrets.ANDROID_KEYSTORE_BASE64 }}
|
||||||
KEYSTORE_PROPERTIES: ${{ secrets.ANDROID_KEYSTORE_PROPERTIES }}
|
KEYSTORE_PROPERTIES: ${{ secrets.ANDROID_KEYSTORE_PROPERTIES }}
|
||||||
run: |
|
run: |
|
||||||
bun -e "require('fs').writeFileSync('keystore.jks', Buffer.from(process.env.KEYSTORE_BASE64.replace(/\s+/g, ''), 'base64'))"
|
set -eu
|
||||||
bun -e "const content = process.env.KEYSTORE_PROPERTIES.replace(/\\n/g, '\n').replace(/\r/g, '').split('\n').map(l => l.trim()).filter(l => l).join('\n'); require('fs').writeFileSync('keystore.properties', content)"
|
|
||||||
|
if [ -z "$KEYSTORE_BASE64" ]; then
|
||||||
|
echo "ANDROID_KEYSTORE_BASE64 secret is missing or empty"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "$KEYSTORE_PROPERTIES" ]; then
|
||||||
|
echo "ANDROID_KEYSTORE_PROPERTIES secret is missing or empty"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
printf '%s' "$KEYSTORE_BASE64" \
|
||||||
|
| tr -d '[:space:]' \
|
||||||
|
| base64 -d > keystore.jks
|
||||||
|
|
||||||
|
printf '%s' "$KEYSTORE_PROPERTIES" \
|
||||||
|
| sed 's/\\n/\n/g' \
|
||||||
|
| tr -d '\r' \
|
||||||
|
| sed 's|^[[:space:]]*storeFile[[:space:]]*=.*|storeFile=keystore.jks|' \
|
||||||
|
> keystore.properties
|
||||||
|
|
||||||
|
grep -q '^[[:space:]]*storeFile[[:space:]]*=' keystore.properties || printf '\nstoreFile=keystore.jks\n' >> keystore.properties
|
||||||
|
test -s keystore.jks
|
||||||
|
test -s keystore.properties
|
||||||
|
|
||||||
- name: Build mobile
|
- name: Build mobile
|
||||||
run: bun run build:mobile
|
run: bun run build:mobile
|
||||||
|
|
|
||||||
|
|
@ -69,8 +69,31 @@ jobs:
|
||||||
KEYSTORE_BASE64: ${{ secrets.ANDROID_KEYSTORE_BASE64 }}
|
KEYSTORE_BASE64: ${{ secrets.ANDROID_KEYSTORE_BASE64 }}
|
||||||
KEYSTORE_PROPERTIES: ${{ secrets.ANDROID_KEYSTORE_PROPERTIES }}
|
KEYSTORE_PROPERTIES: ${{ secrets.ANDROID_KEYSTORE_PROPERTIES }}
|
||||||
run: |
|
run: |
|
||||||
bun -e "require('fs').writeFileSync('keystore.jks', Buffer.from(process.env.KEYSTORE_BASE64.replace(/\s+/g, ''), 'base64'))"
|
set -eu
|
||||||
bun -e "const content = process.env.KEYSTORE_PROPERTIES.replace(/\\n/g, '\n').replace(/\r/g, '').split('\n').map(l => l.trim()).filter(l => l).join('\n'); require('fs').writeFileSync('keystore.properties', content)"
|
|
||||||
|
if [ -z "$KEYSTORE_BASE64" ]; then
|
||||||
|
echo "ANDROID_KEYSTORE_BASE64 secret is missing or empty"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "$KEYSTORE_PROPERTIES" ]; then
|
||||||
|
echo "ANDROID_KEYSTORE_PROPERTIES secret is missing or empty"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
printf '%s' "$KEYSTORE_BASE64" \
|
||||||
|
| tr -d '[:space:]' \
|
||||||
|
| base64 -d > keystore.jks
|
||||||
|
|
||||||
|
printf '%s' "$KEYSTORE_PROPERTIES" \
|
||||||
|
| sed 's/\\n/\n/g' \
|
||||||
|
| tr -d '\r' \
|
||||||
|
| sed 's|^[[:space:]]*storeFile[[:space:]]*=.*|storeFile=keystore.jks|' \
|
||||||
|
> keystore.properties
|
||||||
|
|
||||||
|
grep -q '^[[:space:]]*storeFile[[:space:]]*=' keystore.properties || printf '\nstoreFile=keystore.jks\n' >> keystore.properties
|
||||||
|
test -s keystore.jks
|
||||||
|
test -s keystore.properties
|
||||||
|
|
||||||
- name: Build mobile
|
- name: Build mobile
|
||||||
run: bun run build:mobile
|
run: bun run build:mobile
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue