-
Notifications
You must be signed in to change notification settings - Fork 1
Enhance documentation and setup scripts for Dynatrace Snowflake Obser… #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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
76145b8
Enhance documentation and setup scripts for Dynatrace Snowflake Obser…
sebastiankruk 4ff52ed
Update .github/workflows/release.yml
sebastiankruk 7e3d2a0
Update INSTALL.md
sebastiankruk ce8b529
disabling release on dev/build_artifacts
sebastiankruk 973f660
Update CONTRIBUTING.md
sebastiankruk 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,100 @@ | ||
| name: Build and Release | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| - devel | ||
| tags: | ||
| - "v*" | ||
| workflow_dispatch: | ||
| inputs: | ||
| create_release: | ||
| description: "Create a draft release (for testing)" | ||
| required: false | ||
| type: boolean | ||
| default: false | ||
|
|
||
| jobs: | ||
| build-and-release: | ||
| name: Build and Release | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: write # Needed to create releases | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 # Required for git history access | ||
|
|
||
| - name: Install build dependencies | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y libcairo2 libpango-1.0-0 libpangocairo-1.0-0 libgdk-pixbuf2.0-0 libffi-dev pandoc | ||
| python -m pip install --upgrade pip | ||
| pip install -r requirements.txt | ||
|
|
||
| - name: Get Version | ||
| id: get_version | ||
| run: | | ||
| if [[ "${{ github.ref_type }}" == "tag" ]]; then | ||
| VERSION_NUMBER="${{ github.ref_name }}" | ||
| VERSION_NUMBER="${VERSION_NUMBER#v}" | ||
| else | ||
| VERSION_NUMBER=$(grep '^VERSION' src/dtagent/version.py | cut -d '"' -f 2) | ||
sebastiankruk marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| if [[ -z "$VERSION_NUMBER" ]]; then | ||
| echo "Error: Failed to extract version from src/dtagent/version.py. File may be missing or format may be incorrect." | ||
| exit 1 | ||
| fi | ||
| fi | ||
| echo "VERSION=${VERSION_NUMBER}" >> $GITHUB_OUTPUT | ||
|
|
||
| - name: Clean up previous build artifacts | ||
| run: | | ||
| rm -f dynatrace_snowflake_observability_agent-*.zip | ||
| rm -f Dynatrace-Snowflake-Observability-Agent-*.pdf | ||
|
|
||
| - name: Run package script | ||
| id: package | ||
| run: | | ||
| chmod +x *.sh | ||
| ./package.sh full | ||
| BUILD_NUMBER=$(grep 'BUILD =' build/_version.py | awk '{print $3}') | ||
| echo "ZIP_NAME=dynatrace_snowflake_observability_agent-${{ steps.get_version.outputs.VERSION }}.${BUILD_NUMBER}.zip" >> $GITHUB_OUTPUT | ||
| echo "PDF_NAME=Dynatrace-Snowflake-Observability-Agent-${{ steps.get_version.outputs.VERSION }}.pdf" >> $GITHUB_OUTPUT | ||
|
|
||
| - name: Upload build artifacts | ||
| if: github.ref_type != 'tag' && inputs.create_release == false | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: dsoa-package-${{ steps.get_version.outputs.VERSION }} | ||
| path: | | ||
| ${{ steps.package.outputs.ZIP_NAME }} | ||
| ${{ steps.package.outputs.PDF_NAME }} | ||
|
|
||
| - name: Extract Release Notes from CHANGELOG | ||
| id: extract_release_notes | ||
| if: github.ref_type == 'tag' || inputs.create_release == true | ||
| run: | | ||
| VERSION_HEADER="## Dynatrace Snowflake Observability Agent ${{ steps.get_version.outputs.VERSION }}" | ||
| # Use awk to find the section for the current version and print until the next ## heading | ||
| awk -v header="$VERSION_HEADER" ' | ||
| $0 == header { in_section=1; next } | ||
| /^## / { if (in_section) exit } | ||
| in_section { print } | ||
| ' CHANGELOG.md > release_notes.md | ||
|
|
||
| - name: Create GitHub Release | ||
| if: github.ref_type == 'tag' || inputs.create_release == true | ||
| uses: softprops/action-gh-release@v2 | ||
| with: | ||
| tag_name: ${{ github.ref_name }} | ||
| name: Dynatrace Snowflake Observability Agent ${{ steps.get_version.outputs.VERSION }} | ||
| body_path: release_notes.md | ||
| draft: ${{ inputs.create_release == true }} | ||
| files: | | ||
| ${{ steps.package.outputs.ZIP_NAME }} | ||
| ${{ steps.package.outputs.PDF_NAME }} | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
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 |
|---|---|---|
|
|
@@ -97,6 +97,7 @@ | |
| "snowflakedb", | ||
| "snowpark", | ||
| "SNOWPIPE", | ||
| "softprops", | ||
| "specversion", | ||
| "spendings", | ||
| "SQLERRM", | ||
|
|
||
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
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.
Uh oh!
There was an error while loading. Please reload this page.