-
Notifications
You must be signed in to change notification settings - Fork 4
105 lines (87 loc) · 2.96 KB
/
Copy pathci.yml
File metadata and controls
105 lines (87 loc) · 2.96 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
name: CI
# - Tests: corren en cada push y PR.
# - APK release (sin mocks, listo para modo Directo con el chip): se arma en
# push a main, en tags `v*` y manualmente (workflow_dispatch). El APK queda
# como artifact descargable; en tags además se adjunta a un GitHub Release.
on:
push:
branches: [main]
tags: ["v*"]
pull_request:
workflow_dispatch:
# Cancela corridas viejas de la misma rama/PR.
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
name: Lint de tipos + tests
runs-on: ubuntu-latest
env:
# El runner usa UTC; el negocio opera en UTC-3 y hay lógica de fechas
# (cultivos vigentes) sensible a la TZ. jest.config.js ya la fija, esto
# lo deja explícito a nivel proceso.
TZ: America/Montevideo
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 24
cache: npm
- name: Instalar dependencias
run: npm ci
- name: Chequeo de tipos (tsc)
run: npx tsc --noEmit
- name: Tests (jest)
run: npm test
build-android:
name: APK release (modo Directo, sin mocks)
runs-on: ubuntu-latest
needs: test
env:
# Release sin mocks: la app habla con el hub real.
# (Mismos valores que .env.production; se setean acá para garantizar
# que el bundling de Metro los reciba en build time.)
EXPO_PUBLIC_HUB_DATA_BACKEND: http
EXPO_PUBLIC_NOTIFY_BACKEND: http
EXPO_PUBLIC_NOTIFY_BASE_URL: https://ntfy.sh
EXPO_PUBLIC_INFLUX_BASE_URL: http://grafana.altermundi.net:8086
EXPO_PUBLIC_INFLUX_DB: cto
EXPO_PUBLIC_RECOMMENDATIONS_BACKEND: influx
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 24
cache: npm
- name: Setup JDK 17
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: "17"
- name: Setup Gradle (cache)
uses: gradle/actions/setup-gradle@v4
- name: Instalar dependencias
run: npm ci
- name: Generar proyecto Android (expo prebuild)
run: npx expo prebuild --platform android --no-install
- name: Build APK release
run: ./gradlew assembleRelease --no-daemon
working-directory: android
- name: Renombrar APK
run: |
mkdir -p artifacts
cp android/app/build/outputs/apk/release/app-release.apk \
artifacts/libreagro-directo.apk
- name: Subir APK como artifact
uses: actions/upload-artifact@v4
with:
name: libreagro-directo-apk
path: artifacts/libreagro-directo.apk
if-no-files-found: error
- name: Publicar Release con el APK (solo en tags v*)
if: startsWith(github.ref, 'refs/tags/v')
uses: softprops/action-gh-release@v2
with:
files: artifacts/libreagro-directo.apk
generate_release_notes: true