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)
92 lines
3.1 KiB
YAML
92 lines
3.1 KiB
YAML
name: Release
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
tags:
|
|
- "v*"
|
|
pull_request:
|
|
branches: ["**"]
|
|
workflow_dispatch:
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
quality-and-release:
|
|
name: Quality & Release
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Setup Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: "1.24"
|
|
cache: true
|
|
|
|
- name: Tidy
|
|
run: go mod tidy
|
|
|
|
- name: Run Linter
|
|
uses: golangci/golangci-lint-action@v8
|
|
with:
|
|
version: v2.11.4
|
|
|
|
- name: Run Tests
|
|
run: go test -v ./...
|
|
|
|
- name: Create vendor tarball
|
|
if: startsWith(github.ref, 'refs/tags/v')
|
|
run: |
|
|
go mod vendor
|
|
tar -czf iris-${GITHUB_REF_NAME#v}-vendor.tar.gz vendor/
|
|
sha256sum iris-${GITHUB_REF_NAME#v}-vendor.tar.gz > iris-${GITHUB_REF_NAME#v}-vendor.tar.gz.sha256
|
|
|
|
- name: Run GoReleaser
|
|
if: startsWith(github.ref, 'refs/tags/v')
|
|
uses: goreleaser/goreleaser-action@v6
|
|
with:
|
|
distribution: goreleaser
|
|
version: latest
|
|
args: release --clean
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
AUR_KEY: ${{ secrets.AUR_KEY }}
|
|
HOMEBREW_TAP_GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }}
|
|
|
|
# nightly tags also match refs/tags/v*, so they're excluded below
|
|
- name: Generate CHANGELOG.md
|
|
if: startsWith(github.ref, 'refs/tags/v') && !contains(github.ref, '-nightly.')
|
|
uses: orhun/git-cliff-action@v4
|
|
with:
|
|
config: cliff.toml
|
|
args: --tag ${{ github.ref_name }} --output /tmp/CHANGELOG.md
|
|
|
|
- name: Commit CHANGELOG.md
|
|
if: startsWith(github.ref, 'refs/tags/v') && !contains(github.ref, '-nightly.')
|
|
run: |
|
|
# avoids a fast-forward race against the tag's detached HEAD
|
|
git fetch origin main
|
|
git checkout -B main origin/main
|
|
cp /tmp/CHANGELOG.md CHANGELOG.md
|
|
|
|
git config user.name "github-actions[bot]"
|
|
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
git add CHANGELOG.md
|
|
if git diff --cached --quiet; then
|
|
echo "CHANGELOG.md unchanged, nothing to commit"
|
|
else
|
|
# [skip ci] avoids retriggering nightly.yml for a docs-only push
|
|
git commit -m "docs(changelog): update for ${GITHUB_REF_NAME} [skip ci]"
|
|
git push origin main
|
|
fi
|