Skip to content

Commit

Permalink
Improve pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
jriguera committed Mar 22, 2024
1 parent b3670ab commit c86c495
Showing 1 changed file with 38 additions and 22 deletions.
60 changes: 38 additions & 22 deletions .github/workflows/release-final-boshrelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,41 +7,58 @@ on:
- "main"

env:
RELEASE: "otelcollectory-binary"
RELEASE: "otelcollector-binary"
BOSH_CLI_VERSION: "7.5.5"

permissions: {}

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- name: Checkout
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
lfs: true

- name: Checkout LFS blobs
- name: Git config and checkout LFS blobs
run: |
git lfs install
git lfs update --manual
git lfs checkout
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
# git lfs install
# git lfs update --manual
# git lfs checkout
- name: Install Bosh cli
run: |
wget https://github.com/cloudfoundry/bosh-cli/releases/download/v${BOSH_CLI_VERSION}/bosh-cli-${BOSH_CLI_VERSION}-linux-amd64 -O bosh
chmod a+x bosh
- name: Create final bosh release
id: boshrelease
uses: orange-cloudfoundry/bosh-release-action@v2
run: |
bosh sync-blobs
bosh create-release --final --tarball="release.tgz"
version=$(ls releases/$RELEASE/$RELEASE-*.yml | sed 's/.*\/.*-\(.*\)\.yml$/\1/' | sort -t. -k 1,1nr -k 2,2nr | head -1)
echo "version=${version}" >> $GITHUB_OUTPUT
- name: Uploads artifact release
uses: actions/upload-artifact@v4
with:
target_branch: main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
name: boshelease
path: "release.tgz"

- 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
cat <<EOF | tee > CHANGELOG.txt
# $RELEASE version $version
$DESCRIPTION
Expand All @@ -65,16 +82,15 @@ jobs:
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:
token: ${{ secrets.GITHUB_TOKEN }}
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
# - name: Create a Release
# uses: softprops/action-gh-release@v2
# # if: startsWith(github.ref, 'refs/tags/')
# with:
# token: ${{ secrets.GITHUB_TOKEN }}
# 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 c86c495

Please sign in to comment.