mirror of
https://git.hexahost.dev/smueller/HexaHost-Frontend.git
synced 2026-06-02 06:08:42 +00:00
Refactor release build process: Updated README.md to clarify branch usage and workflow for development and production. Enhanced Gitea and GitHub workflows to automate merging from dev to main, ensuring consistent obfuscation and asset management during releases. Improved commit messages and streamlined the build process for better clarity and efficiency.
This commit is contained in:
@@ -1,34 +1,43 @@
|
||||
name: Obfuscate Main Build
|
||||
name: Release Build (dev → main)
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- dev
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
# Gitea liefert intern oft eine IP; das SSL-Zertifikat gilt für den Hostnamen.
|
||||
GITEA_HOST: git.hexahost.dev
|
||||
REPO_PATH: smueller/HexaHost-Frontend
|
||||
|
||||
jobs:
|
||||
obfuscate:
|
||||
release-build:
|
||||
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }}
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
- name: Checkout (volle History)
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
repository-url: https://git.hexahost.dev/smueller/HexaHost-Frontend
|
||||
ref: dev
|
||||
|
||||
- name: Skip loop commits
|
||||
- name: Merge dev in CI-Workspace (Basis main)
|
||||
env:
|
||||
GITEA_TOKEN: ${{ github.token }}
|
||||
run: |
|
||||
msg="$(git log -1 --pretty=%B)"
|
||||
echo "Last commit message: $msg"
|
||||
if echo "$msg" | grep -q "\[skip ci\]"; then
|
||||
echo "Skip CI commit detected."
|
||||
exit 0
|
||||
git config user.name "gitea-actions"
|
||||
git config user.email "actions@local"
|
||||
git remote set-url origin "https://oauth2:${GITEA_TOKEN}@${GITEA_HOST}/${REPO_PATH}.git"
|
||||
git fetch origin main dev
|
||||
|
||||
if git show-ref --verify --quiet refs/remotes/origin/main; then
|
||||
git checkout -B main origin/main
|
||||
git merge origin/dev -X theirs --no-edit -m "ci: merge dev for release build"
|
||||
else
|
||||
echo "main branch missing, initializing from dev"
|
||||
git checkout -B main origin/dev
|
||||
fi
|
||||
|
||||
- name: Setup Python
|
||||
@@ -44,7 +53,7 @@ jobs:
|
||||
- name: Run release obfuscation
|
||||
run: python scripts/obfuscate_release.py --root . --hash-assets
|
||||
|
||||
- name: Commit obfuscated build
|
||||
- name: Publish release to main
|
||||
env:
|
||||
GITEA_TOKEN: ${{ github.token }}
|
||||
run: |
|
||||
@@ -53,8 +62,8 @@ jobs:
|
||||
git remote set-url origin "https://oauth2:${GITEA_TOKEN}@${GITEA_HOST}/${REPO_PATH}.git"
|
||||
git add -A
|
||||
if git diff --cached --quiet; then
|
||||
echo "No build changes to commit."
|
||||
echo "No release changes to publish."
|
||||
exit 0
|
||||
fi
|
||||
git commit -m "chore(release): obfuscate and hash production assets [skip ci]"
|
||||
git push origin HEAD:main
|
||||
git push origin main
|
||||
|
||||
Reference in New Issue
Block a user