Skip to content

Commit

Permalink
Merge pull request #43 from pratikkumar-mohite/pm/issue-42
Browse files Browse the repository at this point in the history
Issue 42: Added release github action
  • Loading branch information
pratikkumar-mohite authored Aug 31, 2024
2 parents 35bbd02 + 496bfb4 commit 0a968a9
Showing 1 changed file with 63 additions and 0 deletions.
63 changes: 63 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Release

on:
push:
tags:
- 'v*.*.*'

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.22.5'

- name: Build
run: |
make build
- name: Read Release Notes
id: read_release_notes
run: |
release_notes_file="release/${GITHUB_REF_NAME}.md"
if [ -f "$release_notes_file" ]; then
release_notes=$(cat "$release_notes_file")
else
echo "Release notes file $release_notes_file not found."
exit 1
fi
echo "RELEASE_NOTES<<EOF" >> $GITHUB_ENV
echo "$release_notes" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_CI_TOKEN }}
with:
tag_name: ${{ github.ref_name }}
release_name: Release ${{ github.ref_name }}
body: ${{ env.RELEASE_NOTES }}
draft: false
prerelease: false

- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_CI_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./s3-cleanup
asset_name: s3-cleanup
asset_content_type: application/octet-stream

0 comments on commit 0a968a9

Please sign in to comment.