ci: add ubuntu-22.04 build target and versioned artifacts
This commit is contained in:
40
.github/workflows/ci.yml
vendored
40
.github/workflows/ci.yml
vendored
@@ -8,24 +8,44 @@ env:
|
||||
CARGO_TERM_COLOR: always
|
||||
|
||||
jobs:
|
||||
build_and_test:
|
||||
name: Rust project - latest
|
||||
build_latest:
|
||||
name: Build - ubuntu-latest
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
rust_ver:
|
||||
- "1.90"
|
||||
# Very ugly way to force cargo and jazz to be in PATH across run's but
|
||||
# lets fix this alter.
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- run: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain none -y
|
||||
- run: echo "$HOME/.cargo/bin" >> $GITHUB_PATH
|
||||
- run: rustup update ${{ matrix.rust_ver }} && rustup default ${{ matrix.rust_ver }}
|
||||
- run: rustup update 1.90 && rustup default 1.90
|
||||
- run: cargo build
|
||||
- run: cargo build --release
|
||||
- name: Get version
|
||||
run: |
|
||||
echo "PROJECT_VERSION=$(cargo pkgid | cut -d# -f2 | cut -d: -f2)" >> $GITHUB_ENV
|
||||
- name: Rename binary
|
||||
run: mv target/release/gitea_mirror target/release/gitea_mirror-${{ env.PROJECT_VERSION }}-ubuntu-latest
|
||||
- name: Release
|
||||
uses: softprops/action-gh-release@v2
|
||||
if: github.ref_type == 'tag'
|
||||
with:
|
||||
files: target/release/gitea_mirror
|
||||
files: target/release/gitea_mirror-${{ env.PROJECT_VERSION }}-ubuntu-latest
|
||||
|
||||
build_legacy:
|
||||
name: Build - ubuntu-22.04
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- run: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain none -y
|
||||
- run: echo "$HOME/.cargo/bin" >> $GITHUB_PATH
|
||||
- run: rustup update 1.90 && rustup default 1.90
|
||||
- run: cargo build
|
||||
- run: cargo build --release
|
||||
- name: Get version
|
||||
run: |
|
||||
echo "PROJECT_VERSION=$(cargo pkgid | cut -d# -f2 | cut -d: -f2)" >> $GITHUB_ENV
|
||||
- name: Rename binary
|
||||
run: mv target/release/gitea_mirror target/release/gitea_mirror-${{ env.PROJECT_VERSION }}-ubuntu-22.04
|
||||
- name: Release
|
||||
uses: softprops/action-gh-release@v2
|
||||
if: github.ref_type == 'tag'
|
||||
with:
|
||||
files: target/release/gitea_mirror-${{ env.PROJECT_VERSION }}-ubuntu-22.04
|
||||
|
||||
21
vibe_coding_log/session_2026_01_14_ci_glibc_fix.md
Normal file
21
vibe_coding_log/session_2026_01_14_ci_glibc_fix.md
Normal file
@@ -0,0 +1,21 @@
|
||||
# Session 2026-01-14: Fix CI for Older GLIBC
|
||||
|
||||
## Task
|
||||
- User reported CI artifacts fail on older Ubuntu 22.04 due to GLIBC version mismatch.
|
||||
- User asked about static linking vs CI adjustment.
|
||||
|
||||
## Approach
|
||||
- Advised against static linking (musl) due to complexity with `libgit2` and OpenSSL in this context.
|
||||
- Opted to modify GitHub Actions CI (`.github/workflows/ci.yml`).
|
||||
- Implemented a matrix build strategy to run on `ubuntu-22.04` and `ubuntu-latest`.
|
||||
- Added logic to extract the crate version from `Cargo.toml`.
|
||||
- Updated the release step to rename artifacts to include both the version and the OS (e.g., `gitea_mirror-0.1.0-ubuntu-22.04`).
|
||||
|
||||
## Follow-up (Gitea Actions Fix)
|
||||
- User reported the workflow stopped triggering entirely on Gitea.
|
||||
- Suspected `runs-on: ${{ matrix.os }}` context expansion issue in Gitea Actions parser.
|
||||
- Refactored `ci.yml` to use two explicit jobs (`build_latest` and `build_legacy`) instead of a matrix strategy.
|
||||
- Addressed a YAML syntax error ("mapping values are not allowed") caused by a colon in the `run` command by converting it to a block scalar (`|`).
|
||||
|
||||
## Changes
|
||||
- Modified `.github/workflows/ci.yml`.
|
||||
Reference in New Issue
Block a user