-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* create release workflow * fix lint errors --------- Co-authored-by: Gulom Alimov <[email protected]>
- Loading branch information
Showing
1 changed file
with
53 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: Release Piper Action | ||
|
||
on: | ||
workflow_dispatch: # trigger release manually | ||
schedule: | ||
- cron: '0 9 * * 1' # at 9 am every Monday | ||
|
||
jobs: | ||
check_if_should_run: | ||
name: Check if should run | ||
runs-on: ubuntu-latest | ||
outputs: | ||
should_run: ${{ steps.should_run.outputs.should_run }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
# For scheduled runs check if there has been a commit in the last week | ||
- id: should_run | ||
if: ${{ github.event_name == 'schedule' }} | ||
name: Check latest commits | ||
run: | | ||
if [[ -n $(git rev-list --after="7 days" ${{ github.sha }}) ]] | ||
then | ||
echo "should_run=true" >> "$GITHUB_OUTPUT" | ||
else | ||
echo "No commits for the past 7 days" | ||
fi | ||
# For manual release trigger | ||
- if: ${{ github.event_name == 'workflow_dispatch' }} | ||
run: echo "should_run=true" >> "$GITHUB_OUTPUT" | ||
|
||
release: | ||
name: Release | ||
needs: check_if_should_run | ||
if: ${{ needs.check_if_should_run.outputs.should_run == 'true' }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Increment version | ||
id: version | ||
uses: reecetech/[email protected] | ||
with: | ||
scheme: semver | ||
increment: minor | ||
|
||
- name: Create release | ||
uses: softprops/action-gh-release@v2 | ||
with: | ||
tag_name: ${{ steps.version.outputs.version }} | ||
generate_release_notes: true | ||
make_latest: true |