Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .github/workflows/pr-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: PR Check

on:
pull_request:
branches:
- main

permissions:
contents: read

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-go@v5
with:
go-version-file: go.mod

- name: Run tests
run: go test -v ./...

lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-go@v5
with:
go-version-file: go.mod

- name: Check formatting
run: |
unformatted="$(gofmt -s -l .)"
if [ -n "$unformatted" ]; then
echo "Files need formatting (run gofmt -s -w .):"
echo "$unformatted"
exit 1
fi

- name: Run golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: latest
Comment thread
Darth-Weider marked this conversation as resolved.
85 changes: 85 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
on:
push:
branches:
- main

permissions:
contents: write
pull-requests: write

Comment on lines +6 to +9

Copilot AI Apr 15, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Workflow-level permissions grant pull-requests: write to all jobs, including build/upload steps that don't need it. To follow least-privilege, consider moving pull-requests: write to just the release-please job and scoping other jobs to contents: read (build) and contents: write (asset upload) as needed.

Copilot uses AI. Check for mistakes.
name: release-please

jobs:
release-please:
runs-on: ubuntu-latest
outputs:
release_created: ${{ steps.release.outputs.release_created }}
tag_name: ${{ steps.release.outputs.tag_name }}
version: ${{ steps.release.outputs.version }}
steps:
- uses: googleapis/release-please-action@v4
id: release
with:
release-type: simple

Copilot AI Apr 15, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This workflow appears to be using Release Please "manifest" mode (new release-please-config.json + .release-please-manifest.json). In that mode, passing release-type: simple here is redundant and can be confusing (and may override/ignore package config depending on action behavior). Consider removing release-type and explicitly setting config-file/manifest-file, or drop the config/manifest files and use single-package inputs only.

Suggested change
release-type: simple
config-file: release-please-config.json
manifest-file: .release-please-manifest.json

Copilot uses AI. Check for mistakes.

build:
needs: release-please
if: ${{ needs.release-please.outputs.release_created == 'true' }}
runs-on: ubuntu-latest
Comment thread
Darth-Weider marked this conversation as resolved.
strategy:
matrix:
goos: [darwin, linux, windows]
goarch: [amd64, arm64]
steps:
- uses: actions/checkout@v4

- uses: actions/setup-go@v5
with:
go-version-file: go.mod

- name: Build binary
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
CGO_ENABLED: "0"
run: |
binary_name="redyl-${{ needs.release-please.outputs.version }}-${{ matrix.goos }}-${{ matrix.goarch }}"
Comment thread
Darth-Weider marked this conversation as resolved.
Comment thread
Darth-Weider marked this conversation as resolved.
mkdir -p bin
if [ "$GOOS" = "windows" ]; then
go build \
-ldflags "-X github.com/pbs/redyl/internal/redyl/version.Version=${{ needs.release-please.outputs.version }}" \
-o "bin/${binary_name}.exe" .
zip -j "bin/${binary_name}.zip" "bin/${binary_name}.exe"
rm "bin/${binary_name}.exe"
else
go build \
-ldflags "-X github.com/pbs/redyl/internal/redyl/version.Version=${{ needs.release-please.outputs.version }}" \
Comment on lines +50 to +56

Copilot AI Apr 15, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

go build -ldflags "-X ...version.Version=..." will fail with the current code because internal/redyl/version.Version is declared as a const (linker -X can only set string variables). Change the version symbol to a var (e.g., defaulting to "dev") or remove the -X injection and update versioning another way.

Suggested change
-ldflags "-X github.com/pbs/redyl/internal/redyl/version.Version=${{ needs.release-please.outputs.version }}" \
-o "bin/${binary_name}.exe" .
zip -j "bin/${binary_name}.zip" "bin/${binary_name}.exe"
rm "bin/${binary_name}.exe"
else
go build \
-ldflags "-X github.com/pbs/redyl/internal/redyl/version.Version=${{ needs.release-please.outputs.version }}" \
-o "bin/${binary_name}.exe" .
zip -j "bin/${binary_name}.zip" "bin/${binary_name}.exe"
rm "bin/${binary_name}.exe"
else
go build \

Copilot uses AI. Check for mistakes.
Comment on lines +50 to +56

Copilot AI Apr 15, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same issue as the Windows branch: linker -X cannot set a const. With internal/redyl/version.Version currently a constant, this build command will fail; switch it to a var or stop using -X to set it.

Suggested change
-ldflags "-X github.com/pbs/redyl/internal/redyl/version.Version=${{ needs.release-please.outputs.version }}" \
-o "bin/${binary_name}.exe" .
zip -j "bin/${binary_name}.zip" "bin/${binary_name}.exe"
rm "bin/${binary_name}.exe"
else
go build \
-ldflags "-X github.com/pbs/redyl/internal/redyl/version.Version=${{ needs.release-please.outputs.version }}" \
-o "bin/${binary_name}.exe" .
zip -j "bin/${binary_name}.zip" "bin/${binary_name}.exe"
rm "bin/${binary_name}.exe"
else
go build \

Copilot uses AI. Check for mistakes.
-o "bin/${binary_name}" .
fi

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: redyl-${{ matrix.goos }}-${{ matrix.goarch }}
path: bin/
Comment thread
Darth-Weider marked this conversation as resolved.

upload-assets:
needs: [release-please, build]
if: ${{ needs.release-please.outputs.release_created == 'true' }}
runs-on: ubuntu-latest
Comment thread
Darth-Weider marked this conversation as resolved.
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: bin/
merge-multiple: true

- name: Upload release assets
env:
GH_TOKEN: ${{ github.token }}
run: |
for file in bin/*; do
gh release upload "${{ needs.release-please.outputs.tag_name }}" "$file" \
--repo "${{ github.repository }}" \
--clobber
done
3 changes: 3 additions & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
".": "1.1.0"
}
8 changes: 8 additions & 0 deletions release-please-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"packages": {
".": {
"release-type": "simple",
"include-v-in-tag": true
}
}
}
Loading