From c587222add2121ef6cc9c6539816a93b8baf6271 Mon Sep 17 00:00:00 2001 From: Samgu Lee Date: Sun, 27 Sep 2026 22:34:54 +0900 Subject: [PATCH] chore: update workflows and dependencies --- .github/workflows/auto-assign.yml | 19 ------ .github/workflows/ci.yml | 6 +- .github/workflows/release.yml | 26 ++++++-- .github/workflows/update-changelog.yml | 86 ++++++++++++++++++++++++++ .goreleaser.yml | 32 +++++----- CHANGELOG.md | 29 +++++++++ Makefile | 6 ++ README.md | 27 ++++---- 8 files changed, 177 insertions(+), 54 deletions(-) delete mode 100644 .github/workflows/auto-assign.yml create mode 100644 .github/workflows/update-changelog.yml create mode 100644 CHANGELOG.md diff --git a/.github/workflows/auto-assign.yml b/.github/workflows/auto-assign.yml deleted file mode 100644 index c24974d..0000000 --- a/.github/workflows/auto-assign.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: Auto Assign -on: - issues: - types: [opened] - pull_request: - types: [opened] -jobs: - run: - runs-on: ubuntu-latest - permissions: - issues: write - pull-requests: write - steps: - - name: "Auto-assign issue" - uses: pozil/auto-assign-issue@v4 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - assignees: cable8mm - numOfAssignee: 1 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d1f0804..ea4c8be 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,10 +14,10 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v5 + uses: actions/checkout@v7 - name: Setup Go - uses: actions/setup-go@v6 + uses: actions/setup-go@v7 with: go-version-file: go.mod cache: true @@ -28,4 +28,4 @@ jobs: - name: GolangCI-Lint uses: golangci/golangci-lint-action@v9 with: - version: v2.2.1 + version: v2.14.0 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 00676d3..682f66c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,7 +4,10 @@ on: push: tags: - "v*" - + workflow_dispatch: + inputs: + tag: + required: true jobs: goreleaser: runs-on: ubuntu-latest @@ -13,15 +16,28 @@ jobs: contents: write steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v7 + with: + ref: ${{ inputs.tag || github.ref }} + fetch-depth: 0 - - uses: actions/setup-go@v6 + - uses: actions/setup-go@v7 with: - go-version: stable + go-version-file: go.mod + + - name: Check formatting + run: test -z "$(gofmt -l $(find . -name '*.go' -not -path './docs/*'))" + + - name: Vet + run: go vet ./... + + - name: Test + run: go test ./... - uses: goreleaser/goreleaser-action@v7 with: version: latest args: release --clean env: - GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + HOMEBREW_TAP_GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }} diff --git a/.github/workflows/update-changelog.yml b/.github/workflows/update-changelog.yml new file mode 100644 index 0000000..46a77a0 --- /dev/null +++ b/.github/workflows/update-changelog.yml @@ -0,0 +1,86 @@ +name: update-changelog + +on: + release: + types: [published] + +jobs: + update: + runs-on: ubuntu-latest + + permissions: + # Give the default GITHUB_TOKEN write permission to commit and push the + # updated CHANGELOG back to the repository. + # https://github.blog/changelog/2023-02-02-github-actions-updating-the-default-github_token-permissions-to-read-only/ + contents: write + + steps: + - name: Checkout code + uses: actions/checkout@v7 + with: + # Fetch entire history of repository to ensure relase date can be + # extracted from commit of the given tag. + fetch-depth: 0 + # Checkout target branch of this release. Ensures that the CHANGELOG + # is not out of date. + ref: ${{ github.event.release.target_commitish }} + + - name: Check if branch and release match + if: ${{ github.event.release.target_commitish != 'main' && github.event.release.target_commitish != 'master' }} + id: guard + run: | + NUMERIC_VERSION="${RELEASE_TAG_NAME#v}" + MAJOR_VERSION="${NUMERIC_VERSION%%.*}" + BRANCH_MAJOR_VERSION="${BRANCH%%.*}" + + echo "MAJOR_VERSION=$(echo $MAJOR_VERSION)" >> $GITHUB_OUTPUT; + echo "BRANCH_MAJOR_VERSION=$(echo $BRANCH_MAJOR_VERSION)" >> $GITHUB_OUTPUT; + + if [ "$MAJOR_VERSION" != "$BRANCH_MAJOR_VERSION" ]; then + echo "Mismatched versions! Aborting." + VERSION_MISMATCH='true'; + else + echo "Versions match! Proceeding." + VERSION_MISMATCH='false'; + fi + echo "VERSION_MISMATCH=$(echo $VERSION_MISMATCH)" >> $GITHUB_OUTPUT; + env: + BRANCH: ${{ github.event.release.target_commitish }} + RELEASE_TAG_NAME: ${{ github.event.release.tag_name }} + + - name: Fail if branch and release tag do not match + if: ${{ steps.guard.outputs.VERSION_MISMATCH == 'true' }} + uses: actions/github-script@v9 + with: + script: | + core.setFailed('Workflow failed. Release version does not match with selected target branch. Changelog not updated automatically.') + + - name: Extract release date from git tag + id: release_date + run: | + # Get UNIX timestamp from git-tag + TIMESTAMP_OF_RELEASE_COMMIT=$(git log -1 --date=unix --format=%ad '${{ github.event.release.tag_name }}'); + + # Convert timestamp to UTC date in Y-m-d format + FORMATED_DATE=$(date -u -d @$TIMESTAMP_OF_RELEASE_COMMIT +%Y-%m-%d) + + # Make date available to other steps + echo "date=$(echo $FORMATED_DATE)" >> $GITHUB_OUTPUT; + + - name: Update Changelog + uses: stefanzweifel/changelog-updater-action@v1 + with: + # Pass extracted release date, release notes and version to the Action. + release-date: ${{ steps.release_date.outputs.date }} + release-notes: ${{ github.event.release.body }} + latest-version: ${{ github.event.release.tag_name }} + compare-url-target-revision: ${{ github.event.release.target_commitish }} + parse-github-usernames: true + + - name: Commit updated CHANGELOG + uses: stefanzweifel/git-auto-commit-action@v7 + with: + # Push updated CHANGELOG to release target branch. + branch: ${{ github.event.release.target_commitish }} + commit_message: Update CHANGELOG + file_pattern: CHANGELOG.md diff --git a/.goreleaser.yml b/.goreleaser.yml index 50351ab..988c8e1 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -3,9 +3,7 @@ version: 2 project_name: repl-cli builds: - - id: repl - main: ./cmd/repl - binary: repl + - main: ./cmd/repl env: - CGO_ENABLED=0 goos: @@ -15,6 +13,7 @@ builds: goarch: - amd64 - arm64 + binary: "{{ .ProjectName }}" ldflags: - -s -w - -X main.version={{.Version}} @@ -23,6 +22,9 @@ builds: archives: - formats: [tar.gz] + format_overrides: + - goos: windows + formats: [zip] name_template: >- {{ .ProjectName }}_ {{- .Version }}_ @@ -31,21 +33,21 @@ archives: files: - LICENSE - README.md - - AGENTS.md - - .repl/product.md - - .repl/framework.md - - .repl/architecture.md -brews: - - name: repl-cli - repository: +homebrew_casks: + - repository: owner: replworks name: homebrew-tap - homepage: "https://github.com/replworks/repl-cli" + token: "{{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }}" + + homepage: "https://github.com/replworks/{{ .ProjectName }}" description: "A deterministic runtime controller for external AI-driven task execution." - license: "MIT" - install: | - bin.install "repl" + hooks: + post: + install: | + if OS.mac? + system_command "/usr/bin/xattr", args: ["-dr", "com.apple.quarantine", "#{staged_path}/repl-cli"] + end checksum: name_template: "checksums.txt" @@ -64,5 +66,5 @@ release: github: owner: replworks name: repl-cli - draft: true + draft: false prerelease: auto diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..b00f2cf --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,29 @@ +# Release Notes + +## v0.1.2 - 2026-07-02 + +### What's Changed + +**Full Changelog**: https://github.com/replworks/repl-cli/compare/v0.1.1...v0.1.2 + +## v0.1.1 - 2026-07-02 + +### What's Changed + +* chore(deps): "Node 20 is being deprecated." by @cable8mm in https://github.com/replworks/repl-cli/pull/4 + +**Full Changelog**: https://github.com/replworks/repl-cli/compare/v0.1.0...v0.1.1 + +## v0.1.0 - 2026-07-02 + +### What's Changed + +* feat: create repl cli app by @cable8mm in https://github.com/replworks/repl-cli/pull/1 +* feat: add copy templates when running `init` command by @cable8mm in https://github.com/replworks/repl-cli/pull/2 +* feat: setup go release by @cable8mm in https://github.com/replworks/repl-cli/pull/3 + +### New Contributors + +* @cable8mm made their first contribution in https://github.com/replworks/repl-cli/pull/1 + +**Full Changelog**: https://github.com/replworks/repl-cli/commits/v0.1.0 \ No newline at end of file diff --git a/Makefile b/Makefile index b9d2f09..9aaaab7 100644 --- a/Makefile +++ b/Makefile @@ -25,3 +25,9 @@ check: fmt-check vet test build: go build -o repl ./cmd/repl + +release-check: ## validates .goreleaser.yaml without building anything + goreleaser check + +snapshot: ## builds all release targets locally without publishing, for pre-tag verification + goreleaser release --snapshot --clean diff --git a/README.md b/README.md index 9814972..2d23d53 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,11 @@ # REPL CLI 🚀 -[![Go Version](https://img.shields.io/badge/Go-%3E%3D1.24-blue)](https://go.dev/) -[![License](https://img.shields.io/badge/License-MIT-green)](LICENSE) -[![Build](https://img.shields.io/badge/build-passing-brightgreen)](https://github.com) +[![CI](https://github.com/replworks/repl-cli/actions/workflows/ci.yml/badge.svg)](https://github.com/replworks/repl-cli/actions/workflows/ci.yml) +[![release](https://github.com/replworks/repl-cli/actions/workflows/release.yml/badge.svg)](https://github.com/replworks/repl-cli/actions/workflows/release.yml) +[![update-changelog](https://github.com/replworks/repl-cli/actions/workflows/update-changelog.yml/badge.svg)](https://github.com/replworks/repl-cli/actions/workflows/update-changelog.yml) +[![Go Reference](https://pkg.go.dev/badge/github.com/replworks/repl-cli.svg)](https://pkg.go.dev/github.com/replworks/repl-cli) +[![Go Version](https://img.shields.io/github/go-mod/go-version/replworks/repl-cli)](https://github.com/replworks/repl-cli) +![License](https://img.shields.io/github/license/replworks/repl-cli) **A deterministic runtime controller for external AI-driven task execution** @@ -45,15 +48,15 @@ REPL CLI provides a **deterministic runtime controller** that: ### 🎯 Core Commands -| Command | Description | -|---------|-------------| -| `repl init` | Initialize REPL project runtime environment | -| `repl doctor` | Validate system integrity and configuration | -| `repl reset` | Reset runtime to clean initial state | -| `repl runtime start` | Start execution session for AI input | -| `repl runtime stop` | Stop execution session (no state mutation) | -| `repl runtime apply` | Apply AI execution results (via JSON stdin) | -| `repl runtime status` | Display current runtime state and progress | +| Command | Description | +| --------------------- | ------------------------------------------- | +| `repl init` | Initialize REPL project runtime environment | +| `repl doctor` | Validate system integrity and configuration | +| `repl reset` | Reset runtime to clean initial state | +| `repl runtime start` | Start execution session for AI input | +| `repl runtime stop` | Stop execution session (no state mutation) | +| `repl runtime apply` | Apply AI execution results (via JSON stdin) | +| `repl runtime status` | Display current runtime state and progress | ### 🔒 Key Principles