From cf93c9ebdc98c3f3b28eef8199b9656c8c42b210 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Serdar=20=C3=96zer?= Date: Wed, 17 Dec 2025 12:40:21 +0100 Subject: [PATCH 01/14] feat: build results are added into github packages - Build results uploaded under packages, the reason for that is during development we might want to test intermediate builds in some systems(usually in some other systems which consumes storage-cli and uses)and see that our new developed feature worked out. When developments are done we can create PR and once PR goes into main new release will be created. --- .github/workflows/build.yml | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d2eca6c..3bafc7c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,7 +1,7 @@ name: Build on: push: - branches: [ main ] + branches: [ '**' ] # Trigger on all branches pull_request: branches: [ main ] @@ -24,7 +24,8 @@ jobs: CGO_ENABLED: 0 run: | echo "Building Storage CLI for Linux" - go build -o "storage-cli-linux-amd64" + go build -ldflags "-X main.version=0.0.0" \ + -o "storage-cli-linux-amd64" sha1sum "storage-cli-linux-amd64" - name: Storage-CLI Build for Windows @@ -34,5 +35,15 @@ jobs: CGO_ENABLED: 0 run: | echo "Building Storage CLI for Windows" - go build -o "storage-cli-windows-amd64.exe" - sha1sum "storage-cli-windows-amd64.exe" \ No newline at end of file + go build -ldflags "-X main.version=0.0.0" \ + -o "storage-cli-windows-amd64.exe" + sha1sum "storage-cli-windows-amd64.exe" + + - name: Upload Build Artifacts + uses: actions/upload-artifact@v4 + with: + name: storage-cli-${{ github.ref_name }}-${{ github.sha }} + path: | + storage-cli-linux-amd64 + storage-cli-windows-amd64.exe + retention-days: 30 \ No newline at end of file From 65ed9a131bea0177ec902f868756b5c992f5b559 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Serdar=20=C3=96zer?= Date: Wed, 17 Dec 2025 12:50:23 +0100 Subject: [PATCH 02/14] fix: invalid char fix --- .github/workflows/build.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3bafc7c..c35c292 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -39,10 +39,17 @@ jobs: -o "storage-cli-windows-amd64.exe" sha1sum "storage-cli-windows-amd64.exe" + - name: Sanitize branch name + id: sanitize + run: | + BRANCH_NAME="${{ github.ref_name }}" + SAFE_BRANCH=$(echo "$BRANCH_NAME" | sed 's/[^a-zA-Z0-9._-]/-/g') + echo "branch=$SAFE_BRANCH" >> $GITHUB_OUTPUT + - name: Upload Build Artifacts uses: actions/upload-artifact@v4 with: - name: storage-cli-${{ github.ref_name }}-${{ github.sha }} + name: storage-cli-${{ steps.sanitize.outputs.branch }}-${{ github.sha }} path: | storage-cli-linux-amd64 storage-cli-windows-amd64.exe From febca5993b625178e94ca18029781f11a3ecaa30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Serdar=20=C3=96zer?= Date: Wed, 17 Dec 2025 12:59:46 +0100 Subject: [PATCH 03/14] fix: keep build results for 1 day --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c35c292..fb601a0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -53,4 +53,4 @@ jobs: path: | storage-cli-linux-amd64 storage-cli-windows-amd64.exe - retention-days: 30 \ No newline at end of file + retention-days: 1 \ No newline at end of file From 70f40298a04e8103b16068879b8cf7814bedc11e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Serdar=20=C3=96zer?= Date: Wed, 17 Dec 2025 13:04:59 +0100 Subject: [PATCH 04/14] docs: config example added for gcs --- gcs/README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/gcs/README.md b/gcs/README.md index 93f8821..6a6b59e 100644 --- a/gcs/README.md +++ b/gcs/README.md @@ -11,6 +11,20 @@ This is **not** an official Google Product. ## GCS-Specific Configuration The GCS client requires a JSON configuration file. +``` json +{ + "bucket_name": " (required)", + "credentials_source": " ['static'|'none'|""]", + "json_key": " (required if credentials_source = 'static')", + "storage_class": " (optional - default: 'STANDARD', check for more options=https://docs.cloud.google.com/storage/docs/storage-classes)", + "encryption_key": " (optional)", +} +``` + +### Credentials Source Types +* **"":** specifies that credentials should be detected. Application Default Credentials will be used if avaliable. A read-only client will be used otherwise. +* **"none":** specifies that credentials are explicitly empty and that the client should be restricted to a read-only scope. +* **"static:"** specifies that a service account file included in json_key should be used for authentication. ### Authentication Methods (`credentials_source`) * `static`: A [service account](https://cloud.google.com/iam/docs/creating-managing-service-account-keys) key will be provided via the `json_key` field. From 0f712aa2e1e9ebb02992b9a2b718cf376fe7ecf4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Serdar=20=C3=96zer?= Date: Wed, 17 Dec 2025 13:13:22 +0100 Subject: [PATCH 05/14] fix: retentin days reverted to 30 days since it cost really less --- .github/workflows/build.yml | 2 +- .github/workflows/release-manuall.yml | 120 ++++++++++++++++++++++++++ 2 files changed, 121 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/release-manuall.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fb601a0..c35c292 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -53,4 +53,4 @@ jobs: path: | storage-cli-linux-amd64 storage-cli-windows-amd64.exe - retention-days: 1 \ No newline at end of file + retention-days: 30 \ No newline at end of file diff --git a/.github/workflows/release-manuall.yml b/.github/workflows/release-manuall.yml new file mode 100644 index 0000000..99bfd85 --- /dev/null +++ b/.github/workflows/release-manuall.yml @@ -0,0 +1,120 @@ +name : Release + +on: + push: + branches: [ main ] + workflow_dispatch: + inputs: + version_bump: + description: 'version bump type' + required: false + default: patch + type: choice + options: + - patch + - minor + - major + +jobs: + tests: + name: Run Unit Tests + runs-on: [ubuntu-latest] + steps: + - name: Checkout Into Source Code + uses: actions/checkout@v5 + + - name: Set up Go + uses: actions/setup-go@v6 + with: + go-version-file: go.mod + + - name: Lint code + uses: golangci/golangci-lint-action@v8 + + - 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: tests + runs-on: ubuntu-latest + steps: + - name: Checkout Into Source Code + uses: actions/checkout@v5 + + - name: Set up Go + uses: actions/setup-go@v6 + with: + go-version-file: go.mod + + - name: Bump Version and Create Tag + id: tag_version + uses: anothrNick/github-tag-action@1.70.0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # DEFAULT_BUMP is used when there are no MAJOR_STRING_TOKEN or MINOR_STRING_TOKEN, + # or for manual workflow_dispatch + DEFAULT_BUMP: ${{ github.event.inputs.version_bump || 'patch'}} + WITH_V: true + MAJOR_STRING_TOKEN: "BREAKING CHANGE:" + MINOR_STRING_TOKEN: "feat:" + PRERELEASE: false + + - name: Export Version Variable + run: | + VERSION=${{steps.tag_version.outputs.new_tag}} + VERSION_NUMBER=${VERSION#v} + echo "VERSION_NUMBER=${VERSION_NUMBER}" >> $GITHUB_ENV + + - name: Generate Changelog + id: changelog + uses: mikepenz/release-changelog-builder-action@v5 + with: + toTag: ${{ steps.tag_version.outputs.new_tag }} + commitMode: true + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Build for Linux + env: + GOOS: linux + GOARCH: amd64 + CGO_ENABLED: 0 + VERSION: ${{ steps.tag_version.outputs.new_tag}} + run: | + echo "Building Storage CLI for Linux" + go build -ldflags "-X main.version=${{ env.VERSION_NUMBER }}" \ + -o "storage-cli-${{ env.VERSION_NUMBER }}-linux-amd64" + echo "### Linux Build Checksums" >> $GITHUB_STEP_SUMMARY + echo '```' >> $GITHUB_STEP_SUMMARY + sha1sum "storage-cli-${{ env.VERSION_NUMBER }}-linux-amd64" >> $GITHUB_STEP_SUMMARY + echo '```' >> $GITHUB_STEP_SUMMARY + + - name: Build for Windows + env: + GOOS: windows + GOARCH: amd64 + CGO_ENABLED: 0 + VERSION: ${{ steps.tag_version.outputs.new_tag }} + run: | + echo "Building Storage CLI for Windows" + go build -ldflags "-X main.version=${{ env.VERSION_NUMBER }}" \ + -o "storage-cli-${{ env.VERSION_NUMBER }}-windows-amd64.exe" + echo "### Windows Build Checksums" >> $GITHUB_STEP_SUMMARY + echo '```' >> $GITHUB_STEP_SUMMARY + sha1sum "storage-cli-${{ env.VERSION_NUMBER }}-windows-amd64.exe" >> $GITHUB_STEP_SUMMARY + echo '```' >> $GITHUB_STEP_SUMMARY + + - name: Create Github Release + uses: ncipollo/release-action@v1 + with: + tag: ${{ steps.tag_version.outputs.new_tag }} + name: Release ${{ steps.tag_version.outputs.new_tag }} + body: ${{ steps.changelog.outputs.changelog }} + artifacts: | + storage-cli-${{ env.VERSION_NUMBER }}-linux-amd64 + storage-cli-${{ env.VERSION_NUMBER }}-windows-amd64.exe + token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file From 7d269d9db0cccafa8636f0e72bb98745d5c21aec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Serdar=20=C3=96zer?= Date: Wed, 17 Dec 2025 13:31:33 +0100 Subject: [PATCH 06/14] feat: manual releasing options is added --- .github/workflows/release-manual.yml | 116 +++++++++++++++++++++++++ .github/workflows/release-manuall.yml | 120 -------------------------- 2 files changed, 116 insertions(+), 120 deletions(-) create mode 100644 .github/workflows/release-manual.yml delete mode 100644 .github/workflows/release-manuall.yml diff --git a/.github/workflows/release-manual.yml b/.github/workflows/release-manual.yml new file mode 100644 index 0000000..62297da --- /dev/null +++ b/.github/workflows/release-manual.yml @@ -0,0 +1,116 @@ +name: Manual Release + +on: + workflow_dispatch: + inputs: + version: + description: 'Release version (e.g., v1.2.3)' + required: true + type: string + release: + types: [published] + +jobs: + tests: + name: Run Unit Tests + runs-on: [ubuntu-latest] + steps: + - name: Checkout Into Source Code + uses: actions/checkout@v5 + + - name: Set up Go + uses: actions/setup-go@v6 + with: + go-version-file: go.mod + + - name: Lint code + uses: golangci/golangci-lint-action@v8 + + - 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: tests + runs-on: ubuntu-latest + steps: + - name: Checkout Into Source Code + uses: actions/checkout@v5 + + - name: Set up Go + uses: actions/setup-go@v6 + with: + go-version-file: go.mod + + - name: Determine Version + id: version + run: | + if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then + INPUT_VERSION="${{ github.event.inputs.version }}" + else + INPUT_VERSION="${{ github.event.release.tag_name }}" + fi + + # Ensure version starts with 'v' + if [[ "$INPUT_VERSION" == v* ]]; then + VERSION="$INPUT_VERSION" + else + VERSION="v$INPUT_VERSION" + fi + + 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 (if workflow_dispatch) + if: github.event_name == 'workflow_dispatch' + 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 + env: + GOOS: linux + GOARCH: amd64 + CGO_ENABLED: 0 + run: | + echo "Building Storage CLI for Linux" + go build -ldflags "-X main.version=${{ steps.version.outputs.VERSION_NUMBER }}" \ + -o "storage-cli-${{ steps.version.outputs.VERSION_NUMBER }}-linux-amd64" + echo "### Linux 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 + + - name: Build for Windows + env: + GOOS: windows + GOARCH: amd64 + CGO_ENABLED: 0 + run: | + echo "Building Storage CLI for Windows" + 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 or Update Github Release + uses: ncipollo/release-action@v1 + with: + tag: ${{ steps.version.outputs.VERSION }} + name: Release ${{ steps.version.outputs.VERSION }} + body: Manual release ${{ steps.version.outputs.VERSION }} + artifacts: | + storage-cli-${{ steps.version.outputs.VERSION_NUMBER }}-linux-amd64 + storage-cli-${{ steps.version.outputs.VERSION_NUMBER }}-windows-amd64.exe + token: ${{ secrets.GITHUB_TOKEN }} + allowUpdates: true + makeLatest: true \ No newline at end of file diff --git a/.github/workflows/release-manuall.yml b/.github/workflows/release-manuall.yml deleted file mode 100644 index 99bfd85..0000000 --- a/.github/workflows/release-manuall.yml +++ /dev/null @@ -1,120 +0,0 @@ -name : Release - -on: - push: - branches: [ main ] - workflow_dispatch: - inputs: - version_bump: - description: 'version bump type' - required: false - default: patch - type: choice - options: - - patch - - minor - - major - -jobs: - tests: - name: Run Unit Tests - runs-on: [ubuntu-latest] - steps: - - name: Checkout Into Source Code - uses: actions/checkout@v5 - - - name: Set up Go - uses: actions/setup-go@v6 - with: - go-version-file: go.mod - - - name: Lint code - uses: golangci/golangci-lint-action@v8 - - - 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: tests - runs-on: ubuntu-latest - steps: - - name: Checkout Into Source Code - uses: actions/checkout@v5 - - - name: Set up Go - uses: actions/setup-go@v6 - with: - go-version-file: go.mod - - - name: Bump Version and Create Tag - id: tag_version - uses: anothrNick/github-tag-action@1.70.0 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # DEFAULT_BUMP is used when there are no MAJOR_STRING_TOKEN or MINOR_STRING_TOKEN, - # or for manual workflow_dispatch - DEFAULT_BUMP: ${{ github.event.inputs.version_bump || 'patch'}} - WITH_V: true - MAJOR_STRING_TOKEN: "BREAKING CHANGE:" - MINOR_STRING_TOKEN: "feat:" - PRERELEASE: false - - - name: Export Version Variable - run: | - VERSION=${{steps.tag_version.outputs.new_tag}} - VERSION_NUMBER=${VERSION#v} - echo "VERSION_NUMBER=${VERSION_NUMBER}" >> $GITHUB_ENV - - - name: Generate Changelog - id: changelog - uses: mikepenz/release-changelog-builder-action@v5 - with: - toTag: ${{ steps.tag_version.outputs.new_tag }} - commitMode: true - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Build for Linux - env: - GOOS: linux - GOARCH: amd64 - CGO_ENABLED: 0 - VERSION: ${{ steps.tag_version.outputs.new_tag}} - run: | - echo "Building Storage CLI for Linux" - go build -ldflags "-X main.version=${{ env.VERSION_NUMBER }}" \ - -o "storage-cli-${{ env.VERSION_NUMBER }}-linux-amd64" - echo "### Linux Build Checksums" >> $GITHUB_STEP_SUMMARY - echo '```' >> $GITHUB_STEP_SUMMARY - sha1sum "storage-cli-${{ env.VERSION_NUMBER }}-linux-amd64" >> $GITHUB_STEP_SUMMARY - echo '```' >> $GITHUB_STEP_SUMMARY - - - name: Build for Windows - env: - GOOS: windows - GOARCH: amd64 - CGO_ENABLED: 0 - VERSION: ${{ steps.tag_version.outputs.new_tag }} - run: | - echo "Building Storage CLI for Windows" - go build -ldflags "-X main.version=${{ env.VERSION_NUMBER }}" \ - -o "storage-cli-${{ env.VERSION_NUMBER }}-windows-amd64.exe" - echo "### Windows Build Checksums" >> $GITHUB_STEP_SUMMARY - echo '```' >> $GITHUB_STEP_SUMMARY - sha1sum "storage-cli-${{ env.VERSION_NUMBER }}-windows-amd64.exe" >> $GITHUB_STEP_SUMMARY - echo '```' >> $GITHUB_STEP_SUMMARY - - - name: Create Github Release - uses: ncipollo/release-action@v1 - with: - tag: ${{ steps.tag_version.outputs.new_tag }} - name: Release ${{ steps.tag_version.outputs.new_tag }} - body: ${{ steps.changelog.outputs.changelog }} - artifacts: | - storage-cli-${{ env.VERSION_NUMBER }}-linux-amd64 - storage-cli-${{ env.VERSION_NUMBER }}-windows-amd64.exe - token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file From bf7d47bccc24e81bfa00f76b1e59e745273c1ea7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Serdar=20=C3=96zer?= Date: Wed, 17 Dec 2025 13:41:23 +0100 Subject: [PATCH 07/14] feat: on all branch spec added --- .github/workflows/build.yml | 2 +- .github/workflows/release-manual.yml | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c35c292..5be0f0a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,7 +1,7 @@ name: Build on: push: - branches: [ '**' ] # Trigger on all branches + branches: [ '**' ] pull_request: branches: [ main ] diff --git a/.github/workflows/release-manual.yml b/.github/workflows/release-manual.yml index 62297da..a0c9d4e 100644 --- a/.github/workflows/release-manual.yml +++ b/.github/workflows/release-manual.yml @@ -1,6 +1,8 @@ -name: Manual Release +name: Release Manual on: + push: + branches: ['**'] workflow_dispatch: inputs: version: From b61cbebba2b1c97da55d056e01757e66d524cddb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Serdar=20=C3=96zer?= Date: Wed, 17 Dec 2025 13:48:15 +0100 Subject: [PATCH 08/14] fix: all push spec removed --- .github/workflows/release-manual.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/release-manual.yml b/.github/workflows/release-manual.yml index a0c9d4e..811c6ce 100644 --- a/.github/workflows/release-manual.yml +++ b/.github/workflows/release-manual.yml @@ -1,8 +1,6 @@ name: Release Manual on: - push: - branches: ['**'] workflow_dispatch: inputs: version: From 028b2ad81b6c37d6f68c2119c95d0c9e69bb622f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Serdar=20=C3=96zer?= Date: Wed, 17 Dec 2025 14:11:50 +0100 Subject: [PATCH 09/14] fix: do not overwrit when release manually triggered, there might be notes etc --- .github/workflows/release-manual.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release-manual.yml b/.github/workflows/release-manual.yml index 811c6ce..cb5c99c 100644 --- a/.github/workflows/release-manual.yml +++ b/.github/workflows/release-manual.yml @@ -106,11 +106,13 @@ jobs: uses: ncipollo/release-action@v1 with: tag: ${{ steps.version.outputs.VERSION }} - name: Release ${{ steps.version.outputs.VERSION }} - body: Manual release ${{ steps.version.outputs.VERSION }} + name: ${{ github.event_name == 'workflow_dispatch' && format('Release {0}', steps.version.outputs.VERSION) || '' }} + body: ${{ github.event_name == 'workflow_dispatch' && format('Release {0}', steps.version.outputs.VERSION) || '' }} artifacts: | storage-cli-${{ steps.version.outputs.VERSION_NUMBER }}-linux-amd64 storage-cli-${{ steps.version.outputs.VERSION_NUMBER }}-windows-amd64.exe token: ${{ secrets.GITHUB_TOKEN }} allowUpdates: true - makeLatest: true \ No newline at end of file + makeLatest: true + omitNameDuringUpdate: ${{ github.event_name == 'release' }} + omitBodyDuringUpdate: ${{ github.event_name == 'release' }} \ No newline at end of file From 84a2a6fb75ec2144a4625130b26967edaec010f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Serdar=20=C3=96zer?= Date: Wed, 17 Dec 2025 14:26:03 +0100 Subject: [PATCH 10/14] fix: enforce version start with v prefix --- .github/workflows/release-manual.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release-manual.yml b/.github/workflows/release-manual.yml index cb5c99c..236bd03 100644 --- a/.github/workflows/release-manual.yml +++ b/.github/workflows/release-manual.yml @@ -54,13 +54,14 @@ jobs: INPUT_VERSION="${{ github.event.release.tag_name }}" fi - # Ensure version starts with 'v' - if [[ "$INPUT_VERSION" == v* ]]; then - VERSION="$INPUT_VERSION" - else - VERSION="v$INPUT_VERSION" + # Validate version starts with 'v' + if [[ ! "$INPUT_VERSION" == v* ]]; then + echo "Error: Version must start with 'v' (e.g., v1.2.3)" + echo "Provided: $INPUT_VERSION" + exit 1 fi + VERSION="$INPUT_VERSION" VERSION_NUMBER=${VERSION#v} echo "VERSION=$VERSION" >> $GITHUB_OUTPUT echo "VERSION_NUMBER=$VERSION_NUMBER" >> $GITHUB_OUTPUT From ea59da9981b31258823959b624afe2879b5aef6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Serdar=20=C3=96zer?= Date: Wed, 17 Dec 2025 14:41:36 +0100 Subject: [PATCH 11/14] fix: condition on body and name removed --- .github/workflows/release-manual.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-manual.yml b/.github/workflows/release-manual.yml index 236bd03..98809cb 100644 --- a/.github/workflows/release-manual.yml +++ b/.github/workflows/release-manual.yml @@ -107,8 +107,8 @@ jobs: uses: ncipollo/release-action@v1 with: tag: ${{ steps.version.outputs.VERSION }} - name: ${{ github.event_name == 'workflow_dispatch' && format('Release {0}', steps.version.outputs.VERSION) || '' }} - body: ${{ github.event_name == 'workflow_dispatch' && format('Release {0}', 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 }}-windows-amd64.exe From fab53fbfa15d74615a0128bea5b8dbb50c60b9ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Serdar=20=C3=96zer?= Date: Wed, 17 Dec 2025 15:19:59 +0100 Subject: [PATCH 12/14] docs: how to manual release steps are added --- README.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/README.md b/README.md index 530ce19..19f51dd 100644 --- a/README.md +++ b/README.md @@ -104,6 +104,33 @@ Follow these steps to make a contribution to the project: ``` - Create a GitHub pull request, selecting `main` as the target branch +## Releases + +### Manual Release +Releases must be triggered manually by an approver. This can be done either via `GitHub Actions` (workflow dispatch) or through the `GitHub Releases` page using the **Draft a new release** option. The *Release Manual* workflow is responsible for creating and completing the release. + +Option 1: Release via Workflow Dispatch + +- Go to Actions and select the *Release Manual* workflow. + +- Click **Run workflow**. + +- Enter the next incremented version number with the v prefix (for example, v1.2.3). + +- The workflow will create the release and upload the build artifacts once completed. + +Option 2: Release via Draft Release + +- Go to Releases and click **Draft a new release**. + +- Create a new tag using the next incremented version with the v prefix. + +- Fill in the release title and description. + +- Click Publish release. + +- The release will appear immediately on the Releases page. This action will also trigger the *Release Manual* workflow, which will build the artifacts and upload them to the published release once the workflow finishes. + ## Notes These commit IDs represent the last migration checkpoint from each provider's original repository, marking the final commit that was copied during the consolidation process. From 7f80f300d4b4ee95aaaf26300473d49862cddd10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Serdar=20=C3=96zer?= Date: Wed, 17 Dec 2025 16:09:23 +0100 Subject: [PATCH 13/14] style: build workflow is formatted --- .github/workflows/build.yml | 98 ++++++++++++++++++------------------- 1 file changed, 48 insertions(+), 50 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5be0f0a..608e2b2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,55 +2,53 @@ name: Build on: push: branches: [ '**' ] - pull_request: - branches: [ main ] jobs: - build-all-clis: - name: Build Only (No Release) - runs-on: [ubuntu-latest] - steps: - - uses: actions/checkout@v5 - - - name: Set up Go - uses: actions/setup-go@v6 - with: - go-version-file: 'go.mod' - - - name: Storage-CLI Build for Linux - env: - GOOS: linux - GOARCH: amd64 - CGO_ENABLED: 0 - run: | - echo "Building Storage CLI for Linux" - go build -ldflags "-X main.version=0.0.0" \ - -o "storage-cli-linux-amd64" - sha1sum "storage-cli-linux-amd64" - - - name: Storage-CLI Build for Windows - env: - GOOS: windows - GOARCH: amd64 - CGO_ENABLED: 0 - run: | - echo "Building Storage CLI for Windows" - go build -ldflags "-X main.version=0.0.0" \ - -o "storage-cli-windows-amd64.exe" - sha1sum "storage-cli-windows-amd64.exe" - - - name: Sanitize branch name - id: sanitize - run: | - BRANCH_NAME="${{ github.ref_name }}" - SAFE_BRANCH=$(echo "$BRANCH_NAME" | sed 's/[^a-zA-Z0-9._-]/-/g') - echo "branch=$SAFE_BRANCH" >> $GITHUB_OUTPUT - - - name: Upload Build Artifacts - uses: actions/upload-artifact@v4 - with: - name: storage-cli-${{ steps.sanitize.outputs.branch }}-${{ github.sha }} - path: | - storage-cli-linux-amd64 - storage-cli-windows-amd64.exe - retention-days: 30 \ No newline at end of file + build-all-clis: + name: Build Only (No Release) + runs-on: [ubuntu-latest] + steps: + - uses: actions/checkout@v5 + + - name: Set up Go + uses: actions/setup-go@v6 + with: + go-version-file: 'go.mod' + + - name: Storage-CLI Build for Linux + env: + GOOS: linux + GOARCH: amd64 + CGO_ENABLED: 0 + run: | + echo "Building Storage CLI for Linux" + go build -ldflags "-X main.version=0.0.0" \ + -o "storage-cli-linux-amd64" + sha1sum "storage-cli-linux-amd64" + + - name: Storage-CLI Build for Windows + env: + GOOS: windows + GOARCH: amd64 + CGO_ENABLED: 0 + run: | + echo "Building Storage CLI for Windows" + go build -ldflags "-X main.version=0.0.0" \ + -o "storage-cli-windows-amd64.exe" + sha1sum "storage-cli-windows-amd64.exe" + + - name: Sanitize branch name + id: sanitize + run: | + BRANCH_NAME="${{ github.ref_name }}" + SAFE_BRANCH=$(echo "$BRANCH_NAME" | sed 's/[^a-zA-Z0-9._-]/-/g') + echo "branch=$SAFE_BRANCH" >> $GITHUB_OUTPUT + + - name: Upload Build Artifacts + uses: actions/upload-artifact@v4 + with: + name: storage-cli-${{ steps.sanitize.outputs.branch }}-${{ github.sha }} + path: | + storage-cli-linux-amd64 + storage-cli-windows-amd64.exe + retention-days: 30 \ No newline at end of file From 30d9ab6976f3836e5b214c2964f6eb7039d90490 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Serdar=20=C3=96zer?= Date: Wed, 17 Dec 2025 17:10:39 +0100 Subject: [PATCH 14/14] fix: build workflow runs for each commit reverted to be run on PR --- .github/workflows/build.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 608e2b2..724df0b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,7 +1,9 @@ name: Build on: push: - branches: [ '**' ] + branches: [ main ] + pull_request: + branches: [ main ] jobs: build-all-clis: