-
-
Notifications
You must be signed in to change notification settings - Fork 488
executable file
·157 lines (153 loc) · 6.31 KB
/
release.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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
name: release to github
on:
push:
tags:
- "v*.*.*"
jobs:
create:
runs-on: ubuntu-latest
steps:
- uses: softprops/action-gh-release@v1
with:
draft: false
generate_release_notes: true
doc:
needs: create
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: 'Get Previous tag'
id: previoustag
uses: "WyriHaximus/github-action-get-previous-tag@v1"
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
java-version: '17'
distribution: 'temurin'
cache: maven
- name: replace version
run: sed -i "s/SONIC_VERSION/${{ steps.previoustag.outputs.tag }}/g" src/main/docker/docker-compose*.yml
- name: Upload yml To Github Release
uses: xresloader/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
file: src/main/docker/docker-compose.yml;src/main/docker/docker-compose-zh.yml
tag_name: ${{ steps.previoustag.outputs.tag }}
update_latest_release: true
draft: false
release:
needs: create
strategy:
matrix:
platform: [ "windows-x86", "windows-x86_64", "macosx-arm64", "macosx-x86_64", "linux-arm64", "linux-x86", "linux-x86_64" ]
include:
- platform: linux-x86
depend: linux_x86
adb: linux
- platform: linux-x86_64
depend: linux_x86_64
adb: linux
- platform: linux-arm64
depend: linux_arm64
adb: linux
- platform: macosx-x86_64
depend: macosx_x86_64
adb: darwin
- platform: macosx-arm64
depend: macosx_arm64
adb: darwin
- platform: windows-x86
depend: windows_x86
adb: windows
tail: .exe
- platform: windows-x86_64
depend: windows_x86_64
adb: windows
tail: .exe
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: 'Get Previous tag'
id: previoustag
uses: "WyriHaximus/github-action-get-previous-tag@v1"
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
java-version: '17'
distribution: 'temurin'
cache: maven
- name: replace version
run: ver=${{ steps.previoustag.outputs.tag }} && new_ver=${ver:1} && sed -i "s/SONIC_VERSION/${new_ver}/g" pom.xml && sed -i "s/SONIC_VERSION/${{ steps.previoustag.outputs.tag }}/g" src/main/docker/docker-compose*.yml
- name: mkdir
run: mkdir -p sonic-agent-${{ steps.previoustag.outputs.tag }}-${{matrix.depend}}/plugins
- name: package
run: mvn clean package -Dplatform=${{ matrix.platform }} -Dmaven.test.skip=true
- name: mvJar-linux86
run: cp -r target/sonic-agent-${{ matrix.platform }}.jar sonic-agent-${{ steps.previoustag.outputs.tag }}-${{matrix.depend}}/
- name: copy
run: cp -r config/ mini/ sonic-agent-${{ steps.previoustag.outputs.tag }}-${{matrix.depend}}/
- name: adb-download
uses: robinraju/[email protected]
with:
repository: SonicCloudOrg/sonic-adb-binary
latest: true
fileName: "*"
- name: adb-unzip
run: unzip platform-tools_r34.0.3-${{matrix.adb}}.zip && mv platform-tools/* sonic-agent-${{ steps.previoustag.outputs.tag }}-${{matrix.depend}}/plugins/
- name: sas-download
uses: robinraju/[email protected]
with:
repository: SonicCloudOrg/sonic-android-supply
latest: true
fileName: "*"
- name: sas-untar
run: tar zxvf *_${{matrix.depend}}.tar.gz && rm *_${{matrix.depend}}.tar.gz && mv sas${{matrix.tail}} sonic-agent-${{ steps.previoustag.outputs.tag }}-${{matrix.depend}}/plugins/sonic-android-supply${{matrix.tail}}
- name: sgm-download
uses: robinraju/[email protected]
with:
repository: SonicCloudOrg/sonic-go-mitmproxy
latest: true
fileName: "*"
- name: sgm-untar
run: tar zxvf *_${{matrix.depend}}.tar.gz && rm *_${{matrix.depend}}.tar.gz && mv sonic-go-mitmproxy${{matrix.tail}} sonic-agent-${{ steps.previoustag.outputs.tag }}-${{matrix.depend}}/plugins/sonic-go-mitmproxy${{matrix.tail}}
- name: sib-download
uses: robinraju/[email protected]
with:
repository: SonicCloudOrg/sonic-ios-bridge
latest: true
fileName: "*"
- name: sib-untar
run: tar zxvf *_${{matrix.depend}}.tar.gz && rm *_${{matrix.depend}}.tar.gz && mv sib${{matrix.tail}} sonic-agent-${{ steps.previoustag.outputs.tag }}-${{matrix.depend}}/plugins/sonic-ios-bridge${{matrix.tail}}
- name: saa-download
uses: robinraju/[email protected]
with:
repository: SonicCloudOrg/sonic-android-apk
latest: true
fileName: "sonic-android-apk.apk"
- name: saa
run: cp sonic-android-apk.apk sonic-agent-${{ steps.previoustag.outputs.tag }}-${{matrix.depend}}/plugins/
- name: sas
run: cp plugins/sonic-android-scrcpy.jar sonic-agent-${{ steps.previoustag.outputs.tag }}-${{matrix.depend}}/plugins/
- name: appium1
run: cp plugins/sonic-appium-uiautomator2-server.apk sonic-agent-${{ steps.previoustag.outputs.tag }}-${{matrix.depend}}/plugins/
- name: appium2
run: cp plugins/sonic-appium-uiautomator2-server-test.apk sonic-agent-${{ steps.previoustag.outputs.tag }}-${{matrix.depend}}/plugins/
- name: zip
uses: TheDoctor0/[email protected]
with:
filename: sonic-agent-${{ steps.previoustag.outputs.tag }}-${{matrix.depend}}.zip
directory: sonic-agent-${{ steps.previoustag.outputs.tag }}-${{matrix.depend}}
- name: Upload Zip To Github Release
uses: xresloader/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
file: sonic-agent-${{ steps.previoustag.outputs.tag }}-${{matrix.depend}}/sonic-agent-${{ steps.previoustag.outputs.tag }}-${{matrix.depend}}.zip
tag_name: ${{ steps.previoustag.outputs.tag }}
update_latest_release: true
draft: false