From ca2577bad1708c5f5de342014f255c7efb33c12a Mon Sep 17 00:00:00 2001 From: yuua Date: Wed, 2 Apr 2025 18:58:33 +0900 Subject: [PATCH 1/5] chore: debug filename --- .github/workflows/build.yml | 1 + .github/workflows/release.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ae2c6d2..0450d84 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -45,6 +45,7 @@ jobs: run: | echo "BINARY_NAME=$(cut -d "-" -f 1 <<< "${{ matrix.os }}")" >> $GITHUB_ENV go build -o ntp-cli-${BINARY_NAME}-v${{ env.VERSION }} + ls - name: upload the artifact uses: actions/upload-artifact@v4 with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 814a180..e5c1141 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -46,6 +46,7 @@ jobs: run: | echo "BINARY_NAME=$(cut -d "-" -f 1 <<< "${{ matrix.os }}")" >> $GITHUB_ENV go build -o ntp-cli-${BINARY_NAME}-v${{ env.VERSION }} + ls - name: upload the artifact uses: actions/upload-artifact@v4 with: From 0127b693149a9703b4149844c0603623dbaa7b00 Mon Sep 17 00:00:00 2001 From: yuua Date: Wed, 2 Apr 2025 19:02:22 +0900 Subject: [PATCH 2/5] fix: set both env and GITHUB_ENV --- .github/workflows/build.yml | 3 ++- .github/workflows/release.yml | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0450d84..07f2819 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -43,7 +43,8 @@ jobs: go-version-file: ./go.mod - name: build run: | - echo "BINARY_NAME=$(cut -d "-" -f 1 <<< "${{ matrix.os }}")" >> $GITHUB_ENV + BINARY_NAME=$(cut -d "-" -f 1 <<< "${{ matrix.os }}") + echo "BINARY_NAME=${BINARY_NAME}" >> $GITHUB_ENV go build -o ntp-cli-${BINARY_NAME}-v${{ env.VERSION }} ls - name: upload the artifact diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e5c1141..9da85ba 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -44,7 +44,8 @@ jobs: go-version-file: ./go.mod - name: build run: | - echo "BINARY_NAME=$(cut -d "-" -f 1 <<< "${{ matrix.os }}")" >> $GITHUB_ENV + BINARY_NAME=$(cut -d "-" -f 1 <<< "${{ matrix.os }}") + echo "BINARY_NAME=${BINARY_NAME}" >> $GITHUB_ENV go build -o ntp-cli-${BINARY_NAME}-v${{ env.VERSION }} ls - name: upload the artifact From d00e736bca88cc9deab362ab5a1edddf407ec333 Mon Sep 17 00:00:00 2001 From: yuua Date: Wed, 2 Apr 2025 19:53:28 +0900 Subject: [PATCH 3/5] fix: binary name for windows --- .github/workflows/build.yml | 14 ++++++++++---- .github/workflows/release.yml | 14 ++++++++++---- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 07f2819..216fc87 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -42,14 +42,20 @@ jobs: with: go-version-file: ./go.mod - name: build + if: ${{ matrix.os != 'windows-latest' }} run: | - BINARY_NAME=$(cut -d "-" -f 1 <<< "${{ matrix.os }}") - echo "BINARY_NAME=${BINARY_NAME}" >> $GITHUB_ENV - go build -o ntp-cli-${BINARY_NAME}-v${{ env.VERSION }} + PLATFORM=$(cut -d "-" -f 1 <<< "${{ matrix.os }}") + echo "PLATFORM=${PLATFORM}" >> $GITHUB_ENV + go build -o ntp-cli-${PLATFORM}-v${{ env.VERSION }} ls + - name: build for windows + if: ${{ matrix.os == 'windows-latest' }} + run: | + echo "PLATFORM=windows" >> $env:GITHUB_ENV + go build -o ntp-cli-windows-v${{ env.VERSION }} - name: upload the artifact uses: actions/upload-artifact@v4 with: name: ntp-cli ${{ env.VERSION }} for ${{ matrix.os }} - path: ./ntp-cli-${{ env.BINARY_NAME }}-v${{ env.VERSION }} + path: ./ntp-cli-${{ env.PLATFORM }}-v${{ env.VERSION }} overwrite: true diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9da85ba..15a5c44 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -43,16 +43,22 @@ jobs: with: go-version-file: ./go.mod - name: build + if: ${{ matrix.os != 'windows-latest' }} run: | - BINARY_NAME=$(cut -d "-" -f 1 <<< "${{ matrix.os }}") - echo "BINARY_NAME=${BINARY_NAME}" >> $GITHUB_ENV - go build -o ntp-cli-${BINARY_NAME}-v${{ env.VERSION }} + PLATFORM=$(cut -d "-" -f 1 <<< "${{ matrix.os }}") + echo "PLATFORM=${PLATFORM}" >> $GITHUB_ENV + go build -o ntp-cli-${PLATFORM}-v${{ env.VERSION }} ls + - name: build for windows + if: ${{ matrix.os == 'windows-latest' }} + run: | + echo "PLATFORM=windows" >> $env:GITHUB_ENV + go build -o ntp-cli-windows-v${{ env.VERSION }} - name: upload the artifact uses: actions/upload-artifact@v4 with: name: ntp-cli ${{ env.VERSION }} for ${{ matrix.os }} - path: ./ntp-cli-${{ env.BINARY_NAME }}-v${{ env.VERSION }} + path: ./ntp-cli-${{ env.PLATFORM }}-v${{ env.VERSION }} overwrite: true release: From 15e009225589bea36af164b8ce70d6d89a9fe3b6 Mon Sep 17 00:00:00 2001 From: yuua Date: Wed, 2 Apr 2025 19:56:56 +0900 Subject: [PATCH 4/5] ci: artifact name for preview build --- .github/workflows/build.yml | 8 ++++---- .github/workflows/release.yml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 216fc87..44417aa 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -46,16 +46,16 @@ jobs: run: | PLATFORM=$(cut -d "-" -f 1 <<< "${{ matrix.os }}") echo "PLATFORM=${PLATFORM}" >> $GITHUB_ENV - go build -o ntp-cli-${PLATFORM}-v${{ env.VERSION }} + go build -o ntp-cli-${PLATFORM}-v${{ env.VERSION }}-preview ls - name: build for windows if: ${{ matrix.os == 'windows-latest' }} run: | echo "PLATFORM=windows" >> $env:GITHUB_ENV - go build -o ntp-cli-windows-v${{ env.VERSION }} + go build -o ntp-cli-windows-v${{ env.VERSION }}-preview - name: upload the artifact uses: actions/upload-artifact@v4 with: - name: ntp-cli ${{ env.VERSION }} for ${{ matrix.os }} - path: ./ntp-cli-${{ env.PLATFORM }}-v${{ env.VERSION }} + name: ntp-cli v${{ env.VERSION }} for ${{ matrix.os }} + path: ./ntp-cli-${{ env.PLATFORM }}-v${{ env.VERSION }}-preview overwrite: true diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 15a5c44..07347fd 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -57,7 +57,7 @@ jobs: - name: upload the artifact uses: actions/upload-artifact@v4 with: - name: ntp-cli ${{ env.VERSION }} for ${{ matrix.os }} + name: ntp-cli v${{ env.VERSION }} for ${{ matrix.os }} path: ./ntp-cli-${{ env.PLATFORM }}-v${{ env.VERSION }} overwrite: true From ad650e3a53b1f2af831460b220f3601d6a83dcde Mon Sep 17 00:00:00 2001 From: yuua Date: Wed, 2 Apr 2025 20:00:14 +0900 Subject: [PATCH 5/5] ci: artifact title for preview build --- .github/workflows/build.yml | 2 +- .github/workflows/release.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 44417aa..434191d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -56,6 +56,6 @@ jobs: - name: upload the artifact uses: actions/upload-artifact@v4 with: - name: ntp-cli v${{ env.VERSION }} for ${{ matrix.os }} + name: ntp-cli v${{ env.VERSION }} preview for ${{ env.PLATFORM }} path: ./ntp-cli-${{ env.PLATFORM }}-v${{ env.VERSION }}-preview overwrite: true diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 07347fd..03752ea 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -57,7 +57,7 @@ jobs: - name: upload the artifact uses: actions/upload-artifact@v4 with: - name: ntp-cli v${{ env.VERSION }} for ${{ matrix.os }} + name: ntp-cli v${{ env.VERSION }} for ${{ env.PLATFORM }} path: ./ntp-cli-${{ env.PLATFORM }}-v${{ env.VERSION }} overwrite: true