From 9de8b5f1f92a3be2543f121eb91c50eed2695103 Mon Sep 17 00:00:00 2001 From: skudasov Date: Wed, 11 Sep 2024 16:35:55 +0200 Subject: [PATCH] another test release, build with default command --- .github/workflows/release.yml | 46 +++++++++++-------- ...peline.md => v0.1.0-test-release-alpha.md} | 0 2 files changed, 27 insertions(+), 19 deletions(-) rename k8s-test-runner/.changeset/{v0.1.0-test-release-pipeline.md => v0.1.0-test-release-alpha.md} (100%) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 60a5c0b0f..8c4840bad 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -70,7 +70,25 @@ jobs: echo "RELEASE_NOTES<> $GITHUB_ENV echo "$COMMITS" >> $GITHUB_ENV echo "EOF" >> $GITHUB_ENV + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: '1.22.6' + - name: Install gorelease tool + run: | + go install golang.org/x/exp/cmd/gorelease@latest + - name: Run gorelease to check for breaking changes + working-directory: tools/breakingchanges + id: check_breaking_changes + run: | + set +e # Disable exit on error to capture output even if the command fails + OUTPUT=$(go run cmd/main.go -path $GITHUB_WORKSPACE/${{ env.PACKAGE_NAME }} 2>&1) + set -e # Re-enable exit on error for the subsequent steps + echo "FULL_RELEASE_NOTES<> $GITHUB_ENV + echo "$OUTPUT" >> $GITHUB_ENV + echo "EOF" >> $GITHUB_ENV - name: Read Additional Release Notes from File + if: always() working-directory: ${{ env.PACKAGE_NAME }} id: read_additional_notes run: | @@ -89,19 +107,8 @@ jobs: echo "Error: Release notes file '.changeset/${{ env.VERSION }}.md' not found." exit 1 fi - - name: Set up Go - uses: actions/setup-go@v5 - with: - go-version: '1.22.6' - - name: Install gorelease tool - run: | - go install golang.org/x/exp/cmd/gorelease@latest - - name: Run gorelease to check for breaking changes - working-directory: tools/breakingchanges - id: check_breaking_changes - run: | - go run cmd/main.go -path $GITHUB_WORKSPACE/${{ env.PACKAGE_NAME }} - name: Create GitHub Release + if: always() env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | @@ -109,15 +116,16 @@ jobs: gh release create "${{ env.PACKAGE_NAME }}-${{ env.VERSION }}" --title "${{ env.PACKAGE_NAME }} ${{ env.VERSION }}" --notes "Release for ${{ env.PACKAGE_NAME }} version ${{ env.VERSION }}${{ env.FULL_RELEASE_NOTES }} ${{ env.BREAKING_CHANGES }}" || true - name: Check if 'cmd' directory exists and set environment variable run: | - if [ -d "$GITHUB_WORKSPACE/${{ env.PACKAGE_NAME }}/cmd" ] && [ -f "$GITHUB_WORKSPACE/${{ env.PACKAGE_NAME }}/cmd/main.go" ]; then - echo "CMD_EXISTS=true" >> $GITHUB_ENV + if [ -f "$GITHUB_WORKSPACE/${{ env.PACKAGE_NAME }}/cmd/main.go" ]; then + echo "CMD_ENTRYPOINT_EXISTS=true" >> $GITHUB_ENV else - echo "CMD_EXISTS=false" >> $GITHUB_ENV + echo "CMD_ENTRYPOINT_EXISTS=false" >> $GITHUB_ENV fi - - uses: wangyoucao577/go-release-action@v1 - if: env.CMD_EXISTS == 'true' + - name: Build binary release + uses: wangyoucao577/go-release-action@v1 + if: env.CMD_ENTRYPOINT_EXISTS == 'true' with: - build_command: go build cmd/main.go + build_command: go build -o ${{ env.PACKAGE_NAME }}/main.go github_token: ${{ secrets.GITHUB_TOKEN }} goversion: '1.22.6' goos: ${{ matrix.platform }} @@ -125,4 +133,4 @@ jobs: release_name: ${{ env.PACKAGE_NAME }} release_tag: ${{ env.PACKAGE_NAME}}-${{ env.VERSION }} project_path: ${{ env.PACKAGE_NAME }} - asset_name: ${{ env.PACKAGE_NAME }}-${{ env.VERSION }}-${{ matrix.platform }}-${{ matrix.goarch }} \ No newline at end of file + asset_name: ${{ env.PACKAGE_NAME }}-${{ env.VERSION }}-${{ matrix.platform }}-${{ matrix.goarch }} diff --git a/k8s-test-runner/.changeset/v0.1.0-test-release-pipeline.md b/k8s-test-runner/.changeset/v0.1.0-test-release-alpha.md similarity index 100% rename from k8s-test-runner/.changeset/v0.1.0-test-release-pipeline.md rename to k8s-test-runner/.changeset/v0.1.0-test-release-alpha.md