-
Notifications
You must be signed in to change notification settings - Fork 0
112 lines (95 loc) · 3.14 KB
/
release.yml
File metadata and controls
112 lines (95 loc) · 3.14 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: Release
on:
push:
tags:
- 'v*'
jobs:
create-release:
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref_name }}
release_name: Release ${{ github.ref_name }}
draft: false
prerelease: false
build-android:
runs-on: ubuntu-latest
needs: create-release
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20.19.0'
cache: 'npm'
- name: Setup Java
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: Install dependencies
run: npm ci
- name: Build Android Release APK
run: |
cd android
./gradlew assembleRelease
cp app/build/outputs/apk/release/app-release.apk ../CardScanner-${{ github.ref_name }}-android.apk
- name: Upload Android Release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-release.outputs.upload_url }}
asset_path: CardScanner-${{ github.ref_name }}-android.apk
asset_name: CardScanner-${{ github.ref_name }}-android.apk
asset_content_type: application/vnd.android.package-archive
build-ios:
runs-on: macos-latest
needs: create-release
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20.19.0'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Install iOS pods
run: |
cd ios
pod install
cd ..
- name: Build iOS Release
run: |
xcodebuild -workspace ios/CardScannerApp.xcworkspace \
-scheme CardScannerApp \
-configuration Release \
-sdk iphoneos \
-archivePath CardScannerApp.xcarchive \
archive
xcodebuild -exportArchive \
-archivePath CardScannerApp.xcarchive \
-exportOptionsPlist ios/ExportOptions.plist \
-exportPath build
cp build/CardScannerApp.ipa CardScanner-${{ github.ref_name }}-ios.ipa
- name: Upload iOS Release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-release.outputs.upload_url }}
asset_path: CardScanner-${{ github.ref_name }}-ios.ipa
asset_name: CardScanner-${{ github.ref_name }}-ios.ipa
asset_content_type: application/octet-stream