Skip to content

Commit 5eb9fb4

Browse files
authored
Merge pull request #1673 from tryzealot/release/5.3.7
Release 5.3.7
2 parents 30af5f3 + dfede69 commit 5eb9fb4

24 files changed

+843
-234
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ ARG BUILD_DATE
6464
ARG VCS_REF
6565
ARG TAG
6666

67-
ARG ZEALOT_VERSION="5.3.6"
67+
ARG ZEALOT_VERSION="5.3.7"
6868
ARG REPLACE_CHINA_MIRROR="true"
6969
ARG ORIGINAL_REPO_URL="dl-cdn.alpinelinux.org"
7070
ARG MIRROR_REPO_URL="mirrors.ustc.edu.cn"
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# frozen_string_literal: true
2+
3+
class Api::ReleasesController < Api::BaseController
4+
before_action :validate_user_token
5+
before_action :set_release
6+
7+
# UPDATE /releases/:id
8+
def update
9+
@release.update!(release_params)
10+
render json: @release
11+
end
12+
13+
# DELETE /releases/:id
14+
def destroy
15+
@release.destroy
16+
render json: { mesage: 'OK' }
17+
end
18+
19+
protected
20+
21+
def set_release
22+
@release = Release.find(params[:id])
23+
end
24+
25+
def release_params
26+
params.permit(
27+
:release_version, :build_version, :release_type, :source, :branch, :git_commit,
28+
:ci_url, :custom_fields, :changelog
29+
)
30+
end
31+
end

app/controllers/users/omniauth_callbacks_controller.rb

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# frozen_string_literal: true
22

33
class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController
4-
before_action :disable_registrations_mode unless Setting.registrations_mode
5-
64
User.oauth_providers.each do |provider_name|
75
define_method(provider_name) do
86
omniauth_callback(provider_name)
@@ -52,8 +50,4 @@ def goback_path
5250
omni_params = request.env['omniauth.params']
5351
omni_params&['back'].presence || request.env['HTTP_REFERER'] || root_path
5452
end
55-
56-
def disable_registrations_mode
57-
redirect_to user_session_path, alert: t('devise.omniauth_callbacks.disabled')
58-
end
5953
end

app/models/release.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ class Release < ApplicationRecord
1616
has_one :metadata, class_name: 'Metadatum', dependent: :destroy
1717
has_and_belongs_to_many :devices, dependent: :destroy
1818

19-
validates :file, presence: true
19+
validates :file, presence: true, on: :create
2020
validate :bundle_id_matched, on: :create
21-
validate :determine_file_exist
22-
validate :determine_disk_space
21+
validate :determine_file_exist, on: :create
22+
validate :determine_disk_space, on: :create
2323

2424
before_create :auto_release_version
2525
before_create :default_source

app/serializers/release_serializer.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# frozen_string_literal: true
22

33
class ReleaseSerializer < ApplicationSerializer
4-
attributes :version, :app_name, :bundle_id, :release_version, :build_version,
4+
attributes :id, :version, :app_name, :bundle_id, :release_version, :build_version,
55
:source, :branch, :git_commit, :ci_url, :size, :platform, :device_type,
66
:icon_url, :install_url, :changelog, :text_changelog, :custom_fields,
77
:created_at

app/views/devise/shared/_links.html.slim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
- if devise_mapping.omniauthable? && Setting.registrations_mode
1+
- if devise_mapping.omniauthable?
22
.social-auth-links.mb-3
33
- resource_class.oauth_providers.each do |provider|
44
- unless provider == :ldap

config/locales/devise/devise.views.en.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,3 @@ en:
55
danger_zone: Danger Zone
66
cancel_my_account: Delete account
77
unhappy: Do you really want to delete your account?
8-
omniauth_callbacks:
9-
disabled: Registration mode is closed. Please contact the administrator.

config/locales/devise/devise.views.zh-CN.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,7 @@ zh-CN:
7474
message: 由于多次登录失败,您的帐户已被锁定。
7575
subject: 帐户解锁信息
7676
omniauth_callbacks:
77-
disabled: 系统关闭了注册功能,请联系管理员。
78-
failure: 由于 %{reason},无法从%{kind}获得授权。
77+
failure: 基于 %{reason},无法从%{kind}获得授权。
7978
success: 成功地从%{kind}获得授权。
8079
passwords:
8180
edit:

