Skip to content

Commit

Permalink
Merge pull request #36 from storyprotocol/feat/refactor_reusable_crea…
Browse files Browse the repository at this point in the history
…te_release

[feat] refactor the reusable_create_release workflow
  • Loading branch information
AndyBoWu authored Apr 25, 2024
2 parents 80bec56 + 5e4d5ac commit 2bbb74a
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions .github/workflows/reusable-create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ name: Reusable workflow to create release in GitHub

on:
workflow_call:
inputs:
version_to_publish:
type: string
required: true
description: 'Version to be published'

permissions:
contents: write
Expand All @@ -14,13 +19,23 @@ jobs:
- name: Checkout
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4

- name: Tag and Push
run: |
VERSION=${{ github.event.inputs.version_to_publish }}
git config --global user.name 'GitHub Actions'
git config --global user.email 'actions@github.com'
git tag -a v$VERSION -m "Release v$VERSION"
git push origin v$VERSION
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Build Changelog
id: github_release
id: build_changelog
uses: mikepenz/release-changelog-builder-action@32e3c96f29a6532607f638797455e9e98cfc703d #v4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create Release
uses: mikepenz/action-gh-release@v1 #softprops/action-gh-release
with:
body: ${{steps.github_release.outputs.changelog}}
body: ${{ steps.build_changelog.outputs.changelog }}

0 comments on commit 2bbb74a

Please sign in to comment.