Setting version from tag

This commit is contained in:
2026-07-10 22:08:23 -03:00
parent b60c88e9b1
commit 9e738cc0d5
3 changed files with 41 additions and 2 deletions

View File

@@ -20,6 +20,25 @@ jobs:
- name: Check out repository code
uses: actions/checkout@v4
- name: Set version from tag
env:
RELEASE_TAG: ${{ gitea.ref_name }}
run: |
if [[ ! "$RELEASE_TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "Expected a vX.Y.Z tag, got: $RELEASE_TAG"
exit 1
fi
VERSION="${RELEASE_TAG#v}"
MATCHING_FILES=$(git grep -Il -e '\bv0\.0\.0\b' -e '\b0\.0\.0\b' || true)
if [ -n "$MATCHING_FILES" ]; then
while IFS= read -r file; do
sed -i \
-e "s/\\bv0\\.0\\.0\\b/$RELEASE_TAG/g" \
-e "s/\\b0\\.0\\.0\\b/$VERSION/g" \
"$file"
done <<< "$MATCHING_FILES"
fi
- name: Setup required tools
run: sudo apt-get install zip jq curl -y
@@ -111,6 +130,25 @@ jobs:
- name: Check out repository
uses: actions/checkout@v2
- name: Set version from tag
env:
RELEASE_TAG: ${{ gitea.ref_name }}
run: |
if [[ ! "$RELEASE_TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "Expected a vX.Y.Z tag, got: $RELEASE_TAG"
exit 1
fi
VERSION="${RELEASE_TAG#v}"
MATCHING_FILES=$(git grep -Il -e '\bv0\.0\.0\b' -e '\b0\.0\.0\b' || true)
if [ -n "$MATCHING_FILES" ]; then
while IFS= read -r file; do
sed -i \
-e "s/\\bv0\\.0\\.0\\b/$RELEASE_TAG/g" \
-e "s/\\b0\\.0\\.0\\b/$VERSION/g" \
"$file"
done <<< "$MATCHING_FILES"
fi
- name: Log in to Container Registry
run: |
echo "${{ secrets.REGISTRY_PASSWORD }}" \

View File

@@ -1,7 +1,7 @@
{
"manifest_version": 3,
"name": "Vision Startpage",
"version": "1.0.0",
"version": "0.0.0",
"description": "A light, modern and customizable startpage.",
"chrome_url_overrides": {
"newtab": "index.html"

View File

@@ -208,6 +208,7 @@ Build, then combine `dist/` + `manifest.json` into a folder and "Load unpacked"
`Dockerfile` builds in Node 22 Alpine (`npm ci` → runs `scripts/prepare_release.sh``npm run build`) and serves `/app/dist` + `manifest.json` via nginx:alpine on port 80.
### CI/CD (Gitea Actions)
- `release.yaml` validates each `vX.Y.Z` tag and replaces tracked `v0.0.0`/`0.0.0` placeholders in each build checkout before producing the extension archive and production image.
- **`main.yaml`** — Triggers on push to `main` (and `workflow_dispatch`). Builds, pushes a `staging` multi-arch (amd64/arm64) image to `git.ivanch.me/ivanch/vision-start:staging`, then SSH-deploys on the staging host via `docker compose up -d --force-recreate`.
- **`release.yaml`** — Triggers on `v*` tags. Builds, zips `dist/` + `manifest.json` as `vision-start-<tag>.zip`, runs `scripts/check_virustotal.sh` against it (publishes analysis URL + detection ratio on the release body), creates a Gitea release, pushes a `latest` multi-arch image, and SSH-deploys to production.
@@ -252,4 +253,4 @@ External assets fetched at build time by `scripts/prepare_release.sh`:
---
_Last updated: 2026-07-08. Generated as a general project overview; not a coding-style guide._
_Last updated: 2026-07-10. Generated as a general project overview; not a coding-style guide._