-
Notifications
You must be signed in to change notification settings - Fork 1
Release Pipeline #14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
serdarozerr
wants to merge
8
commits into
cloudfoundry:main
Choose a base branch
from
sap-contributions:feature/release-pipeline
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+175
−2
Draft
Release Pipeline #14
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
0a9ff90
feat: release pipeline created
serdarozerr cafe383
fix: Steps in workflow reorganized
serdarozerr 4e14b77
feat: release automation added
serdarozerr c67ed40
docs: commit style referenced in contribution section
serdarozerr a1fbc99
docs: typo corrected
serdarozerr c36e201
fix: list of tokens replaced with one
serdarozerr 22531f8
refactor: uploading releaase into S3 bucket commented
serdarozerr dbf34ef
refactor: auto release pipeline and readme updated after rebase
serdarozerr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,134 @@ | ||
| name : Release Auto | ||
|
|
||
| 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 }} | ||
|
|
||
| # - 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" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really want to have a release per commit?
At least now when storage-cli is still under heavy development, this is maybe a bit too much noise.
I would start with manual releases and later e.g. weekly releases.