Compare commits

..

6 Commits

Author SHA1 Message Date
arbi 5a0ee5cfcf Merge pull request 'Tampilkan link compare file berubah setelah tagging' (#5) from development into main
Reviewed-on: #5
2026-08-07 12:35:07 +07:00
Ariyutta 3fea3aa92e Tampilkan link compare file berubah setelah tagging
release.sh sekarang mencetak URL compare (tag lama...tag baru) supaya bisa langsung lihat file mana saja yang berubah di rilis tersebut, bukan seluruh isi repo.
2026-08-07 12:34:37 +07:00
arbi 205ac5304b Merge pull request 'Hapus workflow auto-tag.yml, pakai scripts/release.sh saja' (#4) from development into main
Reviewed-on: #4
2026-08-07 12:28:02 +07:00
Ariyutta 2a287973fd Hapus workflow auto-tag.yml, pakai scripts/release.sh saja
Belum ada runner Gitea Actions terpasang, jadi tagging cukup dilakukan manual lewat script agar tidak ada workflow run yang menggantung di tab Actions.
2026-08-07 12:27:07 +07:00
arbi 6795d5532c Merge pull request 'Tambah script release.sh untuk tagging versi manual' (#3) from development into main
Auto Tag Version / auto-tag (push) Has been cancelled
Reviewed-on: #3
2026-08-07 12:20:37 +07:00
Ariyutta ab5974a2b4 Tambah script release.sh untuk tagging versi manual
Sementara runner Gitea Actions belum aktif, script ini jadi alternatif manual untuk auto-tag.yml: cek tag terakhir, naikkan PATCH, lalu push tag baru.
2026-08-07 12:17:50 +07:00
2 changed files with 60 additions and 44 deletions
-44
View File
@@ -1,44 +0,0 @@
name: Auto Tag Version
on:
push:
branches:
- main
jobs:
auto-tag:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Bump patch version and create tag
run: |
git fetch --tags origin
latest_tag=$(git tag --list 'v*' --sort=-v:refname | head -n1)
if [ -z "$latest_tag" ]; then
new_tag="v0.1.0"
else
version="${latest_tag#v}"
major="${version%%.*}"
rest="${version#*.}"
minor="${rest%%.*}"
patch="${rest#*.}"
patch=$((patch + 1))
new_tag="v${major}.${minor}.${patch}"
fi
if git rev-parse "$new_tag" >/dev/null 2>&1; then
echo "Tag $new_tag sudah ada, dilewati."
exit 0
fi
echo "Membuat tag baru: $new_tag"
git config user.name "gitea-actions"
git config user.email "actions@git.untan.id"
git tag -a "$new_tag" -m "Auto release $new_tag"
git push origin "$new_tag"
+60
View File
@@ -0,0 +1,60 @@
#!/usr/bin/env bash
set -euo pipefail
# Membuat tag versi baru (naik PATCH) dari branch main dan push ke origin.
# Jalankan setelah PR development -> main sudah di-merge.
branch=$(git rev-parse --abbrev-ref HEAD)
if [ "$branch" != "main" ]; then
echo "Harus dijalankan dari branch 'main' (sekarang di '$branch')."
echo "Jalankan: git checkout main && git pull origin main"
exit 1
fi
if [ -n "$(git status --porcelain)" ]; then
echo "Ada perubahan yang belum di-commit. Bereskan dulu sebelum tagging."
exit 1
fi
echo "Mengambil update terbaru dari origin/main..."
git fetch origin main --tags
if [ "$(git rev-parse HEAD)" != "$(git rev-parse origin/main)" ]; then
echo "Branch main lokal belum sinkron dengan origin/main."
echo "Jalankan: git pull origin main"
exit 1
fi
latest_tag=$(git tag --list 'v*' --sort=-v:refname | head -n1)
if [ -z "$latest_tag" ]; then
new_tag="v0.1.0"
else
version="${latest_tag#v}"
major="${version%%.*}"
rest="${version#*.}"
minor="${rest%%.*}"
patch="${rest#*.}"
patch=$((patch + 1))
new_tag="v${major}.${minor}.${patch}"
fi
echo "Tag terakhir : ${latest_tag:-tidak ada}"
echo "Tag baru : $new_tag"
read -p "Buat dan push tag '$new_tag'? [y/N] " confirm
if [ "$confirm" != "y" ] && [ "$confirm" != "Y" ]; then
echo "Dibatalkan."
exit 0
fi
message="${1:-Rilis $new_tag}"
git tag -a "$new_tag" -m "$message"
git push origin "$new_tag"
echo "Selesai. Tag $new_tag sudah dibuat dan dikirim ke origin."
repo_url=$(git remote get-url origin | sed -E 's#\.git$##')
if [ -n "$latest_tag" ]; then
echo ""
echo "Lihat file yang berubah di rilis ini:"
echo "$repo_url/compare/$latest_tag...$new_tag"
fi