From 0a9ff90b8c77aed8973d46511782208d5ad77140 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Serdar=20=C3=96zer?= Date: Tue, 2 Dec 2025 17:36:08 +0100 Subject: [PATCH 1/8] feat: release pipeline created - unit test and linting added as pre step - tag created with action and exported into github env - changelog created with action - Build done both for linux and windows - artifacts uploaded both github and s3 --- .github/workflows/release.yml | 132 ++++++++++++++++++++++++++++++++++ 1 file changed, 132 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..2067b4d --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,132 @@ +name : Release + +on: + push: + branches: [ "main","feature/release-pipeline"] + pull_request: + 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: + - 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: ${{ github.event.inputs.version_bump || 'patch'}} + WITH_V: true + + - 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 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 }} + + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: us-east-1 + + - name: Upload Artifacts to S3 + run: | + aws s3 cp "storage-cli-${{ env.VERSION_NUMBER }}-linux-amd64" \ + "s3://storage-cli-artifacts/storage-cli-${{ env.VERSION_NUMBER }}-linux-amd64" + aws s3 cp "storage-cli-${{ env.VERSION_NUMBER }}-windows-amd64.exe" \ + "s3://storage-cli-artifacts/storage-cli-${{ env.VERSION_NUMBER }}-windows-amd64.exe" + + + + \ No newline at end of file From cafe383d4b5329ce7e5a7be8338e07d5284fcd93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Serdar=20=C3=96zer?= Date: Wed, 3 Dec 2025 09:42:11 +0100 Subject: [PATCH 2/8] fix: Steps in workflow reorganized --- .github/workflows/release.yml | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2067b4d..4cc249a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,19 +17,22 @@ on: - minor - major - jobs: tests: name: Run Unit Tests runs-on: [ubuntu-latest] steps: - - uses: actions/checkout@v5 + - 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 @@ -102,7 +105,7 @@ jobs: sha1sum "storage-cli-${{ env.VERSION_NUMBER }}-windows-amd64.exe" >> $GITHUB_STEP_SUMMARY echo '```' >> $GITHUB_STEP_SUMMARY - - name: Create Release + - name: Create Github Release uses: ncipollo/release-action@v1 with: tag: ${{ steps.tag_version.outputs.new_tag }} @@ -113,7 +116,7 @@ jobs: storage-cli-${{ env.VERSION_NUMBER }}-windows-amd64.exe token: ${{ secrets.GITHUB_TOKEN }} - - name: Configure AWS credentials + - name: Configure AWS uses: aws-actions/configure-aws-credentials@v4 with: aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} @@ -125,8 +128,4 @@ jobs: aws s3 cp "storage-cli-${{ env.VERSION_NUMBER }}-linux-amd64" \ "s3://storage-cli-artifacts/storage-cli-${{ env.VERSION_NUMBER }}-linux-amd64" aws s3 cp "storage-cli-${{ env.VERSION_NUMBER }}-windows-amd64.exe" \ - "s3://storage-cli-artifacts/storage-cli-${{ env.VERSION_NUMBER }}-windows-amd64.exe" - - - - \ No newline at end of file + "s3://storage-cli-artifacts/storage-cli-${{ env.VERSION_NUMBER }}-windows-amd64.exe" \ No newline at end of file From 4e14b77bc3c4984343ee16819abfd732e4dc5bc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Serdar=20=C3=96zer?= Date: Wed, 10 Dec 2025 20:06:29 +0100 Subject: [PATCH 3/8] feat: release automation added - for feat: will create minor, for fix: will create patch, and for token BREAKING CHANGE: will create major release - for rest like docs:, chore:, test:, refactore:, ci:, perf:, build: will not create any release - if none of above token found in commits, will continue with DEFAULT_BUMP which is patch --- .github/workflows/release.yml | 8 ++++-- README.md | 47 +++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4cc249a..e090f83 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,8 +2,6 @@ name : Release on: push: - branches: [ "main","feature/release-pipeline"] - pull_request: branches: [ main ] workflow_dispatch: inputs: @@ -57,8 +55,14 @@ jobs: uses: anothrNick/github-tag-action@1.70.0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # DEFAULT_BUMP is used when no conventional commit tokens are found, or for manual workflow_dispatch override DEFAULT_BUMP: ${{ github.event.inputs.version_bump || 'patch'}} WITH_V: true + MAJOR_STRING_TOKEN: "BREAKING CHANGE:,breaking change:,Breaking Change:" + MINOR_STRING_TOKEN: "feat:,Feat:,FEAT:" + PATCH_STRING_TOKEN: "fix:,Fix:,FIX:" + NONE_STRING_TOKEN: "chore:,docs:,test:,ci:,refactor:,style:,build:,Chore:,Docs:,Test:,CI:,Refactor:,Style:,Build:" + PRERELEASE: false - name: Export Version Variable run: | diff --git a/README.md b/README.md index 19f51dd..a55de1a 100644 --- a/README.md +++ b/README.md @@ -132,6 +132,53 @@ Option 2: Release via Draft 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. +## Release + +Releases are automatically created for Windows and Linux platforms through the `release.yml` GitHub Actions workflow. + +### Automated Release Process + +When changes are merged into the `main` branch, a new release is automatically triggered. The version number is determined using **semantic versioning** based on conventional commit message prefixes: + +**Version Bump Rules:** +- `feat:` - New feature → **Minor version bump** (v1.2.0 → v1.3.0) +- `fix:` - Bug fix → **Patch version bump** (v1.2.0 → v1.2.1) +- `BREAKING CHANGE:` - Breaking changes → **Major version bump** (v1.2.0 → v2.0.0) +- + +**No Release Triggered:** +- `docs:` - Documentation changes +- `chore:` - Maintenance tasks (dependencies, build config, tooling) +- `refactor:` - Code restructuring without behavior changes +- `test:` - Test updates +- `style:` - Formatting and whitespace +- `ci:` - CI/CD configuration changes +- `perf:` - Performance improvements +- `build:` - Dependabot commits + +### Manual Release + +For manual releases (e.g., major version updates or hotfixes), use the GitHub Actions **workflow_dispatch** trigger with a version bump type selector (patch/minor/major). + +### Commit Message Examples + +```bash +# Patch release (v1.2.3 → v1.2.4) +git commit -m "fix: resolve upload timeout issue" + +# Minor release (v1.2.3 → v1.3.0) +git commit -m "feat: add retry logic for failed uploads" + +# Major release (v1.2.3 → v2.0.0) +git commit -m "feat: redesign upload API + +BREAKING CHANGE: Upload() signature changed to return structured error" + +# No release +git commit -m "docs: update Azure Blob Storage usage examples" +git commit -m "chore: upgrade dependencies" +``` + ## 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 c67ed4035a5de42ae673048f4ef30c6e10b5c465 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Serdar=20=C3=96zer?= Date: Wed, 10 Dec 2025 20:24:45 +0100 Subject: [PATCH 4/8] docs: commit style referenced in contribution section --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index a55de1a..34e6c1c 100644 --- a/README.md +++ b/README.md @@ -97,6 +97,7 @@ Follow these steps to make a contribution to the project: ``` - If you added or modified integration tests, to run them locally, follow the instructions in the provider-specific README (see [Providers](#providers) section) - Push changes to your fork + Before writing commit message check [release section](#automated-release-process) and [commit message examples](#commit-message-examples) ``` bash git add . git commit -m "Commit message" From a1fbc99dfaf1753f0d24c28200311f39e24b023a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Serdar=20=C3=96zer?= Date: Wed, 10 Dec 2025 20:27:07 +0100 Subject: [PATCH 5/8] docs: typo corrected --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 34e6c1c..f1eba21 100644 --- a/README.md +++ b/README.md @@ -97,7 +97,7 @@ Follow these steps to make a contribution to the project: ``` - If you added or modified integration tests, to run them locally, follow the instructions in the provider-specific README (see [Providers](#providers) section) - Push changes to your fork - Before writing commit message check [release section](#automated-release-process) and [commit message examples](#commit-message-examples) +- **IMPORTANT:** Before writing commit message check [release section](#automated-release-process) and [commit message examples](#commit-message-examples) ``` bash git add . git commit -m "Commit message" From c36e201a9f7aa0f23e550a96258cac1dd5195ae6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Serdar=20=C3=96zer?= Date: Thu, 11 Dec 2025 10:12:34 +0100 Subject: [PATCH 6/8] fix: list of tokens replaced with one --- .github/workflows/release.yml | 9 ++++----- README.md | 35 ++++++++++++++++------------------- 2 files changed, 20 insertions(+), 24 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e090f83..36b4a45 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -55,13 +55,12 @@ jobs: uses: anothrNick/github-tag-action@1.70.0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # DEFAULT_BUMP is used when no conventional commit tokens are found, or for manual workflow_dispatch override + # DEFAULT_BUMP is used when there are no MAJOR_STRING_TOKEN or MINOR_STRING_TOKEN, + # or for manual workflow_dispatch override DEFAULT_BUMP: ${{ github.event.inputs.version_bump || 'patch'}} WITH_V: true - MAJOR_STRING_TOKEN: "BREAKING CHANGE:,breaking change:,Breaking Change:" - MINOR_STRING_TOKEN: "feat:,Feat:,FEAT:" - PATCH_STRING_TOKEN: "fix:,Fix:,FIX:" - NONE_STRING_TOKEN: "chore:,docs:,test:,ci:,refactor:,style:,build:,Chore:,Docs:,Test:,CI:,Refactor:,Style:,Build:" + MAJOR_STRING_TOKEN: "BREAKING CHANGE:" + MINOR_STRING_TOKEN: "feat:" PRERELEASE: false - name: Export Version Variable diff --git a/README.md b/README.md index f1eba21..ca0054c 100644 --- a/README.md +++ b/README.md @@ -143,19 +143,18 @@ When changes are merged into the `main` branch, a new release is automatically t **Version Bump Rules:** - `feat:` - New feature → **Minor version bump** (v1.2.0 → v1.3.0) -- `fix:` - Bug fix → **Patch version bump** (v1.2.0 → v1.2.1) - `BREAKING CHANGE:` - Breaking changes → **Major version bump** (v1.2.0 → v2.0.0) -- - -**No Release Triggered:** -- `docs:` - Documentation changes -- `chore:` - Maintenance tasks (dependencies, build config, tooling) -- `refactor:` - Code restructuring without behavior changes -- `test:` - Test updates -- `style:` - Formatting and whitespace -- `ci:` - CI/CD configuration changes -- `perf:` - Performance improvements -- `build:` - Dependabot commits +- Patch version bump (v1.2.0 → v1.2.1) + - `fix:` - Bug fix + - `docs:` - Documentation changes + - `chore:` - Maintenance tasks (dependencies, build config, tooling) + - `refactor:` - Code restructuring without behavior changes + - `test:` - Test updates + - `style:` - Formatting and whitespace + - `ci:` - CI/CD configuration changes + - `perf:` - Performance improvements + - `build:` - Dependabot commits + - `no conventional commits` - text without specifying any of above ### Manual Release @@ -164,20 +163,18 @@ For manual releases (e.g., major version updates or hotfixes), use the GitHub Ac ### Commit Message Examples ```bash -# Patch release (v1.2.3 → v1.2.4) -git commit -m "fix: resolve upload timeout issue" - -# Minor release (v1.2.3 → v1.3.0) -git commit -m "feat: add retry logic for failed uploads" - # Major release (v1.2.3 → v2.0.0) git commit -m "feat: redesign upload API BREAKING CHANGE: Upload() signature changed to return structured error" -# No release +# Minor release (v1.2.3 → v1.3.0) +git commit -m "feat: add retry logic for failed uploads" + +# Patch release (v1.2.3 → v1.2.4) git commit -m "docs: update Azure Blob Storage usage examples" git commit -m "chore: upgrade dependencies" +git commit -m "class x moved to another folder" ``` ## Notes From 22531f82ad381247356f9fa5e63722d44ed78c1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Serdar=20=C3=96zer?= Date: Thu, 11 Dec 2025 11:23:44 +0100 Subject: [PATCH 7/8] refactor: uploading releaase into S3 bucket commented --- .github/workflows/release.yml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 36b4a45..1170fb2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -56,7 +56,7 @@ jobs: 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 override + # or for manual workflow_dispatch DEFAULT_BUMP: ${{ github.event.inputs.version_bump || 'patch'}} WITH_V: true MAJOR_STRING_TOKEN: "BREAKING CHANGE:" @@ -119,16 +119,16 @@ jobs: storage-cli-${{ env.VERSION_NUMBER }}-windows-amd64.exe token: ${{ secrets.GITHUB_TOKEN }} - - name: Configure AWS - uses: aws-actions/configure-aws-credentials@v4 - with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: us-east-1 + # - name: Configure AWS + # uses: aws-actions/configure-aws-credentials@v4 + # with: + # aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + # aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + # aws-region: us-east-1 - - name: Upload Artifacts to S3 - run: | - aws s3 cp "storage-cli-${{ env.VERSION_NUMBER }}-linux-amd64" \ - "s3://storage-cli-artifacts/storage-cli-${{ env.VERSION_NUMBER }}-linux-amd64" - aws s3 cp "storage-cli-${{ env.VERSION_NUMBER }}-windows-amd64.exe" \ - "s3://storage-cli-artifacts/storage-cli-${{ env.VERSION_NUMBER }}-windows-amd64.exe" \ No newline at end of file + # - name: Upload Artifacts to S3 + # run: | + # aws s3 cp "storage-cli-${{ env.VERSION_NUMBER }}-linux-amd64" \ + # "s3://storage-cli-artifacts/storage-cli-${{ env.VERSION_NUMBER }}-linux-amd64" + # aws s3 cp "storage-cli-${{ env.VERSION_NUMBER }}-windows-amd64.exe" \ + # "s3://storage-cli-artifacts/storage-cli-${{ env.VERSION_NUMBER }}-windows-amd64.exe" \ No newline at end of file From dbf34ef9c0752fbe2686d553075b994b791621e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Serdar=20=C3=96zer?= Date: Thu, 18 Dec 2025 09:38:48 +0100 Subject: [PATCH 8/8] refactor: auto release pipeline and readme updated after rebase --- .github/workflows/build.yml | 4 ++-- .github/workflows/{release.yml => release-auto.yml} | 2 +- README.md | 12 +++--------- 3 files changed, 6 insertions(+), 12 deletions(-) rename .github/workflows/{release.yml => release-auto.yml} (99%) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b0e525a..1f07bb3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,7 +15,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v6 with: - go-version-file: 'go.mod' + go-version-file: go.mod - name: Storage-CLI Build for Linux env: @@ -53,4 +53,4 @@ jobs: path: | storage-cli-linux-amd64 storage-cli-windows-amd64.exe - retention-days: 30 + retention-days: 30 \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release-auto.yml similarity index 99% rename from .github/workflows/release.yml rename to .github/workflows/release-auto.yml index 1170fb2..ca42eab 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release-auto.yml @@ -1,4 +1,4 @@ -name : Release +name : Release Auto on: push: diff --git a/README.md b/README.md index ca0054c..b48ef47 100644 --- a/README.md +++ b/README.md @@ -133,11 +133,7 @@ Option 2: Release via Draft 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. -## Release - -Releases are automatically created for Windows and Linux platforms through the `release.yml` GitHub Actions workflow. - -### Automated Release Process +### Automated Release When changes are merged into the `main` branch, a new release is automatically triggered. The version number is determined using **semantic versioning** based on conventional commit message prefixes: @@ -156,11 +152,9 @@ When changes are merged into the `main` branch, a new release is automatically t - `build:` - Dependabot commits - `no conventional commits` - text without specifying any of above -### Manual Release - -For manual releases (e.g., major version updates or hotfixes), use the GitHub Actions **workflow_dispatch** trigger with a version bump type selector (patch/minor/major). +**Note: When the repo becomes more stable, we are gonna merge these 2 release logic.** -### Commit Message Examples +#### Commit Message Examples ```bash # Major release (v1.2.3 → v2.0.0)