From ae2569a795cc927ca54b440ccc6ccb2b50df24e7 Mon Sep 17 00:00:00 2001 From: oxpoe Date: Tue, 13 Oct 2026 08:07:56 +0700 Subject: [PATCH] CI: workflow tes (push/PR) + rilis otomatis dari tag - .github/workflows/ci.yml: vet + go test -race di ubuntu-22.04 - .github/workflows/release.yml: tag vX.Y.Z -> tes, build AppImage dengan versi dari tag, lalu gh release create dengan aset AppImage + zsync dan catatan rilis otomatis (--generate-notes) - README: rilis cukup 'git tag v1.1.0 && git push --tags' --- .github/workflows/ci.yml | 31 +++++++++++++++++++++ .github/workflows/release.yml | 51 +++++++++++++++++++++++++++++++++++ README.md | 17 +++++++++--- 3 files changed, 96 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..13088ff --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,31 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + workflow_dispatch: + +jobs: + test: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + + # Fyne butuh header X11/OpenGL dan cgo untuk dikompilasi. + - name: Install build dependencies + run: | + sudo apt-get update + sudo apt-get install -y --no-install-recommends \ + libgl1-mesa-dev libx11-dev xorg-dev libxkbcommon-dev libwayland-dev + + - uses: actions/setup-go@v5 + with: + go-version-file: go.mod + cache: true + + - name: Vet + run: go vet ./... + + - name: Test + run: go test -race ./... diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..b269934 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,51 @@ +name: Release + +# Tinggal bikin tag: git tag v1.2.0 && git push --tags +# Versi AppImage diambil dari nama tag, jadi tidak perlu ubah file apa pun. +on: + push: + tags: ["v*"] + workflow_dispatch: + +permissions: + contents: write + +jobs: + release: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + + - name: Install build dependencies + run: | + sudo apt-get update + sudo apt-get install -y --no-install-recommends \ + libgl1-mesa-dev libx11-dev xorg-dev libxkbcommon-dev libwayland-dev + + - uses: actions/setup-go@v5 + with: + go-version-file: go.mod + cache: true + + - name: Test + run: go test ./... + + - name: Build AppImage + env: + # GH_USER/GH_REPO dipakai build.sh untuk menyisipkan info update zsync + # (gh-releases-zsync|||latest|lazyrun-*.AppImage.zsync) + GH_USER: ${{ github.repository_owner }} + GH_REPO: ${{ github.event.repository.name }} + run: | + VERSION="${GITHUB_REF_NAME#v}" ./build.sh + ls -lh dist/lazyrun-*.AppImage* + + - name: Create release + env: + GH_TOKEN: ${{ github.token }} + run: | + gh release create "$GITHUB_REF_NAME" \ + dist/lazyrun-*.AppImage \ + dist/lazyrun-*.AppImage.zsync \ + --title "LazyRun ${GITHUB_REF_NAME}" \ + --generate-notes diff --git a/README.md b/README.md index 177b735..2978f86 100644 --- a/README.md +++ b/README.md @@ -82,9 +82,20 @@ start (only when running as an AppImage) and offers to install it: *Check for Updates* in the footer runs the same flow manually. -**Publishing a release** so updates reach users: tag it `vX.Y.Z`, upload -`lazyrun-X.Y.Z-x86_64.AppImage` plus the `.zsync` file produced by `build.sh` as -release assets, and mark it as the latest release. +**Publishing a release** is just a tag — GitHub Actions builds and uploads +everything (`.github/workflows/release.yml`): + +```bash +git tag v1.1.0 && git push --tags +``` + +The workflow builds the AppImage with the version taken from the tag, runs the +tests, and publishes a release with the `.AppImage` + `.zsync` assets and +auto-generated notes. To build a release locally instead: + +```bash +VERSION=1.1.0 GH_USER=oxpoe GH_REPO=lazyrun ./build.sh +``` ## Build