diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 41cdbd0..cec81f5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,11 +13,11 @@ jobs: name: ui (build + test + budget) runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - - uses: actions/setup-node@v4 + - uses: actions/setup-node@v6 with: - node-version: '20' + node-version: '22' cache: 'npm' cache-dependency-path: ui/package-lock.json @@ -46,7 +46,7 @@ jobs: fi - name: Upload ui/dist - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: ui-dist path: ui/dist @@ -64,18 +64,18 @@ jobs: env: CGO_ENABLED: "1" steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - - uses: actions/setup-go@v5 + - uses: actions/setup-go@v6 with: - go-version: '1.22' + go-version-file: go.mod - name: Assert C toolchain (macOS) if: runner.os == 'macOS' run: clang --version - name: Go build cache - uses: actions/cache@v4 + uses: actions/cache@v5 with: path: | ~/.cache/go-build @@ -88,7 +88,7 @@ jobs: # Hydrate ui/dist with the build artifact produced by the `ui` job so # the //go:embed ui/dist directive has real assets to embed. - name: Download ui/dist - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v8 with: name: ui-dist path: ui/dist @@ -103,7 +103,7 @@ jobs: run: CGO_ENABLED=1 go build -tags sqlite_fts5 -o docsiq ./ - name: Upload docsiq binary - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: docsiq-${{ matrix.os }} path: docsiq @@ -115,14 +115,14 @@ jobs: needs: ui runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - - uses: actions/setup-go@v5 + - uses: actions/setup-go@v6 with: - go-version: '1.22' + go-version-file: go.mod - name: cache go build - uses: actions/cache@v4 + uses: actions/cache@v5 with: path: | ~/.cache/go-build @@ -130,7 +130,7 @@ jobs: key: go-integ-${{ hashFiles('go.sum') }} - name: Download ui/dist - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v8 with: name: ui-dist path: ui/dist diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..986a928 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,53 @@ +name: release + +# Auto-cuts a beta prerelease on every main push. +# Tag pushes are ignored so the workflow doesn't recurse. +on: + push: + branches: [main] + +permissions: + contents: write + +concurrency: + group: release-main + cancel-in-progress: false + +jobs: + release: + name: auto-tag + release + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + with: + fetch-depth: 0 + + - name: Compute next beta tag + id: ver + run: | + latest=$(git tag -l 'v0.0.0-beta.*' \ + | grep -E 'v0\.0\.0-beta\.[0-9]+$' \ + | sort -V \ + | tail -1) + if [ -z "$latest" ]; then + next="v0.0.0-beta.1" + else + n=${latest##*.} + next="v0.0.0-beta.$((n+1))" + fi + echo "tag=$next" >> "$GITHUB_OUTPUT" + echo "Next tag: $next" + + - name: Create tag + release + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + set -eu + tag="${{ steps.ver.outputs.tag }}" + git tag "$tag" + git push origin "$tag" + gh release create "$tag" \ + --target "${{ github.sha }}" \ + --prerelease \ + --generate-notes \ + --title "$tag" diff --git a/README.md b/README.md index ca781e5..2769bcc 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Security Scan](https://github.com/RandomCodeSpace/docsiq/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/RandomCodeSpace/docsiq/actions/workflows/ci.yml) [![OpenSSF Score](https://api.scorecard.dev/projects/github.com/RandomCodeSpace/docsiq/badge)](https://scorecard.dev/viewer/?uri=github.com/RandomCodeSpace/docsiq) -[![Release](https://img.shields.io/github/v/release/RandomCodeSpace/docsiq)](https://github.com/RandomCodeSpace/docsiq/releases) +[![Release](https://img.shields.io/github/v/release/RandomCodeSpace/docsiq?include_prereleases&sort=semver)](https://github.com/RandomCodeSpace/docsiq/releases) [![Go Version](https://img.shields.io/github/go-mod/go-version/RandomCodeSpace/docsiq)](https://github.com/RandomCodeSpace/docsiq/blob/main/go.mod) docsiq is a GraphRAG-powered knowledge base that runs as a single Go binary.