config/locales/zealot/api.en.yml

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ en:
1313
1414
```json
1515
{
16-
"version": "5.3.6",
16+
"version": "5.3.7",
1717
"vcs_ref": "effe99c25b79fd55d3e1959ea3af0bcb6b75ba1d",
1818
"build_date": "2024-05-23T06:04:48.989Z"
1919
}
@@ -123,6 +123,17 @@ en:
123123
bundle_id: identifier valid check, set `*` skip (`bundle_id` for iOS, `package name` for Android)
124124
git_url: Git repository URL
125125
password: Enable password visit
126+
release_options:
127+
description: App's build metadata form data
128+
properties:
129+
build_version: Build version
130+
release_version: Release version
131+
source: the source of upload (default is `api`)
132+
changelog: Change log, accept plain text or JSON formatted data
133+
branch: a branch name from source control tool
134+
git_commit: Git Commit SHA value
135+
ci_url: the build url of a CI service
136+
custom_fields: JSON formatted custom fields, icon only accepts fontawesome.
126137
collaborator_options:
127138
description: App's collaborator form data
128139
properties:
@@ -144,6 +155,7 @@ en:
144155
file: Zip arichved file (dSYM or Proguard)
145156
release_version: Release version (requires if Android's Proguard file)
146157
build_version: Build version (requires if Android's Proguard file)
158+
147159
apps:
148160
default:
149161
tags: Apps
@@ -185,6 +197,7 @@ en:
185197
destroy:
186198
title: Destroy an App
187199
description: Destroy an App all data by ID, include schemes, channel, builds, debug files and the other related resources.
200+
188201
schemes:
189202
default:
190203
tags: Schemes
@@ -206,6 +219,7 @@ en:
206219
destroy:
207220
title: Destroy a scheme
208221
description: Destroy a scheme from the App
222+
209223
channels:
210224
default:
211225
tags: Channel
@@ -227,6 +241,20 @@ en:
227241
destroy:
228242
title: Destroy a channel
229243
description: Destroy a scheme's channel
244+
245+
releases:
246+
default:
247+
tags: Release
248+
responses:
249+
update: Update a build
250+
destroy: Destroy build
251+
update:
252+
title: Update a build metedata
253+
description: Update a build of app verison, custom_fileds, changelog etc
254+
destroy:
255+
title: Destroy a build
256+
description: Destroy a app's build
257+
230258
collaborators:
231259
default:
232260
tags: Collaborators
@@ -248,6 +276,7 @@ en:
248276
destroy:
249277
title: Remove a collaborator from an App
250278
description: Remove a collaborator from an App
279+
251280
debug_files:
252281
default:
253282
tags: Debug files
@@ -285,6 +314,7 @@ en:
285314
destroy:
286315
title: Destroy a debug file
287316
description: Destroy a debug file ID and all data, include dSYM or Proguard files.
317+
288318
users:
289319
default:
290320
tags: Users
@@ -321,6 +351,7 @@ en:
321351
unlock:
322352
title: Unlock a user
323353
description: Unlock a user to enable log in
354+
324355
version:
325356
default:
326357
tags: Version

config/locales/zealot/api.zh-CN.yml

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ zh-CN:
1313
1414
```json
1515
{
16-
"version": "5.3.6",
16+
"version": "5.3.7",
1717
"vcs_ref": "effe99c25b79fd55d3e1959ea3af0bcb6b75ba1d",
1818
"build_date": "2024-05-23T06:04:48.989Z"
1919
}
@@ -120,6 +120,18 @@ zh-CN:
120120
bundle_id: 包名校验, 默认是 `*` 不做校验 (iOS 指的是 bundle_id,Android 指的是 package name)
121121
git_url: Git 仓库地址
122122
password: 密码访问
123+
release_options:
124+
description: 应用版本元信息表单字段结构
125+
properties:
126+
build_version: 构建版本
127+
release_version: 发布版本
128+
release_type: 应用类型,比如 debug, beta, adhoc, release, enterprise 等
129+
source: 上传渠道名称,默认是 `api`
130+
changelog: 变更日志,接受纯文本或 JSON 格式化的数据
131+
branch: 代码控制软件的分支名
132+
git_commit: 代码控制软件提交哈希值
133+
ci_url: 持续构建系统构建 URL
134+
custom_fields: 这是一个用 JSON 字符串定义的自定义字段,图标可接受 fontawesome
123135
collaborator_options:
124136
description: 应用成员表单字段结构
125137
properties:
@@ -228,6 +240,19 @@ zh-CN:
228240
title: 删除应用渠道
229241
description: 从应用中删除指定应用渠道
230242

243+
releases:
244+
default:
245+
tags: 应用版本
246+
responses:
247+
update: 更新应用版本
248+
destroy: 删除应用版本
249+
update:
250+
title: 更新应用版本元信息
251+
description: 更新应用版本的版本、自定义字段、变更日志等信息
252+
destroy:
253+
title: 删除应用版本
254+
description: 删除应用版本
255+
231256
collaborators:
232257
default:
233258
tags: 应用成员

0 commit comments

Comments
 (0)