Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
Signed-off-by: Justin Kolberg <[email protected]>
  • Loading branch information
amdprophet committed Dec 12, 2024
1 parent 1263ed4 commit 634f690
Showing 1 changed file with 29 additions and 42 deletions.
71 changes: 29 additions & 42 deletions .github/workflows/releases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,15 @@ defaults:

jobs:
get-version:
name: Get application version for this revision
name: Get application version info for this revision
runs-on: ubuntu-latest
outputs:
git-sha: ${{ steps.get-version.outputs.git-sha }}
otc-version: ${{ steps.get-version.outputs.otc-version }}
sumo-version: ${{ steps.get-version.outputs.sumo-version }}
binary-version: ${{ steps.get-version.outputs.binary-version }}
version: ${{ steps.get-version.outputs.version }}
otc-version: ${{ steps.set-versions.outputs.otc-version }}
otc-build-number: ${{ steps.set-versions.outputs.otc-build-number }}
otc-sumo-version: ${{ steps.set-versions.outputs.otc-sumo-version }}
package-version: ${{ needs.set-versions.outputs.otc-version }}-${{ needs.get-version.outputs.otc-build-number }}
binary-version: ${{ needs.set-versions.outputs.otc-version }}-sumo-${{ needs.get-version.outputs.otc-sumo-version }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
Expand All @@ -41,50 +42,36 @@ jobs:
url="${repo_url}/actions/runs/${{ inputs.workflow_id }}"
echo ::notice title=Workflow URL::${url}
- name: Determine Workflow Run ID from workflow
id: get-run-number
run: |
workflow="11673248730"
run_number=$(gh run view "${workflow}" --json number -t '{{.number}}')
echo "run-number=$run_number" >> $GITHUB_OUTPUT
- name: Output Workflow Run Number
run: |
run_number=${{ steps.get-run-number.outputs.run-number }}
echo ::notice title=Workflow Run Number::${run_number}
- name: Download otelcol-sumo artifact from workflow
- name: Download version artifacts from workflow
uses: actions/download-artifact@v4
with:
name: otelcol-sumo-linux_amd64
name: "*.txt"
path: artifacts/
merge-multiple: true
github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{ inputs.workflow_id }}

- name: Determine version from artifact
id: get-version
- name: Set version outputs
id: set-versions
run: |
artifact="artifacts/otelcol-sumo-linux_amd64"
chmod +x "${artifact}"
script="ci/get_version_from_binary.sh"
core="$("$script" core "${artifact}")"
sumo="$("$script" sumo "${artifact}")"
run_number=${{ steps.get-run-number.outputs.run-number }}
echo "otc-version=$core" >> $GITHUB_OUTPUT
echo "sumo-version=$sumo" >> $GITHUB_OUTPUT
echo "binary-version=${core}-sumo-${sumo}" >> $GITHUB_OUTPUT
echo "version=${core}-${run_number}" >> $GITHUB_OUTPUT
- name: Output Binary Version
echo otc_version="$(cat artifacts/otc-version.txt)" >> $GITHUB_OUTPUT
echo otc_build_number="$(cat artifacts/otc-build-number.txt)" >> $GITHUB_OUTPUT
echo otc_sumo_version="$(cat artifacts/otc-sumo-version.txt)" >> $GITHUB_OUTPUT
- name: Output OTC Version
run: |
version="${{ steps.set-versions.outputs.otc_version }}"
echo ::notice title=OTC Version::${version}
- name: Output OTC Build Number
run: |
binary_version=${{ steps.get-version.outputs.binary-version }}
echo ::notice title=Binary Version::${binary_version}
version="${{ steps.set-versions.outputs.otc_build_number }}"
echo ::notice title=OTC Build Number::${version}
- name: Output Package Version
- name: Output OTC Sumo Version
run: |
package_version=${{ steps.get-version.outputs.version }}
echo ::notice title=Package Version::${package_version}
version=${{ steps.set-version.outputs.otc_sumo_version }}
echo ::notice title=OTC Sumo Version::${version}
- name: Determine Git SHA of workflow
id: get-sha
Expand Down Expand Up @@ -143,9 +130,9 @@ jobs:

- uses: ncipollo/release-action@v1
with:
name: v${{ needs.get-version.outputs.version }}
name: v${{ needs.get-version.outputs.package-version }}
commit: ${{ needs.get-version.outputs.git-sha }}
tag: v${{ needs.get-version.outputs.version }}
tag: v${{ needs.get-version.outputs.package-version }}

draft: true
generateReleaseNotes: true
Expand All @@ -160,8 +147,8 @@ jobs:
replacesArtifacts: true

body: |
This release packages
[${{ needs.get-version.outputs.version }}](https://github.com/SumoLogic/sumologic-otel-collector/releases/tag/v${{ needs.get-version.outputs.binary-version }}).
This release packages Sumo Logic Distributions for OpenTelemetry Collector
[${{ needs.get-version.outputs.binary-version }}](https://github.com/SumoLogic/sumologic-otel-collector/releases/tag/v${{ needs.get-version.outputs.binary-version }}).
The changelog below is for the package itself, rather than the Sumo
Logic Distribution for OpenTelemetry Collector. The changelog for
Expand Down

0 comments on commit 634f690

Please sign in to comment.