Skip to content

Commit

Permalink
chore: fix GHA release (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
leoparente authored Feb 17, 2025
1 parent 74985cf commit 099c3db
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ jobs:
run: |
echo "LAST_TAG=`git tag --sort=committerdate | tail -1`" >> $GITHUB_ENV
ARTIFACT_VERSION=${RELEASE:1}
echo "ARTIFACT_VERSION=ARTIFACT_VERSION" >> $GITHUB_ENV
echo "ARTIFACT_VERSION=$ARTIFACT_VERSION" >> $GITHUB_ENV
ARTIFACT="otelcol-contrib_${{ env.ARTIFACT_VERSION }}_linux_amd64.tar.gz"
ARTIFACT="otelcol-contrib_${ARTIFACT_VERSION}_linux_amd64.tar.gz"
ARTIFACT_URL="https://github.com/open-telemetry/opentelemetry-collector-releases/releases/download/$RELEASE/$ARTIFACT"
mkdir .temp/
Expand All @@ -69,8 +69,11 @@ jobs:
zip -j otelcol-contrib-amd64.zip runner/otelcol-contrib
- name: Download and zip arm64
env:
RELEASE: ${{needs.check.outputs.release}}
ARTIFACT_VERSION: ${{ env.ARTIFACT_VERSION }}
run: |
ARTIFACT="otelcol-contrib_${{ env.ARTIFACT_VERSION }}_linux_arm64.tar.gz"
ARTIFACT="otelcol-contrib_${ARTIFACT_VERSION}_linux_arm64.tar.gz"
ARTIFACT_URL="https://github.com/open-telemetry/opentelemetry-collector-releases/releases/download/$RELEASE/$ARTIFACT"
mkdir .temp/
wget -O .temp/otelcol-contrib.tar.gz $ARTIFACT_URL
Expand All @@ -80,15 +83,19 @@ jobs:
rm -rf .temp/
- name: Generate release changelog
env:
LAST_TAG: ${{ env.LAST_TAG }}
run: |
echo "# What's new" > changelog.md
git log ${{ env.LAST_TAG }}..HEAD --pretty=format:"$ad- %s [%an]" >> changelog.md
sed -i -e "s/- /• /g" changelog.md
- name: Release
uses: softprops/action-gh-release@v1
env:
TAG: ${{needs.check.outputs.release}}
with:
tag_name: ${{ env.RELEASE }}
tag_name: ${{ env.TAG }}
body_path: ./changelog.md
files: |
otlpinf-amd64.zip
Expand All @@ -109,6 +116,8 @@ jobs:

- name: Build image and push
uses: docker/build-push-action@48aba3b46d1b1fec4febb7c5d0c644b249a11355 #v6.10.0
env:
TAG: ${{needs.check.outputs.release}}
with:
context: .
file: docker/Dockerfile
Expand All @@ -118,4 +127,4 @@ jobs:
cache-to: type=gha,mode=max
tags: |
netboxlabs/opentelemetry-infinity:latest
netboxlabs/opentelemetry-infinity:${{ env.RELEASE }}
netboxlabs/opentelemetry-infinity:${{ env.TAG }}

0 comments on commit 099c3db

Please sign in to comment.