Skip to content

Commit

Permalink
Add workflows for validating release and releasing
Browse files Browse the repository at this point in the history
  • Loading branch information
pmdevita committed Aug 10, 2023
1 parent 2ca6138 commit 6fa2747
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/release.yml
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 }}


24 changes: 24 additions & 0 deletions .github/workflows/validate-release.yml
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;

0 comments on commit 6fa2747

Please sign in to comment.