Skip to content

Fix: Dependency libcrypto-3-x64.dll not found, in production. #50

Fix: Dependency libcrypto-3-x64.dll not found, in production.

Fix: Dependency libcrypto-3-x64.dll not found, in production. #50

name: CodeManager Installer Release
on:
push:
branches:
- "main"
- "development"
tags:
- "v*"
- "beta-*"
permissions: write-all
jobs:
get_tag:
if: vars.PRODUCTION == 'true'
runs-on: ubuntu-latest
steps:
- uses: nimblehq/branch-tag-action@v1
id: extract_tag
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Validate tag source branch
run: |
# Fetch all branches to ensure we can check merges
git fetch --all
# Get the branch that the tag points to (not just contains the commit)
# Method 1: Check git log for the most recent branch
TAG_BRANCH=$(git log --oneline --decorate -1 ${{ github.sha }} | grep -o 'origin/[^,)]*' | grep -E '(main|development)' | head -1 | sed 's/origin\///')
# Method 2: If that fails, check which branch was most recently updated with this commit
if [ -z "$TAG_BRANCH" ]; then
# Check which branch has this commit as the latest
for branch in main development; do
if [ "$(git rev-parse origin/$branch)" = "${{ github.sha }}" ]; then
TAG_BRANCH="$branch"
break
fi
done
fi
# Method 3: Fallback to tag naming convention
if [ -z "$TAG_BRANCH" ]; then
if [[ "${{ github.ref_name }}" == v* ]]; then
TAG_BRANCH="main"
elif [[ "${{ github.ref_name }}" == beta-* ]]; then
TAG_BRANCH="development"
fi
fi
echo "Tag was created from branch: $TAG_BRANCH"
# Validate tag/branch combination
if [[ "${{ github.ref_name }}" == v* && "$TAG_BRANCH" != "main" ]]; then
echo "❌ v* tags must be created from main branch, but this was created from: $TAG_BRANCH"
exit 1
elif [[ "${{ github.ref_name }}" == beta-* && "$TAG_BRANCH" != "development" ]]; then
echo "❌ beta-* tags must be created from development branch, but this was created from: $TAG_BRANCH"
exit 1
fi
echo "✅ Tag validation passed"
- name: Extract Tag message
run: |
git fetch --tags --force
TAG_MESSAGE=$(git tag -l --format='%(contents:subject)' ${{ steps.extract_tag.outputs.branch_tag }})
echo "branch_tag_message=$TAG_MESSAGE" >> $GITHUB_OUTPUT
outputs:
tag_name: ${{ steps.extract_tag.outputs.branch_tag }}
tag_message: ${{ steps.extract_tag.outputs.branch_tag_message }}
build:
needs: get_tag
name: Build CodeManager
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Cached Python dependencies
id: cache-python
uses: actions/cache/restore@v4
with:
path: .venv
key: ${{ runner.os }}-python-${{ hashFiles('scripts/requirements.txt') }}
restore-keys: |
${{ runner.os }}-python-
- name: Cached Vcpkg libraries
id: cache-vcpkg
uses: actions/cache/restore@v4
with:
path: vcpkg
key: ${{ runner.os }}-vcpkg
- name: Cached Node dependencies
id: cache-node
uses: actions/cache/restore@v4
with:
path: node_modules
key: ${{ runner.os }}-node_modules-${{ hashFiles('bun.lockb') }}
restore-keys: |
${{ runner.os }}-node_modules-
- name: Cached Rust & Tauri dependencies
id: cache-rust-tauri
uses: actions/cache/restore@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
src-tauri/target
key: ${{ runner.os }}-rust-${{ hashFiles('src-tauri/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-rust-
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: "pip"
cache-dependency-path: scripts/requirements.txt
- name: Set up Rust
uses: actions-rs/[email protected]
with:
toolchain: "1.78.0" # stable
default: true
override: true
- name: Set up Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: "1.1.30"
- name: Set up MSBuild
uses: microsoft/setup-msbuild@v2
with:
msbuild-architecture: "x64"
- name: Install OpenSSL using vcpkg
if: steps.cache-vcpkg.outputs.cache-hit != 'true'
shell: pwsh
run: |
$env:VCPKG_ROOT = "${{ github.workspace }}\vcpkg"
git clone https://github.com/microsoft/vcpkg $env:VCPKG_ROOT
.\vcpkg\bootstrap-vcpkg.bat
.\vcpkg\vcpkg install openssl:x64-windows-static
.\vcpkg\vcpkg integrate install
- name: Install dependencies
run: |
dotnet tool install --global wix
bun pys fullinstall
- name: Build Components
env:
VCPKG_ROOT: ${{ github.workspace }}\vcpkg
OPENSSL_DIR: ${{ github.workspace }}\vcpkg\installed\x64-windows-static
OPENSSL_STATIC: 1
# Force static linking
VCPKGRS_DYNAMIC: 0
RUSTFLAGS: "-C target-feature=+crt-static"
JWT_SECRET: ${{ secrets.JWT_SECRET }}
SQLITE_DB_KEY: ${{ secrets.SQLITE_DB_KEY }}
UPGRADE_CODE: ${{ vars.UPGRADE_CODE }}
run: |
./.venv/Scripts/activate
bun pys build
- name: Create Release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v2
with:
name: Release ${{ needs.get_tag.outputs.tag_name }}
tag_name: ${{ needs.get_tag.outputs.tag_name }}
body_path: CHANGELOG.md
files: dist/codemg-setup.msi
- name: Save Python dependencies
if: ${{ startsWith(github.ref, 'refs/heads/') && (steps.cache-python.outputs.cache-hit != 'true')}}
uses: actions/cache/save@v4
with:
path: .venv
key: ${{ steps.cache-python.outputs.cache-primary-key }}
- name: Save Vcpkg libraries
if: ${{ startsWith(github.ref, 'refs/heads/') && (steps.cache-vcpkg.outputs.cache-hit != 'true')}}
uses: actions/cache/save@v4
with:
path: vcpkg
key: ${{ steps.cache-vcpkg.outputs.cache-primary-key }}
- name: Save Node dependencies
if: ${{ startsWith(github.ref, 'refs/heads/') && (steps.cache-node.outputs.cache-hit != 'true')}}
uses: actions/cache/save@v4
with:
path: node_modules
key: ${{ steps.cache-node.outputs.cache-primary-key }}
- name: Save Rust & Tauri dependencies
uses: actions/cache/save@v4
if: ${{ startsWith(github.ref, 'refs/heads/') && (steps.cache-rust-tauri.outputs.cache-hit != 'true')}}
with:
path: |
~/.cargo/registry
~/.cargo/git
src-tauri/target
key: ${{ steps.cache-rust-tauri.outputs.cache-primary-key }}