Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d912da6310 | |||
| e460f0fb85 | |||
| e5d03ade52 | |||
| a56a9568f6 |
@@ -16,7 +16,6 @@ jobs:
|
||||
timeout-minutes: 45
|
||||
env:
|
||||
REGISTRY_HOST: ${{ vars.REGISTRY_HOST }}
|
||||
REGISTRY_USERNAME: ${{ vars.REGISTRY_USERNAME }}
|
||||
DEPLOY_HOST: ${{ vars.DEPLOY_HOST }}
|
||||
DEPLOY_PORT: ${{ vars.DEPLOY_PORT }}
|
||||
DEPLOY_USER: ${{ vars.DEPLOY_USER }}
|
||||
@@ -32,6 +31,7 @@ jobs:
|
||||
- name: Validate deployment configuration
|
||||
shell: bash
|
||||
env:
|
||||
REGISTRY_USERNAME: ${{ secrets.REGISTRY_USERNAME }}
|
||||
REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}
|
||||
DEPLOY_SSH_KEY: ${{ secrets.DEPLOY_SSH_KEY }}
|
||||
DEPLOY_SSH_KNOWN_HOSTS: ${{ secrets.DEPLOY_SSH_KNOWN_HOSTS }}
|
||||
@@ -70,6 +70,7 @@ jobs:
|
||||
- name: Login to container registry
|
||||
shell: bash
|
||||
env:
|
||||
REGISTRY_USERNAME: ${{ secrets.REGISTRY_USERNAME }}
|
||||
REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}
|
||||
run: |
|
||||
set -Eeuo pipefail
|
||||
@@ -104,6 +105,7 @@ jobs:
|
||||
- name: Deploy on production server
|
||||
shell: bash
|
||||
env:
|
||||
REGISTRY_USERNAME: ${{ secrets.REGISTRY_USERNAME }}
|
||||
REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}
|
||||
DEPLOY_SSH_KEY: ${{ secrets.DEPLOY_SSH_KEY }}
|
||||
DEPLOY_SSH_KNOWN_HOSTS: ${{ secrets.DEPLOY_SSH_KNOWN_HOSTS }}
|
||||
|
||||
@@ -44,12 +44,24 @@ jobs:
|
||||
shell: bash
|
||||
run: |
|
||||
set -Eeuo pipefail
|
||||
for command_name in cargo rustup docker curl jq file sha256sum; do
|
||||
for command_name in docker curl jq file sha256sum; do
|
||||
command -v "$command_name" >/dev/null || {
|
||||
printf 'runner prerequisite is missing: %s\n' "$command_name" >&2
|
||||
exit 1
|
||||
}
|
||||
done
|
||||
if ! command -v rustup >/dev/null || ! command -v cargo >/dev/null; then
|
||||
rustup_installer="$(mktemp "${RUNNER_TEMP:-/tmp}/rustup-init.XXXXXX")"
|
||||
trap 'rm -f "$rustup_installer"' EXIT
|
||||
curl --proto '=https' --tlsv1.2 --fail --silent --show-error \
|
||||
https://sh.rustup.rs \
|
||||
--output "$rustup_installer"
|
||||
sh "$rustup_installer" -y --profile minimal --default-toolchain none
|
||||
export PATH="${CARGO_HOME:-$HOME/.cargo}/bin:$PATH"
|
||||
printf '%s\n' "${CARGO_HOME:-$HOME/.cargo}/bin" >> "$GITHUB_PATH"
|
||||
fi
|
||||
command -v rustup >/dev/null || { printf 'rustup installation failed\n' >&2; exit 1; }
|
||||
command -v cargo >/dev/null || { printf 'cargo installation failed\n' >&2; exit 1; }
|
||||
rustup toolchain install "$RUST_TOOLCHAIN" --profile minimal --no-self-update
|
||||
rustup override set "$RUST_TOOLCHAIN"
|
||||
cargo install cross --version "$CROSS_VERSION" --locked
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "vps-agent"
|
||||
version = "0.1.1"
|
||||
version = "0.1.4"
|
||||
edition = "2021"
|
||||
rust-version = "1.80"
|
||||
license = "Apache-2.0"
|
||||
|
||||
@@ -16,7 +16,7 @@ Keep these existing instance-level values:
|
||||
| Kind | Name | Purpose |
|
||||
| --- | --- | --- |
|
||||
| Variable | `REGISTRY_HOST` | Registry hostname with optional port, without `https://` |
|
||||
| Variable | `REGISTRY_USERNAME` | Registry login/user name |
|
||||
| Secret | `REGISTRY_USERNAME` | Registry login/user name |
|
||||
| Secret | `REGISTRY_PASSWORD` | Gitea PAT with `write:package` access (which includes read) |
|
||||
| Secret | `RELEASE_TOKEN` | Used by the separate agent release workflow |
|
||||
|
||||
|
||||
@@ -12,14 +12,14 @@ Register an amd64 Gitea Actions runner whose `ubuntu-latest` label resolves to a
|
||||
Linux environment with:
|
||||
|
||||
- `bash`, `curl`, `jq`, `file`, `sha256sum`, Git, and CA certificates;
|
||||
- Rustup and Cargo;
|
||||
- Docker with permission for the runner user to access its daemon;
|
||||
- outbound access to the Rust registries and the container registry used by
|
||||
`cross`.
|
||||
|
||||
The job installs the pinned Rust 1.85.1 toolchain and `cross` 0.2.5. `cross`
|
||||
uses Docker to build both musl targets; no amd64 or arm64 build host is required.
|
||||
Do not expose the Docker daemon over an unauthenticated TCP socket.
|
||||
When Rustup or Cargo is absent, the job bootstraps Rustup using its official TLS
|
||||
installer. It then installs the pinned Rust 1.85.1 toolchain and `cross` 0.2.5.
|
||||
`cross` uses Docker to build both musl targets; no amd64 or arm64 build host is
|
||||
required. Do not expose the Docker daemon over an unauthenticated TCP socket.
|
||||
|
||||
The simplest setup is a dedicated runner VM with an `ubuntu-latest:host` label.
|
||||
If jobs run inside a container instead, that container needs the Docker CLI and
|
||||
|
||||
Reference in New Issue
Block a user