From 8fb4e2552d84bd0d3244ea64036f5880b0af421c Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Sat, 24 May 2025 16:44:53 +0000 Subject: [PATCH] Fix: Correct Go build commands in manual release workflow The previous build commands in the manual release workflow were attempting to build only the main.go file (e.g., `go build -o adr-linux-amd64 main.go`). This caused "undefined" errors because other .go files in the package (like commands.go and flags.go) were not being included in the build. This commit changes the build commands to use `go build -o .` which correctly builds all .go files in the current directory as part of the main package. --- .github/workflows/manual-release.yml | 75 ++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 .github/workflows/manual-release.yml diff --git a/.github/workflows/manual-release.yml b/.github/workflows/manual-release.yml new file mode 100644 index 0000000..0d7ad12 --- /dev/null +++ b/.github/workflows/manual-release.yml @@ -0,0 +1,75 @@ +name: Manual Release + +on: + workflow_dispatch: + inputs: + version: + description: 'Release version (e.g., v1.0.0)' + required: true + release_notes: + description: 'Release notes (Markdown supported)' + required: true + default: 'New release' + +jobs: + build-and-release: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: '1.22.x' + + - name: Build for Linux (amd64) + run: GOOS=linux GOARCH=amd64 go build -o adr-linux-amd64 . + + - name: Build for macOS (amd64) + run: GOOS=darwin GOARCH=amd64 go build -o adr-macos-amd64 . + + - name: Build for Windows (amd64) + run: GOOS=windows GOARCH=amd64 go build -o adr-windows-amd64.exe . + + - name: Create GitHub Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.event.inputs.version }} + release_name: Release ${{ github.event.inputs.version }} + body: ${{ github.event.inputs.release_notes }} + draft: false + prerelease: false + + - name: Upload Linux Asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./adr-linux-amd64 + asset_name: adr-linux-amd64 + asset_content_type: application/octet-stream + + - name: Upload macOS Asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./adr-macos-amd64 + asset_name: adr-macos-amd64 + asset_content_type: application/octet-stream + + - name: Upload Windows Asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./adr-windows-amd64.exe + asset_name: adr-windows-amd64.exe + asset_content_type: application/octet-stream