mirror of
https://github.com/fawney19/Aether.git
synced 2026-09-02 01:10:23 +08:00
ci: align release channels and speed rust checks
This commit is contained in:
@@ -4,6 +4,13 @@
|
|||||||
# 应用端口(默认 8084)
|
# 应用端口(默认 8084)
|
||||||
APP_PORT=8084
|
APP_PORT=8084
|
||||||
|
|
||||||
|
# Docker Compose 镜像(默认正式版 latest;提前测试可改 rc/beta;也可固定具体版本)
|
||||||
|
# 示例:
|
||||||
|
# APP_IMAGE=ghcr.io/fawney19/aether:latest
|
||||||
|
# APP_IMAGE=ghcr.io/fawney19/aether:rc
|
||||||
|
# APP_IMAGE=ghcr.io/fawney19/aether:beta
|
||||||
|
# APP_IMAGE=ghcr.io/fawney19/aether:0.7.0-rc.1
|
||||||
|
|
||||||
# API Key 前缀(默认 sk)
|
# API Key 前缀(默认 sk)
|
||||||
API_KEY_PREFIX=sk
|
API_KEY_PREFIX=sk
|
||||||
|
|
||||||
|
|||||||
4
.github/workflows/build-proxy.yml
vendored
4
.github/workflows/build-proxy.yml
vendored
@@ -103,9 +103,9 @@ jobs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
if [ "${{ matrix.use_cross }}" = "true" ]; then
|
if [ "${{ matrix.use_cross }}" = "true" ]; then
|
||||||
cross build --release --target ${{ matrix.target }}
|
cross build --release --locked --target ${{ matrix.target }}
|
||||||
else
|
else
|
||||||
cargo build --release --target ${{ matrix.target }}
|
cargo build --release --locked --target ${{ matrix.target }}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Package (Unix)
|
- name: Package (Unix)
|
||||||
|
|||||||
28
.github/workflows/deploy-pages.yml
vendored
28
.github/workflows/deploy-pages.yml
vendored
@@ -15,7 +15,35 @@ concurrency:
|
|||||||
cancel-in-progress: false
|
cancel-in-progress: false
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
preflight:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
deploy_pages: ${{ steps.classify.outputs.deploy_pages }}
|
||||||
|
steps:
|
||||||
|
- name: Ensure stable Pages release tag
|
||||||
|
id: classify
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
echo "deploy_pages=false" >> "${GITHUB_OUTPUT}"
|
||||||
|
|
||||||
|
if [[ "${GITHUB_REF_TYPE}" != "tag" ]]; then
|
||||||
|
echo "Manual Pages deployment."
|
||||||
|
echo "deploy_pages=true" >> "${GITHUB_OUTPUT}"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
tag="${GITHUB_REF_NAME}"
|
||||||
|
if [[ ! "${tag}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
||||||
|
echo "Skipping Pages deploy for non-stable release tag: ${tag}"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "deploy_pages=true" >> "${GITHUB_OUTPUT}"
|
||||||
|
|
||||||
build:
|
build:
|
||||||
|
needs: preflight
|
||||||
|
if: needs.preflight.outputs.deploy_pages == 'true'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v5
|
||||||
|
|||||||
91
.github/workflows/release.yml
vendored
91
.github/workflows/release.yml
vendored
@@ -19,8 +19,55 @@ env:
|
|||||||
DOCKERHUB_IMAGE: fawney19/aether
|
DOCKERHUB_IMAGE: fawney19/aether
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
preflight:
|
||||||
|
name: Release preflight
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
publish: ${{ steps.classify.outputs.publish }}
|
||||||
|
version_tag: ${{ steps.classify.outputs.version_tag }}
|
||||||
|
prerelease: ${{ steps.classify.outputs.prerelease }}
|
||||||
|
make_latest: ${{ steps.classify.outputs.make_latest }}
|
||||||
|
steps:
|
||||||
|
- name: Classify release tag
|
||||||
|
id: classify
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
echo "publish=false" >> "${GITHUB_OUTPUT}"
|
||||||
|
echo "version_tag=" >> "${GITHUB_OUTPUT}"
|
||||||
|
echo "prerelease=false" >> "${GITHUB_OUTPUT}"
|
||||||
|
echo "make_latest=false" >> "${GITHUB_OUTPUT}"
|
||||||
|
|
||||||
|
if [[ "${GITHUB_REF_TYPE}" != "tag" ]]; then
|
||||||
|
echo "Manual release build; publish jobs will be skipped."
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
tag="${GITHUB_REF_NAME}"
|
||||||
|
if [[ ! "${tag}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-(beta|rc)\.[0-9]+)?$ ]]; then
|
||||||
|
echo "Unsupported release tag: ${tag}" >&2
|
||||||
|
echo "Expected vX.Y.Z, vX.Y.Z-beta.N, or vX.Y.Z-rc.N." >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "version_tag=${tag}" >> "${GITHUB_OUTPUT}"
|
||||||
|
|
||||||
|
if [[ "${tag}" == *-* ]]; then
|
||||||
|
echo "prerelease=true" >> "${GITHUB_OUTPUT}"
|
||||||
|
else
|
||||||
|
echo "make_latest=true" >> "${GITHUB_OUTPUT}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "${GITHUB_EVENT_NAME}" == "push" ]]; then
|
||||||
|
echo "publish=true" >> "${GITHUB_OUTPUT}"
|
||||||
|
else
|
||||||
|
echo "Manual release build for ${tag}; publish jobs will be skipped."
|
||||||
|
fi
|
||||||
|
|
||||||
frontend:
|
frontend:
|
||||||
name: Build frontend
|
name: Build frontend
|
||||||
|
needs: preflight
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v5
|
||||||
@@ -48,6 +95,7 @@ jobs:
|
|||||||
|
|
||||||
build:
|
build:
|
||||||
name: Build ${{ matrix.name }}
|
name: Build ${{ matrix.name }}
|
||||||
|
needs: preflight
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: true
|
fail-fast: true
|
||||||
@@ -97,7 +145,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
env:
|
env:
|
||||||
AETHER_VERSION: ${{ startsWith(github.ref, 'refs/tags/v') && github.ref_name || '' }}
|
AETHER_VERSION: ${{ needs.preflight.outputs.version_tag }}
|
||||||
CARGO_TERM_COLOR: always
|
CARGO_TERM_COLOR: always
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
@@ -117,7 +165,8 @@ jobs:
|
|||||||
|
|
||||||
docker:
|
docker:
|
||||||
name: Docker multi-arch
|
name: Docker multi-arch
|
||||||
needs: [frontend, build]
|
needs: [preflight, frontend, build]
|
||||||
|
if: needs.preflight.outputs.publish == 'true'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v5
|
||||||
@@ -163,12 +212,13 @@ jobs:
|
|||||||
docker.io/${{ env.DOCKERHUB_IMAGE }}
|
docker.io/${{ env.DOCKERHUB_IMAGE }}
|
||||||
tags: |
|
tags: |
|
||||||
type=semver,pattern={{version}}
|
type=semver,pattern={{version}}
|
||||||
type=semver,pattern={{major}}.{{minor}}
|
type=semver,pattern={{major}}.{{minor}},enable=${{ needs.preflight.outputs.make_latest == 'true' }}
|
||||||
type=raw,value=pre,enable=${{ contains(github.ref, '-') }}
|
type=raw,value=latest,enable=${{ needs.preflight.outputs.make_latest == 'true' }}
|
||||||
type=raw,value=fix,enable=${{ contains(github.ref, '-fix') }}
|
type=raw,value=beta,enable=${{ contains(github.ref_name, '-beta.') }}
|
||||||
|
type=raw,value=rc,enable=${{ contains(github.ref_name, '-rc.') }}
|
||||||
type=sha,prefix=
|
type=sha,prefix=
|
||||||
flavor: |
|
flavor: |
|
||||||
latest=auto
|
latest=false
|
||||||
|
|
||||||
- name: Build and push
|
- name: Build and push
|
||||||
uses: docker/build-push-action@v6
|
uses: docker/build-push-action@v6
|
||||||
@@ -182,7 +232,7 @@ jobs:
|
|||||||
|
|
||||||
package:
|
package:
|
||||||
name: Release tarballs
|
name: Release tarballs
|
||||||
needs: [frontend, build]
|
needs: [preflight, frontend, build]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v5
|
||||||
@@ -238,29 +288,10 @@ jobs:
|
|||||||
|
|
||||||
github-release:
|
github-release:
|
||||||
name: GitHub Release assets
|
name: GitHub Release assets
|
||||||
needs: [docker, package]
|
needs: [preflight, docker, package]
|
||||||
if: startsWith(github.ref, 'refs/tags/')
|
if: needs.preflight.outputs.publish == 'true'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Classify release tag
|
|
||||||
id: release_tag
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
set -euo pipefail
|
|
||||||
tag="${GITHUB_REF_NAME}"
|
|
||||||
if [[ ! "${tag}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z][0-9A-Za-z.-]*)?$ ]]; then
|
|
||||||
echo "Unsupported release tag: ${tag}" >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ "${tag}" == *-* ]]; then
|
|
||||||
echo "prerelease=true" >> "${GITHUB_OUTPUT}"
|
|
||||||
echo "make_latest=false" >> "${GITHUB_OUTPUT}"
|
|
||||||
else
|
|
||||||
echo "prerelease=false" >> "${GITHUB_OUTPUT}"
|
|
||||||
echo "make_latest=true" >> "${GITHUB_OUTPUT}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Download release package artifact
|
- name: Download release package artifact
|
||||||
uses: actions/download-artifact@v5
|
uses: actions/download-artifact@v5
|
||||||
with:
|
with:
|
||||||
@@ -292,8 +323,8 @@ jobs:
|
|||||||
uses: softprops/action-gh-release@v2
|
uses: softprops/action-gh-release@v2
|
||||||
with:
|
with:
|
||||||
generate_release_notes: true
|
generate_release_notes: true
|
||||||
prerelease: ${{ steps.release_tag.outputs.prerelease }}
|
prerelease: ${{ needs.preflight.outputs.prerelease }}
|
||||||
make_latest: ${{ steps.release_tag.outputs.make_latest }}
|
make_latest: ${{ needs.preflight.outputs.make_latest }}
|
||||||
files: |
|
files: |
|
||||||
release-assets/*.tar.gz
|
release-assets/*.tar.gz
|
||||||
release-assets/SHA256SUMS
|
release-assets/SHA256SUMS
|
||||||
|
|||||||
47
.github/workflows/rust-ci.yml
vendored
47
.github/workflows/rust-ci.yml
vendored
@@ -36,12 +36,8 @@ jobs:
|
|||||||
|
|
||||||
- name: Install Rust toolchain
|
- name: Install Rust toolchain
|
||||||
uses: dtolnay/rust-toolchain@stable
|
uses: dtolnay/rust-toolchain@stable
|
||||||
|
with:
|
||||||
- name: Show Rust toolchain
|
components: rustfmt
|
||||||
run: rustup show active-toolchain
|
|
||||||
|
|
||||||
- name: Install rustfmt component
|
|
||||||
run: rustup component add rustfmt
|
|
||||||
|
|
||||||
- name: Format
|
- name: Format
|
||||||
run: cargo fmt --all --check
|
run: cargo fmt --all --check
|
||||||
@@ -54,12 +50,8 @@ jobs:
|
|||||||
|
|
||||||
- name: Install Rust toolchain
|
- name: Install Rust toolchain
|
||||||
uses: dtolnay/rust-toolchain@stable
|
uses: dtolnay/rust-toolchain@stable
|
||||||
|
with:
|
||||||
- name: Show Rust toolchain
|
components: clippy
|
||||||
run: rustup show active-toolchain
|
|
||||||
|
|
||||||
- name: Install clippy component
|
|
||||||
run: rustup component add clippy
|
|
||||||
|
|
||||||
- name: Rust cache
|
- name: Rust cache
|
||||||
uses: Swatinem/rust-cache@v2
|
uses: Swatinem/rust-cache@v2
|
||||||
@@ -91,12 +83,8 @@ jobs:
|
|||||||
|
|
||||||
- name: Install Rust toolchain
|
- name: Install Rust toolchain
|
||||||
uses: dtolnay/rust-toolchain@stable
|
uses: dtolnay/rust-toolchain@stable
|
||||||
|
with:
|
||||||
- name: Show Rust toolchain
|
components: clippy
|
||||||
run: rustup show active-toolchain
|
|
||||||
|
|
||||||
- name: Install clippy component
|
|
||||||
run: rustup component add clippy
|
|
||||||
|
|
||||||
- name: Rust cache
|
- name: Rust cache
|
||||||
uses: Swatinem/rust-cache@v2
|
uses: Swatinem/rust-cache@v2
|
||||||
@@ -128,12 +116,8 @@ jobs:
|
|||||||
|
|
||||||
- name: Install Rust toolchain
|
- name: Install Rust toolchain
|
||||||
uses: dtolnay/rust-toolchain@stable
|
uses: dtolnay/rust-toolchain@stable
|
||||||
|
with:
|
||||||
- name: Show Rust toolchain
|
components: clippy
|
||||||
run: rustup show active-toolchain
|
|
||||||
|
|
||||||
- name: Install clippy component
|
|
||||||
run: rustup component add clippy
|
|
||||||
|
|
||||||
- name: Rust cache
|
- name: Rust cache
|
||||||
uses: Swatinem/rust-cache@v2
|
uses: Swatinem/rust-cache@v2
|
||||||
@@ -196,11 +180,14 @@ jobs:
|
|||||||
- name: Setup sccache
|
- name: Setup sccache
|
||||||
uses: mozilla-actions/sccache-action@v0.0.9
|
uses: mozilla-actions/sccache-action@v0.0.9
|
||||||
|
|
||||||
|
- name: Install nextest
|
||||||
|
uses: taiki-e/install-action@nextest
|
||||||
|
|
||||||
- name: Test
|
- name: Test
|
||||||
env:
|
env:
|
||||||
RUSTC_WRAPPER: sccache
|
RUSTC_WRAPPER: sccache
|
||||||
SCCACHE_GHA_ENABLED: "true"
|
SCCACHE_GHA_ENABLED: "true"
|
||||||
run: cargo test -p aether-gateway
|
run: cargo nextest run -p aether-gateway
|
||||||
|
|
||||||
- name: Show sccache stats
|
- name: Show sccache stats
|
||||||
if: always()
|
if: always()
|
||||||
@@ -230,11 +217,14 @@ jobs:
|
|||||||
- name: Setup sccache
|
- name: Setup sccache
|
||||||
uses: mozilla-actions/sccache-action@v0.0.9
|
uses: mozilla-actions/sccache-action@v0.0.9
|
||||||
|
|
||||||
|
- name: Install nextest
|
||||||
|
uses: taiki-e/install-action@nextest
|
||||||
|
|
||||||
- name: Test
|
- name: Test
|
||||||
env:
|
env:
|
||||||
RUSTC_WRAPPER: sccache
|
RUSTC_WRAPPER: sccache
|
||||||
SCCACHE_GHA_ENABLED: "true"
|
SCCACHE_GHA_ENABLED: "true"
|
||||||
run: cargo test -p aether-data
|
run: cargo nextest run -p aether-data
|
||||||
|
|
||||||
- name: Show sccache stats
|
- name: Show sccache stats
|
||||||
if: always()
|
if: always()
|
||||||
@@ -264,11 +254,14 @@ jobs:
|
|||||||
- name: Setup sccache
|
- name: Setup sccache
|
||||||
uses: mozilla-actions/sccache-action@v0.0.9
|
uses: mozilla-actions/sccache-action@v0.0.9
|
||||||
|
|
||||||
|
- name: Install nextest
|
||||||
|
uses: taiki-e/install-action@nextest
|
||||||
|
|
||||||
- name: Test
|
- name: Test
|
||||||
env:
|
env:
|
||||||
RUSTC_WRAPPER: sccache
|
RUSTC_WRAPPER: sccache
|
||||||
SCCACHE_GHA_ENABLED: "true"
|
SCCACHE_GHA_ENABLED: "true"
|
||||||
run: cargo test --workspace --exclude aether-gateway --exclude aether-data
|
run: cargo nextest run --workspace --exclude aether-gateway --exclude aether-data
|
||||||
|
|
||||||
- name: Show sccache stats
|
- name: Show sccache stats
|
||||||
if: always()
|
if: always()
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ cp -a data/aether.db backup_$(date +%Y%m%d_%H%M%S).db
|
|||||||
curl -fsSL https://raw.githubusercontent.com/fawney19/Aether/aether-rust-pioneer/install.sh | sudo bash
|
curl -fsSL https://raw.githubusercontent.com/fawney19/Aether/aether-rust-pioneer/install.sh | sudo bash
|
||||||
```
|
```
|
||||||
|
|
||||||
运行后按提示输入语言、版本和部署方式。固定安装某个 tag 时,版本选择选 `2`,再输入类似 `v0.7.0-rc23` 的 tag。默认会安装最新预发布版本;Docker Compose 模式默认使用 `pre` 镜像通道。
|
运行后按提示输入语言、版本和部署方式。默认会安装最新正式版。需要提前测试时可用 `AETHER_CHANNEL=rc` 或 `AETHER_CHANNEL=beta`;Docker Compose 模式默认使用 `latest` 镜像通道。固定安装某个 tag 时,版本选择选 `4`,再输入类似 `v0.7.0-rc.1` 的 tag。
|
||||||
二进制安装在下载 Release 压缩包前会询问是否使用下载加速源;选择使用时会先打印原始 GitHub URL,再要求输入新的压缩包下载 URL。非交互式安装可用 `AETHER_RELEASE_ARCHIVE_URL` 指定压缩包 URL。
|
二进制安装在下载 Release 压缩包前会询问是否使用下载加速源;选择使用时会先打印原始 GitHub URL,再要求输入新的压缩包下载 URL。非交互式安装可用 `AETHER_RELEASE_ARCHIVE_URL` 指定压缩包 URL。
|
||||||
如果安装目录里已经有配置,脚本会优先复用:Docker Compose 保留已有 `.env`,二进制服务模式保留已有 `/etc/aether/aether-gateway.env`。只有首次生成新配置时才会提示输入管理员密码。
|
如果安装目录里已经有配置,脚本会优先复用:Docker Compose 保留已有 `.env`,二进制服务模式保留已有 `/etc/aether/aether-gateway.env`。只有首次生成新配置时才会提示输入管理员密码。
|
||||||
|
|
||||||
@@ -116,8 +116,10 @@ curl -fsSL https://raw.githubusercontent.com/fawney19/Aether/aether-rust-pioneer
|
|||||||
请输入选项 / Enter choice [1]:
|
请输入选项 / Enter choice [1]:
|
||||||
|
|
||||||
请选择 Aether 版本:
|
请选择 Aether 版本:
|
||||||
1) 最新预发布版本
|
1) 最新正式版
|
||||||
2) 指定 tag,例如 v0.7.0-rc23
|
2) 最新 RC 预发布版
|
||||||
|
3) 最新 Beta 预发布版
|
||||||
|
4) 指定 tag,例如 v0.7.0-rc.1
|
||||||
|
|
||||||
请输入选项 [1]:
|
请输入选项 [1]:
|
||||||
|
|
||||||
|
|||||||
@@ -335,6 +335,7 @@ fn configure_tcp_socket(stream: &TcpStream, state: &Arc<AppState>) {
|
|||||||
|
|
||||||
/// Build rustls ClientConfig with system root certificates.
|
/// Build rustls ClientConfig with system root certificates.
|
||||||
pub fn build_tls_config() -> rustls::ClientConfig {
|
pub fn build_tls_config() -> rustls::ClientConfig {
|
||||||
|
let _ = rustls::crypto::ring::default_provider().install_default();
|
||||||
let root_store =
|
let root_store =
|
||||||
rustls::RootCertStore::from_iter(webpki_roots::TLS_SERVER_ROOTS.iter().cloned());
|
rustls::RootCertStore::from_iter(webpki_roots::TLS_SERVER_ROOTS.iter().cloned());
|
||||||
rustls::ClientConfig::builder()
|
rustls::ClientConfig::builder()
|
||||||
|
|||||||
@@ -503,6 +503,7 @@ pub fn resolve_request_timing<B>(
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn build_tls_config(http1_only: bool) -> Arc<ClientConfig> {
|
fn build_tls_config(http1_only: bool) -> Arc<ClientConfig> {
|
||||||
|
let _ = rustls::crypto::ring::default_provider().install_default();
|
||||||
let root_store =
|
let root_store =
|
||||||
rustls::RootCertStore::from_iter(webpki_roots::TLS_SERVER_ROOTS.iter().cloned());
|
rustls::RootCertStore::from_iter(webpki_roots::TLS_SERVER_ROOTS.iter().cloned());
|
||||||
let mut config = ClientConfig::builder()
|
let mut config = ClientConfig::builder()
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
services:
|
services:
|
||||||
app:
|
app:
|
||||||
image: ${APP_IMAGE:-ghcr.io/fawney19/aether:pre}
|
image: ${APP_IMAGE:-ghcr.io/fawney19/aether:latest}
|
||||||
container_name: aether-app
|
container_name: aether-app
|
||||||
env_file:
|
env_file:
|
||||||
- .env
|
- .env
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ services:
|
|||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|
||||||
app:
|
app:
|
||||||
image: ${APP_IMAGE:-ghcr.io/fawney19/aether:pre}
|
image: ${APP_IMAGE:-ghcr.io/fawney19/aether:latest}
|
||||||
container_name: aether-app
|
container_name: aether-app
|
||||||
env_file:
|
env_file:
|
||||||
- .env
|
- .env
|
||||||
|
|||||||
52
install.sh
52
install.sh
@@ -4,7 +4,7 @@ set -euo pipefail
|
|||||||
REPO="${AETHER_REPO:-fawney19/Aether}"
|
REPO="${AETHER_REPO:-fawney19/Aether}"
|
||||||
SOURCE_REF="${AETHER_SOURCE_REF:-aether-rust-pioneer}"
|
SOURCE_REF="${AETHER_SOURCE_REF:-aether-rust-pioneer}"
|
||||||
VERSION="${AETHER_VERSION:-}"
|
VERSION="${AETHER_VERSION:-}"
|
||||||
CHANNEL="${AETHER_CHANNEL:-pre}"
|
CHANNEL="${AETHER_CHANNEL:-stable}"
|
||||||
CHANNEL_EXPLICIT="false"
|
CHANNEL_EXPLICIT="false"
|
||||||
if [[ -n "${AETHER_CHANNEL:-}" ]]; then
|
if [[ -n "${AETHER_CHANNEL:-}" ]]; then
|
||||||
CHANNEL_EXPLICIT="true"
|
CHANNEL_EXPLICIT="true"
|
||||||
@@ -55,10 +55,11 @@ Options:
|
|||||||
single: system service with SQLite + in-process runtime
|
single: system service with SQLite + in-process runtime
|
||||||
cluster: system service connected to shared database + Redis
|
cluster: system service connected to shared database + Redis
|
||||||
Linux services use systemd; macOS services use launchd
|
Linux services use systemd; macOS services use launchd
|
||||||
--channel CHANNEL Release channel to resolve when --version is omitted: pre or rc
|
--channel CHANNEL Release channel to resolve when --version is omitted: stable, latest, rc, or beta
|
||||||
pre resolves the latest semver prerelease tag (default)
|
stable/latest resolves the latest stable tag (default)
|
||||||
rc restricts resolution to tags like v0.7.0-rc23
|
rc resolves the latest tag like v0.7.0-rc.1
|
||||||
--version VERSION Exact release tag to install, for example v0.7.0-rc23
|
beta resolves the latest tag like v0.7.0-beta.1
|
||||||
|
--version VERSION Exact release tag to install, for example v0.7.0-rc.1
|
||||||
--repo OWNER/REPO GitHub repository to download from (default: fawney19/Aether)
|
--repo OWNER/REPO GitHub repository to download from (default: fawney19/Aether)
|
||||||
--source-ref REF Source branch/tag used for compose templates (default: aether-rust-pioneer)
|
--source-ref REF Source branch/tag used for compose templates (default: aether-rust-pioneer)
|
||||||
--archive PATH Install from a local release tarball instead of downloading
|
--archive PATH Install from a local release tarball instead of downloading
|
||||||
@@ -368,8 +369,10 @@ select_version() {
|
|||||||
cat >/dev/tty <<'EOF'
|
cat >/dev/tty <<'EOF'
|
||||||
|
|
||||||
请选择 Aether 版本:
|
请选择 Aether 版本:
|
||||||
1) 最新预发布版本
|
1) 最新正式版
|
||||||
2) 指定 tag,例如 v0.7.0-rc23
|
2) 最新 RC 预发布版
|
||||||
|
3) 最新 Beta 预发布版
|
||||||
|
4) 指定 tag,例如 v0.7.0-rc.1
|
||||||
|
|
||||||
请输入选项 [1]:
|
请输入选项 [1]:
|
||||||
EOF
|
EOF
|
||||||
@@ -377,8 +380,10 @@ EOF
|
|||||||
cat >/dev/tty <<'EOF'
|
cat >/dev/tty <<'EOF'
|
||||||
|
|
||||||
Choose Aether version:
|
Choose Aether version:
|
||||||
1) Latest pre release
|
1) Latest stable release
|
||||||
2) Exact tag, for example v0.7.0-rc23
|
2) Latest RC prerelease
|
||||||
|
3) Latest beta prerelease
|
||||||
|
4) Exact tag, for example v0.7.0-rc.1
|
||||||
|
|
||||||
Enter choice [1]:
|
Enter choice [1]:
|
||||||
EOF
|
EOF
|
||||||
@@ -387,9 +392,15 @@ EOF
|
|||||||
IFS= read -r choice </dev/tty || choice=""
|
IFS= read -r choice </dev/tty || choice=""
|
||||||
case "${choice:-1}" in
|
case "${choice:-1}" in
|
||||||
1)
|
1)
|
||||||
CHANNEL="pre"
|
CHANNEL="stable"
|
||||||
;;
|
;;
|
||||||
2)
|
2)
|
||||||
|
CHANNEL="rc"
|
||||||
|
;;
|
||||||
|
3)
|
||||||
|
CHANNEL="beta"
|
||||||
|
;;
|
||||||
|
4)
|
||||||
if ui_is_zh; then
|
if ui_is_zh; then
|
||||||
cat >/dev/tty <<'EOF'
|
cat >/dev/tty <<'EOF'
|
||||||
请输入准确 tag:
|
请输入准确 tag:
|
||||||
@@ -713,20 +724,26 @@ resolve_version() {
|
|||||||
|
|
||||||
local tag=""
|
local tag=""
|
||||||
case "${CHANNEL}" in
|
case "${CHANNEL}" in
|
||||||
pre)
|
stable|latest)
|
||||||
tag="$(download_stdout "https://api.github.com/repos/${REPO}/releases?per_page=50" |
|
tag="$(download_stdout "https://api.github.com/repos/${REPO}/releases?per_page=50" |
|
||||||
sed -n 's/.*"tag_name"[[:space:]]*:[[:space:]]*"\([^"]*\)".*/\1/p' |
|
sed -n 's/.*"tag_name"[[:space:]]*:[[:space:]]*"\([^"]*\)".*/\1/p' |
|
||||||
grep -E '^v[0-9]+(\.[0-9]+)*-[0-9A-Za-z][0-9A-Za-z.-]*$' |
|
grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' |
|
||||||
head -n1 || true)"
|
head -n1 || true)"
|
||||||
;;
|
;;
|
||||||
rc)
|
rc)
|
||||||
tag="$(download_stdout "https://api.github.com/repos/${REPO}/releases?per_page=50" |
|
tag="$(download_stdout "https://api.github.com/repos/${REPO}/releases?per_page=50" |
|
||||||
sed -n 's/.*"tag_name"[[:space:]]*:[[:space:]]*"\([^"]*\)".*/\1/p' |
|
sed -n 's/.*"tag_name"[[:space:]]*:[[:space:]]*"\([^"]*\)".*/\1/p' |
|
||||||
grep -E '^v[0-9]+(\.[0-9]+)*-rc[0-9]+$' |
|
grep -E '^v[0-9]+\.[0-9]+\.[0-9]+-rc\.[0-9]+$' |
|
||||||
|
head -n1 || true)"
|
||||||
|
;;
|
||||||
|
beta)
|
||||||
|
tag="$(download_stdout "https://api.github.com/repos/${REPO}/releases?per_page=50" |
|
||||||
|
sed -n 's/.*"tag_name"[[:space:]]*:[[:space:]]*"\([^"]*\)".*/\1/p' |
|
||||||
|
grep -E '^v[0-9]+\.[0-9]+\.[0-9]+-beta\.[0-9]+$' |
|
||||||
head -n1 || true)"
|
head -n1 || true)"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
die "unsupported release channel: ${CHANNEL}; expected pre or rc"
|
die "unsupported release channel: ${CHANNEL}; expected stable, latest, rc, or beta"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
echo "${tag}"
|
echo "${tag}"
|
||||||
@@ -999,11 +1016,14 @@ compose_image() {
|
|||||||
tag="${VERSION#v}"
|
tag="${VERSION#v}"
|
||||||
else
|
else
|
||||||
case "${CHANNEL}" in
|
case "${CHANNEL}" in
|
||||||
pre|rc)
|
stable|latest)
|
||||||
|
tag="latest"
|
||||||
|
;;
|
||||||
|
rc|beta)
|
||||||
tag="${CHANNEL}"
|
tag="${CHANNEL}"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
tag="${CHANNEL}"
|
die "unsupported release channel: ${CHANNEL}; expected stable, latest, rc, or beta"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user