Files
VERSE 87b91c45d7 feat: update changelog (#131)
closes #130 

- CHANGELOG.md file for people who can view changelog from github
---
`iris changelog` command:
`iris changelog [version]` (e.g. iris changelog v0.5.1)
`iris changelog -n 3` (see changelog of 3 latest releaseas)

=> `iris changelog` looks just like CHANGELOG.md, grouped headers and
all. It only stops looking that way if we personally overwrite that
release's description with something else
=> With 1-hour local cache (invalidated on updater-channel change),
`--refresh` flag to bypass, graceful fallback to stale cache on GitHub
rate-limiting

---
- New auto update config
```toml
# 0 = off (default, notify only), 1 = auto-install, 2 = always confirm first
auto-update = 1
```

- New just debug-changelog and just debug-autoupdate recipes (fully
offline, mocked HTTP servers, no real network/config touched)
2026-08-07 17:16:18 +07:00

95 lines
2.9 KiB
YAML

name: Nightly
on:
push:
branches:
- main
workflow_dispatch:
permissions:
contents: write
jobs:
nightly:
name: Nightly Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # needed for git describe
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.24.x'
cache: true
- name: Get version info
id: version
run: |
BASE=$(git describe --tags --abbrev=0 --exclude="*-nightly*" 2>/dev/null || echo "v0.0.0")
VERSION_NUM=${BASE#v}
IFS='.' read -r major minor patch <<< "$VERSION_NUM"
patch=$((patch + 1))
NEXT_BASE="v${major}.${minor}.${patch}"
SHORT=$(git rev-parse --short=6 HEAD)
echo "version=${NEXT_BASE}-nightly.${SHORT}" >> $GITHUB_OUTPUT
echo "short_sha=${SHORT}" >> $GITHUB_OUTPUT
echo "subject=$(git log -1 --format=%s)" >> $GITHUB_OUTPUT
- name: Build Binaries
run: |
mkdir -p dist
platforms=("linux/amd64" "linux/arm64" "darwin/amd64" "darwin/arm64")
for platform in "${platforms[@]}"; do
os_arch=(${platform//\// })
GOOS=${os_arch[0]}
GOARCH=${os_arch[1]}
GOOS=$GOOS GOARCH=$GOARCH go build \
-ldflags="-s -w -X github.com/versenilvis/iris/root.Version=${{ steps.version.outputs.version }}" \
-trimpath -o "dist/iris" ./cmd/iris
cd dist
tar -czf "iris_${GOOS}_${GOARCH}.tar.gz" "iris"
rm "iris"
cd ..
done
- name: Delete previous nightly releases
# each run tags as v<version>-nightly.<sha>, a different name every
# time, so leftover nightly tags pile up and skew goreleaser's
# previous-tag detection for the next stable changelog
run: |
for tag in $(git tag --list "v*-nightly.*"); do
gh release delete "$tag" --yes --cleanup-tag 2>/dev/null || true
done
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create Nightly Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.version.outputs.version }}
name: ${{ steps.version.outputs.version }}
# shaped like GoReleaser's changelog groups so `iris changelog` renders it
body: |
# 🌙 **Nightly build** - `${{ steps.version.outputs.version }}`
### Nightly
* ${{ steps.version.outputs.short_sha }} ${{ steps.version.outputs.subject }}
## Update
```bash
iris update
```
> install manually, this build will **not** trigger an update notification
files: dist/*.tar.gz
prerelease: true
generate_release_notes: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}