-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add workflows for validating release and releasing
- Loading branch information
Showing
2 changed files
with
57 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,33 @@ | ||
on: | ||
push: | ||
branches: | ||
- release | ||
jobs: | ||
release_version: | ||
name: "Release New Version" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.11' | ||
- name: Get release version | ||
id: version | ||
run: | | ||
echo "RELEASE_VER=$(python -c \"from docs.conf import release; print(release, end='')\") >> "$GITHUB_OUTPUT" | ||
- name: Bump version and push tag | ||
id: tag_version | ||
uses: mathieudutour/[email protected] | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
custom_tag: ${{ steps.version.outputs.RELEASE_VER }} | ||
|
||
|
||
- name: Create a GitHub release | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
tag: ${{ steps.version.outputs.RELEASE_VER }} | ||
name: Release ${{ steps.version.outputs.RELEASE_VER }} | ||
body: ${{ steps.tag_version.outputs.changelog }} | ||
|
||
|
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,24 @@ | ||
on: | ||
pull_request: | ||
branches: | ||
- release | ||
jobs: | ||
check_version: | ||
name: "Check Version" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.11' | ||
- name: Get PR version | ||
run: | | ||
git checkout -b ${{ github.head_ref }} origin/${{ github.head_ref }} | ||
echo "SOURCE_VER=$(python -c \"from docs.conf import release; print(release, end='')\") >> "$GITHUB_ENV" | ||
- name: Get Release branch version | ||
run: | | ||
git checkout -b ${{ github.base_ref }} origin/${{ github.base_ref }} | ||
echo "TARGET_VER=$(python -c \"from docs.conf import release; print(release, end='')\") >> "$GITHUB_ENV" | ||
- name: Is this a new version? | ||
run: | | ||
if ($SOURCE_VER == $TARGET_VER) exit 1; |