Skip to content

Commit

Permalink
0.3.0: updating actions (#3)
Browse files Browse the repository at this point in the history
* .3.0: updating actions

* updated check version string

* update pr verfiication
  • Loading branch information
robbiemu authored Oct 9, 2024
1 parent 2e4a565 commit 1eca8e3
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 9 deletions.
30 changes: 22 additions & 8 deletions .github/workflows/pr-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,39 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.6'
python-version: '3.x'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade pip setuptools wheel
pip install -r requirements.txt
- name: Get version from version.py
- name: Get version from main branch
id: get_version
run: echo "::set-output name=version::$(python -c "import importlib; print(importlib.import_module('src.libcrawler.version').__version__)")"

run: |
# Extract version from the Python file and store it as a variable
VERSION=$(python -c "import importlib; print(importlib.import_module('src.libcrawler.version').__version__)")
echo "Extracted Version: $VERSION"
# Prefix the version with 'v' to match the branch naming convention
BRANCH_VERSION="v$VERSION"
echo "Formatted Branch Version: $BRANCH_VERSION"
# Set the formatted version as an environment variable for later steps
echo "branch_version=$BRANCH_VERSION" >> $GITHUB_ENV

- name: Check if branch exists for the current version
run: |
git ls-remote --heads origin refs/heads/${{ steps.get_version.outputs.version }} && exit 1 || true
# Use the formatted branch version to check if it exists in the repo
git ls-remote --heads origin refs/heads/$branch_version && exit 0 || (echo "Branch $branch_version does not exist" && exit 1)
- name: Run tests
run: python -m unittest discover -s src/tests

- name: Build and check distribution
run: python3 -m build sdist

- name: Install package and test entry point
run: |
pip install .
pip install dist/*.tar.gz
crawl-docs --help
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.6'
python-version: '3.x'

- name: Install dependencies
run: |
Expand Down

0 comments on commit 1eca8e3

Please sign in to comment.