forked from tidev/titanium-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
105 lines (89 loc) · 2.66 KB
/
action.yml
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: Package
description: Packages the SDK
inputs:
node-version:
description: The version of Node.js to use
required: true
java-version:
description: The version of Java to use
required: true
vtag:
description: The version tag to be used for the SDK
required: true
runs:
using: composite
steps:
- name: Use Node.js 16.x
uses: actions/setup-node@v3
with:
node-version: ${{ inputs.node-version }}
cache: 'npm'
- name: Use JDK 11
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: ${{ inputs.java-version }}
- name: Install dependencies
run: npm ci
shell: bash
- name: Cache Gradle packages
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- uses: actions/download-artifact@v3
with:
name: android-build
- name: Extract Android build output
run: tar -xzvf android-build.tar.gz
shell: bash
- uses: actions/download-artifact@v3
with:
name: ios-build
- name: Extract iOS build output
run: tar -xzvf ios-build.tar.gz
shell: bash
- name: Cache Native Modules
uses: actions/cache@v3
with:
path: ${{ env.SDK_BUILD_CACHE_DIR }}
key: native-modules-${{ github.sha }}
restore-keys: |
native-modules-
- name: Package
run: npm run package -- --version-tag ${{ inputs.vtag }} --all
shell: bash
- name: Archive OSX artifact
uses: actions/upload-artifact@v3
with:
name: mobilesdk-${{ inputs.vtag }}-osx
path: |
dist/mobilesdk-*-osx.zip
- name: Archive win32 artifact
uses: actions/upload-artifact@v3
with:
name: mobilesdk-${{ inputs.vtag }}-win32
path: |
dist/mobilesdk-*-win32.zip
- name: Archive Linux artifact
uses: actions/upload-artifact@v3
with:
name: mobilesdk-${{ inputs.vtag }}-linux
path: |
dist/mobilesdk-*-linux.zip
- name: Cleanup Gradle Cache
# Remove some files from the Gradle cache, so they aren't cached by GitHub Actions.
# Restoring these files from a GitHub Actions cache might cause problems for future builds.
run: |
rm -f ~/.gradle/caches/modules-2/modules-2.lock
rm -f ~/.gradle/caches/modules-2/gc.properties
shell: bash
- uses: geekyeggo/delete-artifact@v2
with:
name: |
android-build
ios-build