Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .github/workflows/auto-merge-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: ✅ Auto-Merge Release PR

on:
pull_request:
types: [opened, synchronize]

permissions:
pull-requests: write
contents: write

jobs:
auto-merge:
name: Auto-Merge Release PR
runs-on: ubuntu-latest
if: |
contains(github.head_ref, 'fix/release') ||
contains(github.head_ref, 'chore/release') ||
github.event.pull_request.title == 'ci(release): make release draft, upload assets, then publish'
steps:
- name: 🔍 Wait for CI to pass
uses: lewagon/wait-on-check-action@v1.3.1
with:
ref: ${{ github.event.pull_request.head.sha }}
repo-token: ${{ secrets.GITHUB_TOKEN }}
wait-interval: 10
allowed-conclusions: success

- name: 🟢 Enable auto-merge
uses: peter-evans/enable-pull-request-automerge@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
pull-request-number: ${{ github.event.pull_request.number }}
merge-method: squash
31 changes: 27 additions & 4 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -320,15 +320,15 @@ jobs:
$body | Out-File -FilePath "RELEASE_NOTES.md" -Encoding utf8
Write-Host "✅ Release notes generated (top 4 highlights + changelog link)"

# ─── STEP 9: Buat Release entry dulu (selalu jalan, meski build gagal) ──
# Release dibuat lebih awal agar tag tetap terdaftar sebagai "latest"
- name: 🏷️ Create GitHub Release (always)
# ─── STEP 9: Buat Release entry dulu sebagai DRAFT ──
# Release dibuat sebagai draft dulu: upload assets dulu baru publish.
- name: 🏷️ Create GitHub Release (draft)
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.version.outputs.tag }}
name: ZeroMix ${{ steps.version.outputs.tag }}
body_path: RELEASE_NOTES.md
draft: false
draft: true
prerelease: false
make_latest: true
fail_on_unmatched_files: false
Expand All @@ -348,3 +348,26 @@ jobs:
fail_on_unmatched_files: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# ─── STEP 10: Publish Release (make it live) ───────────────────────────────
- name: 🟢 Publish Release (make live)
shell: pwsh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
$tag = "${{ steps.version.outputs.tag }}"
$repo = "${{ github.repository }}"
$url = "https://api.github.com/repos/$repo/releases/tags/$tag"

Write-Host "Looking up release id for $tag..."
$resp = Invoke-RestMethod -Headers @{ Authorization = "token $env:GITHUB_TOKEN"; Accept = "application/vnd.github.v3+json" } -Uri $url -Method GET
$id = $resp.id
if ($null -eq $id) {
Write-Host "Release not found for tag $tag" -ForegroundColor Red
exit 1
}

Write-Host "Publishing release id $id..."
$body = @{ draft = $false } | ConvertTo-Json
Invoke-RestMethod -Headers @{ Authorization = "token $env:GITHUB_TOKEN"; Accept = "application/vnd.github.v3+json" } -Uri "https://api.github.com/repos/$repo/releases/$id" -Method PATCH -Body $body
Write-Host "✅ Release published"
59 changes: 59 additions & 0 deletions Docs/RELEASE_WORKFLOW.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# 📋 Release & WinGet Update Flow

## Alur Otomatis

```
1. User jalankan: .\Scripts\release-version.ps1 -NewVersion X.X.X

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The parameter name in Scripts/release-version.ps1 is -Version, not -NewVersion. Using -NewVersion will cause the script to fail as the parameter does not exist.

Suggested change
1. User jalankan: .\Scripts\release-version.ps1 -NewVersion X.X.X
1. User jalankan: .\Scripts\release-version.ps1 -Version X.X.X

2. Script push tag vX.X.X
3. build-release.yml trigger
├─ Build app
├─ Create Release (DRAFT)
├─ Upload assets
└─ Publish Release (auto-triggered)
4. winget-releaser.yml trigger (saat Release di-publish)
├─ Pull dari faizinuha/winget-pkgs
├─ Update manifest versi terbaru
└─ Submit PR ke microsoft/winget-pkgs
5. 🤖 Auto-Merge PR di ZeroMix (fix/release-publish)
├─ Tunggu CI lulus
└─ Auto-squash merge ke main
6. 📥 Microsoft review PR (~1-3 hari kerja)
├─ Auto-merge di microsoft/winget-pkgs
└─ (atau manual review → merge)
7. ✅ User bisa: winget install Zeromix.ZeroMix
```

## Key Points

- **release-version.ps1** → Update versi, commit, push tag
- **build-release.yml** → Build, upload, publish (tidak race condition lagi)
- **winget-releaser.yml** → Auto-submit PR ke WinGet (vedantmgoyal9 action)
- **auto-merge-release.yml** → Auto-merge fix/release-* PR di ZeroMix
- **WINGET_ACC_TOKEN** → GitHub PAT untuk fork faizinuha/winget-pkgs

## PR Microsoft WinGet

PR yang di-submit vedantmgoyal9/winget-releaser ke microsoft/winget-pkgs perlu di-approve Microsoft.
Bisa monitor di: https://github.com/microsoft/winget-pkgs/pulls

Kalo ada issue, microsoft akan comment di PR. WinGet bot team biasanya fast-respond.

## Test Release

Dry-run dulu:
```powershell
.\Scripts\release-version.ps1 -NewVersion X.X.X -DryRun

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The parameter name in Scripts/release-version.ps1 is -Version, not -NewVersion.

Suggested change
.\Scripts\release-version.ps1 -NewVersion X.X.X -DryRun
.\Scripts\release-version.ps1 -Version X.X.X -DryRun

```

Kalo OK, jalankan beneran:
```powershell
.\Scripts\release-version.ps1 -NewVersion X.X.X

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The parameter name in Scripts/release-version.ps1 is -Version, not -NewVersion.

Suggested change
.\Scripts\release-version.ps1 -NewVersion X.X.X
.\Scripts\release-version.ps1 -Version X.X.X

```

Terus monitor di Actions → kelilingi workflow runner sampai winget-releaser submit PR.
Loading