From 0d853cf80371e850c403405f2787f2dbf114a864 Mon Sep 17 00:00:00 2001 From: Stephan Merker Date: Mon, 13 Jul 2026 11:15:17 +0200 Subject: [PATCH 1/2] Weekly patch release - creates a weekly patch release if there are changes - releases are still marked as draft release until everything works --- .github/workflows/release-cron.yml | 167 +++++++++++++++++++++++++++++ 1 file changed, 167 insertions(+) create mode 100644 .github/workflows/release-cron.yml diff --git a/.github/workflows/release-cron.yml b/.github/workflows/release-cron.yml new file mode 100644 index 0000000..32af0a7 --- /dev/null +++ b/.github/workflows/release-cron.yml @@ -0,0 +1,167 @@ +name: Release Cron + +on: + schedule: + - cron: '0 8 * * 1' # Every Monday at 08:00 UTC + workflow_dispatch: + +permissions: + contents: write + +jobs: + check: + name: Check for Changes + runs-on: ubuntu-latest + outputs: + should_release: ${{ steps.check.outputs.should_release }} + next_version: ${{ steps.check.outputs.next_version }} + steps: + - name: Checkout Into Source Code + uses: actions/checkout@v7 + with: + fetch-depth: 0 + + - name: Check diff and compute next version + id: check + run: | + LATEST_TAG=$(git tag --sort=-version:refname | head -1) + + if [ -z "$LATEST_TAG" ]; then + echo "No tags found, cannot determine next version" + exit 1 + fi + + echo "Latest tag: $LATEST_TAG" + + if git diff "${LATEST_TAG}..HEAD" --quiet; then + echo "No changes since ${LATEST_TAG}, skipping release" + echo "should_release=false" >> $GITHUB_OUTPUT + echo "## No release needed" >> $GITHUB_STEP_SUMMARY + echo "No changes since ${LATEST_TAG}." >> $GITHUB_STEP_SUMMARY + exit 0 + fi + + VERSION_NUMBER=${LATEST_TAG#v} + MAJOR=$(echo $VERSION_NUMBER | cut -d. -f1) + MINOR=$(echo $VERSION_NUMBER | cut -d. -f2) + PATCH=$(echo $VERSION_NUMBER | cut -d. -f3) + NEXT_PATCH=$((PATCH + 1)) + NEXT_VERSION="v${MAJOR}.${MINOR}.${NEXT_PATCH}" + + echo "Next version: $NEXT_VERSION" + echo "should_release=true" >> $GITHUB_OUTPUT + echo "next_version=${NEXT_VERSION}" >> $GITHUB_OUTPUT + + tests: + name: Run Unit Tests + needs: check + if: needs.check.outputs.should_release == 'true' + runs-on: ubuntu-latest + steps: + - name: Checkout Into Source Code + uses: actions/checkout@v7 + + - name: Set up Go + uses: actions/setup-go@v7 + with: + go-version-file: go.mod + + - name: Lint code + uses: golangci/golangci-lint-action@v9 + + - name: Run Unit Tests + run: | + export CGO_ENABLED=0 + go version + go run github.com/onsi/ginkgo/v2/ginkgo --skip-package=integration ./... + + build-and-release: + name: Build and Release + needs: [check, tests] + if: needs.check.outputs.should_release == 'true' + runs-on: ubuntu-latest + steps: + - name: Checkout Into Source Code + uses: actions/checkout@v7 + with: + fetch-depth: 0 + + - name: Set up Go + uses: actions/setup-go@v7 + with: + go-version-file: go.mod + + - name: Set version variables + id: version + run: | + VERSION="${{ needs.check.outputs.next_version }}" + VERSION_NUMBER=${VERSION#v} + echo "VERSION=$VERSION" >> $GITHUB_OUTPUT + echo "VERSION_NUMBER=$VERSION_NUMBER" >> $GITHUB_OUTPUT + echo "Building version: $VERSION (number: $VERSION_NUMBER)" + + - name: Create Tag + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + git tag -a "${{ steps.version.outputs.VERSION }}" -m "Release ${{ steps.version.outputs.VERSION }}" + git push origin "${{ steps.version.outputs.VERSION }}" + + - name: Build for Linux + run: | + echo "Building Storage CLI for Linux" + GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -ldflags "-X main.version=${{ steps.version.outputs.VERSION_NUMBER }}" \ + -o "storage-cli-${{ steps.version.outputs.VERSION_NUMBER }}-linux-amd64" + echo "### Linux amd64 Build Checksums" >> $GITHUB_STEP_SUMMARY + echo '```' >> $GITHUB_STEP_SUMMARY + sha1sum "storage-cli-${{ steps.version.outputs.VERSION_NUMBER }}-linux-amd64" >> $GITHUB_STEP_SUMMARY + echo '```' >> $GITHUB_STEP_SUMMARY + GOOS=linux GOARCH=arm64 CGO_ENABLED=0 go build -ldflags "-X main.version=${{ steps.version.outputs.VERSION_NUMBER }}" \ + -o "storage-cli-${{ steps.version.outputs.VERSION_NUMBER }}-linux-arm64" + echo "### Linux arm64 Build Checksums" >> $GITHUB_STEP_SUMMARY + echo '```' >> $GITHUB_STEP_SUMMARY + sha1sum "storage-cli-${{ steps.version.outputs.VERSION_NUMBER }}-linux-arm64" >> $GITHUB_STEP_SUMMARY + echo '```' >> $GITHUB_STEP_SUMMARY + + - name: Build for macOS + run: | + echo "Building Storage CLI for macOS" + GOOS=darwin GOARCH=amd64 CGO_ENABLED=0 go build -ldflags "-X main.version=${{ steps.version.outputs.VERSION_NUMBER }}" \ + -o "storage-cli-${{ steps.version.outputs.VERSION_NUMBER }}-darwin-amd64" + echo "### macOS amd64 Build Checksums" >> $GITHUB_STEP_SUMMARY + echo '```' >> $GITHUB_STEP_SUMMARY + sha1sum "storage-cli-${{ steps.version.outputs.VERSION_NUMBER }}-darwin-amd64" >> $GITHUB_STEP_SUMMARY + echo '```' >> $GITHUB_STEP_SUMMARY + GOOS=darwin GOARCH=arm64 CGO_ENABLED=0 go build -ldflags "-X main.version=${{ steps.version.outputs.VERSION_NUMBER }}" \ + -o "storage-cli-${{ steps.version.outputs.VERSION_NUMBER }}-darwin-arm64" + echo "### macOS arm64 Build Checksums" >> $GITHUB_STEP_SUMMARY + echo '```' >> $GITHUB_STEP_SUMMARY + sha1sum "storage-cli-${{ steps.version.outputs.VERSION_NUMBER }}-darwin-arm64" >> $GITHUB_STEP_SUMMARY + echo '```' >> $GITHUB_STEP_SUMMARY + + - name: Build for Windows + run: | + echo "Building Storage CLI for Windows" + GOOS=windows GOARCH=amd64 CGO_ENABLED=0 go build -ldflags "-X main.version=${{ steps.version.outputs.VERSION_NUMBER }}" \ + -o "storage-cli-${{ steps.version.outputs.VERSION_NUMBER }}-windows-amd64.exe" + echo "### Windows Build Checksums" >> $GITHUB_STEP_SUMMARY + echo '```' >> $GITHUB_STEP_SUMMARY + sha1sum "storage-cli-${{ steps.version.outputs.VERSION_NUMBER }}-windows-amd64.exe" >> $GITHUB_STEP_SUMMARY + echo '```' >> $GITHUB_STEP_SUMMARY + + - name: Create Github Release + uses: ncipollo/release-action@v1 + with: + tag: ${{ steps.version.outputs.VERSION }} + name: Release ${{ steps.version.outputs.VERSION }} + body: Release ${{ steps.version.outputs.VERSION }} + artifacts: | + storage-cli-${{ steps.version.outputs.VERSION_NUMBER }}-linux-amd64 + storage-cli-${{ steps.version.outputs.VERSION_NUMBER }}-linux-arm64 + storage-cli-${{ steps.version.outputs.VERSION_NUMBER }}-darwin-amd64 + storage-cli-${{ steps.version.outputs.VERSION_NUMBER }}-darwin-arm64 + storage-cli-${{ steps.version.outputs.VERSION_NUMBER }}-windows-amd64.exe + token: ${{ secrets.GITHUB_TOKEN }} + draft: true # for testing, TODO: change to false + makeLatest: true + generateReleaseNotes: true From 10c2f4e16dfbd11d382b7864e0d79c700d1d15bf Mon Sep 17 00:00:00 2001 From: Stephan Merker Date: Thu, 30 Jul 2026 10:52:51 +0200 Subject: [PATCH 2/2] Run ITs before creating a weekly release --- .github/workflows/alioss-integration.yml | 4 ++- .github/workflows/azurebs-integration.yml | 4 ++- .github/workflows/dav-integration.yml | 2 ++ .github/workflows/gcs-integration.yml | 7 +++-- .github/workflows/release-cron.yml | 37 ++++++++++++++++++++++- .github/workflows/s3-integration.yml | 10 ++++-- 6 files changed, 56 insertions(+), 8 deletions(-) diff --git a/.github/workflows/alioss-integration.yml b/.github/workflows/alioss-integration.yml index e72fe63..e5cd7d6 100644 --- a/.github/workflows/alioss-integration.yml +++ b/.github/workflows/alioss-integration.yml @@ -11,6 +11,7 @@ on: push: branches: - main + workflow_call: concurrency: group: alioss-integration @@ -20,10 +21,11 @@ jobs: alioss-general-integration-tests: name: Alioss General Integration Tests runs-on: ubuntu-latest - # Run on push/workflow_dispatch, skip fork PRs + # Run on push/workflow_dispatch/workflow_call, skip fork PRs if: | github.event_name == 'push' || github.event_name == 'workflow_dispatch' || + github.event_name == 'workflow_call' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) permissions: statuses: write diff --git a/.github/workflows/azurebs-integration.yml b/.github/workflows/azurebs-integration.yml index 2afd5ce..cec941e 100644 --- a/.github/workflows/azurebs-integration.yml +++ b/.github/workflows/azurebs-integration.yml @@ -11,6 +11,7 @@ on: push: branches: - main + workflow_call: concurrency: group: azurebs-integration @@ -20,10 +21,11 @@ jobs: azurecloud-environment-integration-tests: name: AzureCloud Environment Integration Tests runs-on: ubuntu-latest - # Run on push/workflow_dispatch, skip fork PRs + # Run on push/workflow_dispatch/workflow_call, skip fork PRs if: | github.event_name == 'push' || github.event_name == 'workflow_dispatch' || + github.event_name == 'workflow_call' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) permissions: statuses: write diff --git a/.github/workflows/dav-integration.yml b/.github/workflows/dav-integration.yml index 6652b92..feebc6e 100644 --- a/.github/workflows/dav-integration.yml +++ b/.github/workflows/dav-integration.yml @@ -11,6 +11,7 @@ on: push: branches: - main + workflow_call: concurrency: group: dav-integration @@ -23,6 +24,7 @@ jobs: if: | github.event_name == 'push' || github.event_name == 'workflow_dispatch' || + github.event_name == 'workflow_call' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) permissions: statuses: write diff --git a/.github/workflows/gcs-integration.yml b/.github/workflows/gcs-integration.yml index 19c18a5..d224a81 100644 --- a/.github/workflows/gcs-integration.yml +++ b/.github/workflows/gcs-integration.yml @@ -11,6 +11,7 @@ on: push: branches: - "main" + workflow_call: concurrency: group: gcs-integration @@ -20,10 +21,11 @@ jobs: gcs-integration-fast-tests: name: GCS Integation Fast Tests runs-on: ubuntu-latest - # Run on push/workflow_dispatch, skip fork PRs + # Run on push/workflow_dispatch/workflow_call, skip fork PRs if: | github.event_name == 'push' || github.event_name == 'workflow_dispatch' || + github.event_name == 'workflow_call' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) permissions: statuses: write @@ -65,10 +67,11 @@ jobs: gcs-integration-all-tests: name: GCS Integation All Tests runs-on: ubuntu-latest - # Run on push/workflow_dispatch, skip fork PRs + # Run on push/workflow_dispatch/workflow_call, skip fork PRs if: | github.event_name == 'push' || github.event_name == 'workflow_dispatch' || + github.event_name == 'workflow_call' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) permissions: statuses: write diff --git a/.github/workflows/release-cron.yml b/.github/workflows/release-cron.yml index 32af0a7..ddcd099 100644 --- a/.github/workflows/release-cron.yml +++ b/.github/workflows/release-cron.yml @@ -75,9 +75,44 @@ jobs: go version go run github.com/onsi/ginkgo/v2/ginkgo --skip-package=integration ./... + integration-s3: + name: Integration Tests - S3 + needs: [check, tests] + if: needs.check.outputs.should_release == 'true' + uses: ./.github/workflows/s3-integration.yml + secrets: inherit + + integration-gcs: + name: Integration Tests - GCS + needs: [check, tests] + if: needs.check.outputs.should_release == 'true' + uses: ./.github/workflows/gcs-integration.yml + secrets: inherit + + integration-azurebs: + name: Integration Tests - Azure Blob Storage + needs: [check, tests] + if: needs.check.outputs.should_release == 'true' + uses: ./.github/workflows/azurebs-integration.yml + secrets: inherit + + integration-alioss: + name: Integration Tests - Alibaba OSS + needs: [check, tests] + if: needs.check.outputs.should_release == 'true' + uses: ./.github/workflows/alioss-integration.yml + secrets: inherit + + integration-dav: + name: Integration Tests - DAV + needs: [check, tests] + if: needs.check.outputs.should_release == 'true' + uses: ./.github/workflows/dav-integration.yml + secrets: inherit + build-and-release: name: Build and Release - needs: [check, tests] + needs: [check, tests, integration-s3, integration-gcs, integration-azurebs, integration-alioss, integration-dav] if: needs.check.outputs.should_release == 'true' runs-on: ubuntu-latest steps: diff --git a/.github/workflows/s3-integration.yml b/.github/workflows/s3-integration.yml index 09223c0..6ffcbfd 100644 --- a/.github/workflows/s3-integration.yml +++ b/.github/workflows/s3-integration.yml @@ -11,6 +11,7 @@ on: push: branches: - main + workflow_call: concurrency: group: s3-integration @@ -20,10 +21,11 @@ jobs: aws-s3-us-integration: name: AWS S3 US Integration runs-on: ubuntu-latest - # Run on push/workflow_dispatch, skip fork PRs + # Run on push/workflow_dispatch/workflow_call, skip fork PRs if: | github.event_name == 'push' || github.event_name == 'workflow_dispatch' || + github.event_name == 'workflow_call' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) permissions: statuses: write @@ -99,10 +101,11 @@ jobs: aws-s3-regional-integration: name: AWS S3 ${{ matrix.name }} Integration runs-on: ubuntu-latest - # Run on push/workflow_dispatch, skip fork PRs + # Run on push/workflow_dispatch/workflow_call, skip fork PRs if: | github.event_name == 'push' || github.event_name == 'workflow_dispatch' || + github.event_name == 'workflow_call' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) permissions: statuses: write @@ -175,10 +178,11 @@ jobs: s3-compatible-integration: name: S3 Compatible Integration runs-on: ubuntu-latest - # Run on push/workflow_dispatch, skip fork PRs + # Run on push/workflow_dispatch/workflow_call, skip fork PRs if: | github.event_name == 'push' || github.event_name == 'workflow_dispatch' || + github.event_name == 'workflow_call' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) permissions: statuses: write