-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #326 from fboundy/add_workflows
Add workflows
- Loading branch information
Showing
9 changed files
with
1,060 additions
and
350 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,48 @@ | ||
name: Auto Release for Main Branch | ||
|
||
on: | ||
push: | ||
branches: | ||
- main # Trigger on pushes to the main branch | ||
pull_request: | ||
branches: | ||
- main # Trigger on pull requests targeting the main branch | ||
|
||
jobs: | ||
publish-release: | ||
name: Publish Release | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
# Step 1: Checkout the repository | ||
- name: Checkout Repository | ||
uses: actions/checkout@v3 | ||
|
||
# Step 2: Extract Version from `pv_opt.py` | ||
- name: Extract Version | ||
id: extract_version | ||
run: | | ||
# Extract the VERSION variable from pv_opt.py | ||
VERSION=$(grep -oP '(?<=^VERSION = ")[^"]+' apps/pv_opt/pv_opt.py) | ||
if [ -z "$VERSION" ]; then | ||
echo "Error: VERSION not found in apps/pv_opt/pv_opt.py" | ||
exit 1 | ||
fi | ||
echo "VERSION=$VERSION" | ||
echo "version=$VERSION" >> $GITHUB_ENV | ||
echo "::set-output name=version::$VERSION" | ||
# Step 3: Create GitHub Release | ||
- name: Create GitHub Release | ||
if: github.event_name == 'push' || github.event.pull_request.merged == true | ||
uses: actions/create-release@v1 | ||
with: | ||
tag_name: "v${{ env.version }}" | ||
release_name: "Release v${{ env.version }}" | ||
body: | | ||
## Changes | ||
This release was automatically generated from the `main` branch. | ||
draft: false | ||
prerelease: false | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file was deleted.
Oops, something went wrong.
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
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
Oops, something went wrong.