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.
All checks were successful
Release Build (dev → main) / release-build (push) Successful in 29s
All checks were successful
Release Build (dev → main) / release-build (push) Successful in 29s
This commit is contained in:
50
.github/workflows/obfuscate-main.yml
vendored
50
.github/workflows/obfuscate-main.yml
vendored
@@ -1,44 +1,70 @@
|
||||
name: Obfuscate Main Build
|
||||
# Hinweis: Gitea nutzt .gitea/workflows/obfuscate-main.yml (identischer Ablauf).
|
||||
name: Release Build (dev → main)
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- dev
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
env:
|
||||
GITEA_HOST: git.hexahost.dev
|
||||
REPO_PATH: smueller/HexaHost-Frontend
|
||||
|
||||
jobs:
|
||||
obfuscate:
|
||||
if: github.actor != 'github-actions[bot]'
|
||||
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: Merge dev in CI-Workspace (Basis main)
|
||||
env:
|
||||
GITEA_TOKEN: ${{ github.token }}
|
||||
run: |
|
||||
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
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.12'
|
||||
python-version: "3.12"
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '20'
|
||||
node-version: "20"
|
||||
|
||||
- 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: |
|
||||
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 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
|
||||
git push origin main
|
||||
|
||||
Reference in New Issue
Block a user