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'
This commit is contained in:
1 parent
ffc412863a
commit
ae2569a795
3 files changed
+96
-3
No files matched your search
@@ -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 ./...
|
||||||
@@ -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|<user>|<repo>|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
|
||||||
@@ -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.
|
*Check for Updates* in the footer runs the same flow manually.
|
||||||
|
|
||||||
**Publishing a release** so updates reach users: tag it `vX.Y.Z`, upload
|
**Publishing a release** is just a tag — GitHub Actions builds and uploads
|
||||||
`lazyrun-X.Y.Z-x86_64.AppImage` plus the `.zsync` file produced by `build.sh` as
|
everything (`.github/workflows/release.yml`):
|
||||||
release assets, and mark it as the latest release.
|
|
||||||
|
```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
|
## Build
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user