forked from SaeedDev94/Xray
-
Notifications
You must be signed in to change notification settings - Fork 0
161 lines (155 loc) · 4.87 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
158
159
160
161
name: Release CI
on:
workflow_dispatch:
jobs:
build-arm32:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Build arm32 docker
run: docker build -t arm32 -f Dockerfile .
- name: Compile arm32 build
run: |
docker run --rm \
-v /opt/dist:/opt/dist \
-e DIST_DIR='/opt/dist' \
-e RELEASE_TAG="$GITHUB_REF_NAME" \
-e NATIVE_ARCH="arm" \
-e ABI_ID=1 \
-e ABI_TARGET="armeabi-v7a" \
-e KS_FILE="${{ secrets.KS_FILE }}" \
-e KS_PASSWORD="${{ secrets.KS_PASSWORD }}" \
-e KEY_ALIAS="${{ secrets.KEY_ALIAS }}" \
-e KEY_PASSWORD="${{ secrets.KEY_PASSWORD }}" \
arm32
- name: Upload arm32 artifact
uses: actions/upload-artifact@v4
with:
name: arm32-build
path: /opt/dist
build-arm64:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Build arm64 docker
run: docker build -t arm64 -f Dockerfile .
- name: Compile arm64 build
run: |
docker run --rm \
-v /opt/dist:/opt/dist \
-e DIST_DIR='/opt/dist' \
-e RELEASE_TAG="$GITHUB_REF_NAME" \
-e NATIVE_ARCH="arm64" \
-e ABI_ID=2 \
-e ABI_TARGET="arm64-v8a" \
-e KS_FILE="${{ secrets.KS_FILE }}" \
-e KS_PASSWORD="${{ secrets.KS_PASSWORD }}" \
-e KEY_ALIAS="${{ secrets.KEY_ALIAS }}" \
-e KEY_PASSWORD="${{ secrets.KEY_PASSWORD }}" \
arm64
- name: Upload arm64 artifact
uses: actions/upload-artifact@v4
with:
name: arm64-build
path: /opt/dist
build-x86:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Build x86 docker
run: docker build -t x86 -f Dockerfile .
- name: Compile x86 build
run: |
docker run --rm \
-v /opt/dist:/opt/dist \
-e DIST_DIR='/opt/dist' \
-e RELEASE_TAG="$GITHUB_REF_NAME" \
-e NATIVE_ARCH="386" \
-e ABI_ID=3 \
-e ABI_TARGET="x86" \
-e KS_FILE="${{ secrets.KS_FILE }}" \
-e KS_PASSWORD="${{ secrets.KS_PASSWORD }}" \
-e KEY_ALIAS="${{ secrets.KEY_ALIAS }}" \
-e KEY_PASSWORD="${{ secrets.KEY_PASSWORD }}" \
x86
- name: Upload x86 artifact
uses: actions/upload-artifact@v4
with:
name: x86-build
path: /opt/dist
build-amd64:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Build amd64 docker
run: docker build -t amd64 -f Dockerfile .
- name: Compile amd64 build
run: |
docker run --rm \
-v /opt/dist:/opt/dist \
-e DIST_DIR='/opt/dist' \
-e RELEASE_TAG="$GITHUB_REF_NAME" \
-e NATIVE_ARCH="amd64" \
-e ABI_ID=4 \
-e ABI_TARGET="x86_64" \
-e KS_FILE="${{ secrets.KS_FILE }}" \
-e KS_PASSWORD="${{ secrets.KS_PASSWORD }}" \
-e KEY_ALIAS="${{ secrets.KEY_ALIAS }}" \
-e KEY_PASSWORD="${{ secrets.KEY_PASSWORD }}" \
amd64
- name: Upload amd64 artifact
uses: actions/upload-artifact@v4
with:
name: amd64-build
path: /opt/dist
publish:
runs-on: ubuntu-latest
needs:
- build-arm32
- build-arm64
- build-x86
- build-amd64
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Download arm32 artifact
uses: actions/download-artifact@v4
with:
name: arm32-build
path: dist
- name: Download arm64 artifact
uses: actions/download-artifact@v4
with:
name: arm64-build
path: dist
- name: Download x86 artifact
uses: actions/download-artifact@v4
with:
name: x86-build
path: dist
- name: Download amd64 artifact
uses: actions/download-artifact@v4
with:
name: amd64-build
path: dist
- name: Set VERSION_CODE
run: |
ALL_VARIANTS=4
VERSION_CODE=$(cat "$GITHUB_WORKSPACE/app/versionCode.txt")
((VERSION_CODE += ALL_VARIANTS))
echo "VERSION_CODE=$VERSION_CODE" >> $GITHUB_ENV
- name: Publish release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ github.ref_name }}
name: ${{ github.ref_name }}
prerelease: false
draft: false
files: "dist/*.apk"
body_path: ${{ github.workspace }}/metadata/en-US/changelogs/${{ env.VERSION_CODE }}.txt