add token #9
This file contains 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
name: Release Bosh Release | |
on: | |
workflow_dispatch: { } | |
push: | |
branches: | |
- "main" | |
env: | |
RELEASE: "otelcollectory-binary" | |
permissions: {} | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
lfs: true | |
- name: Checkout LFS blobs | |
run: | | |
git lfs install | |
git lfs update --manual | |
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: | |
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 |