Skip to content

Commit

Permalink
Improve workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
jriguera committed Mar 20, 2024
1 parent f6e5d5b commit 3f4e702
Showing 1 changed file with 45 additions and 4 deletions.
49 changes: 45 additions & 4 deletions .github/workflows/release-final-boshrelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@ on:
- "main"

env:
# Default image for the Chart
DOCKER_IMAGE_NAME: mimirrules-controller
DOCKER_REGISTRY: ghcr.io/springernature/o11y-rules-telemetry-operator
DOCKER_BUILD_DIR: '.'
RELEASE="otelcollectory-binary"

permissions: {}

Expand All @@ -28,8 +25,52 @@ jobs:
run: git lfs checkout

- name: Create final bosh release
id: boshrelease
uses: orange-cloudfoundry/bosh-release-action@v2
with:
target_branch: main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Generate release notes from git commits
run: |
lastcommit=$(git log --no-walk --tags --pretty="%h %s" | awk 'NR==1{ print $1 }')
git_changes=$(git log --pretty="%h %aI %s (%an)" $lastcommit..@ | sed 's/^/- /')
version="${{ steps.boshrelease.outputs.version }}"
sha1=$(sha1sum -b "${{ steps.boshrelease.outputs.file }}" | cut -d' ' -f1)
cat <<EOF > ${{ github.workspace }}-CHANGELOG.txt
# $RELEASE version $version
$DESCRIPTION
## Changes since last version
$git_changes
## Using in a bosh Deployment
releases:
- name: $RELEASE
url: https://github.com/${GITHUB_REPOSITORY}/releases/download/v${version}/${RELEASE}.tgz
version: $version
sha1: $sha1
or to always point to latest release:
releases:
- name: $RELEASE
url: https://github.com/${GITHUB_REPOSITORY}/releases/latest/download/${RELEASE}.tgz
version: latest
EOF
- name: Create a Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
tag_name: "v${{ steps.boshrelease.outputs.version }}"
files: ${{ steps.boshrelease.outputs.file }}
body_path: "${{ github.workspace }}-CHANGELOG.txt"
generate_release_notes: true
make_latest: true

0 comments on commit 3f4e702

Please sign in to comment.