-
Notifications
You must be signed in to change notification settings - Fork 5
89 lines (78 loc) · 2.72 KB
/
Copy pathbundle-release.yml
File metadata and controls
89 lines (78 loc) · 2.72 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
name: Bundle Release
on:
workflow_dispatch:
inputs:
bundle_version:
description: "Version to publish the bundle under, e.g. 1.5.10"
required: true
minimum_native_version:
description: "Oldest native binary version that can run this bundle, e.g. 1.5.9"
required: true
platform:
description: "Platforms to publish for"
type: choice
options:
- both
- ios
- android
default: both
concurrency:
group: bundle-release
cancel-in-progress: false
jobs:
release:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version-file: ".nvmrc"
cache: "npm"
cache-dependency-path: packages/web/package-lock.json
- uses: actions/setup-python@v7
with:
python-version: "3.12"
cache: "pip"
cache-dependency-path: service/requirements.txt
- name: Install npm dependencies
run: npm ci
working-directory: packages/web
- name: Build web app
run: npm run build
working-directory: packages/web
env:
VITE_GOOGLE_CLIENT_ID: ${{ secrets.GOOGLE_OAUTH_CLIENT_ID }}
VITE_DIPLICITY_API_BASE_URL: ${{ vars.SERVICE_BASE_URL }}
VITE_MAINTENANCE_MODE: ${{ vars.MAINTENANCE_MODE }}
VITE_GOOGLE_IOS_CLIENT_ID: ${{ secrets.VITE_GOOGLE_IOS_CLIENT_ID }}
- name: Install service dependencies
run: pip install -r requirements.txt
working-directory: service
- name: Install Railway CLI
run: npm install -g @railway/cli
- name: Publish bundle
working-directory: service
run: |
if [ -z "$DATABASE_CONNECTION_STRING" ]; then
echo "DATABASE_PUBLIC_URL is not set; the runner cannot reach the production database." >&2
exit 1
fi
if [ "$PLATFORM" = "both" ]; then
PLATFORMS="ios android"
else
PLATFORMS="$PLATFORM"
fi
railway run --service=diplicity-react-production --no-local -- \
python manage.py release_bundle \
--dist ../packages/web/dist \
--bundle-version "$BUNDLE_VERSION" \
--minimum-native-version "$MINIMUM_NATIVE_VERSION" \
--platform $PLATFORMS
env:
BUNDLE_VERSION: ${{ inputs.bundle_version }}
MINIMUM_NATIVE_VERSION: ${{ inputs.minimum_native_version }}
PLATFORM: ${{ inputs.platform }}
RAILWAY_TOKEN: ${{ secrets.RAILWAY_TOKEN }}
DATABASE_CONNECTION_STRING: ${{ secrets.DATABASE_PUBLIC_URL }}