Skip to content

Commit

Permalink
feat(build): Add versionning for dev branches
Browse files Browse the repository at this point in the history
  • Loading branch information
hdakhli committed Nov 24, 2023
1 parent bbcd9d4 commit 4671094
Showing 1 changed file with 27 additions and 23 deletions.
50 changes: 27 additions & 23 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,38 +15,42 @@ on:
branches: [ main ]

jobs:
unit_tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.8'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r test-requirements.txt; fi
- name: Run unit tests
run: |
cd src/
python -m unittest
# unit_tests:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - name: Set up Python
# uses: actions/setup-python@v3
# with:
# python-version: '3.8'
# - name: Install dependencies
# run: |
# python -m pip install --upgrade pip
# if [ -f requirements.txt ]; then pip install -r test-requirements.txt; fi
# - name: Run unit tests
# run: |
# cd src/
# python -m unittest
tags:
runs-on: ubuntu-latest
needs: unit_tests
outputs:
new_version: ${{ steps.tag.outputs.new_version }}
#needs: unit_tests
# outputs:
# new_version: ${{ steps.tag.outputs.new_version }}
steps:
- uses: actions/checkout@master
- uses: actions/checkout@v4
- name: Bump version and push tag
id: tag_version
if: github.ref == 'refs/heads/main'
uses: mathieudutour/[email protected]
uses: mathieudutour/[email protected]
with:
release_branches: main
pre_release_branches: feature\/.*
append_to_pre_release_tag: -dev
default_bump: false
dry_run: true
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Add tag to output step
id: tag
if: github.ref == 'refs/heads/main'
run: echo "::set-output name=new_version::${{ steps.tag_version.outputs.new_version }}"
deploy:
runs-on: ubuntu-latest
Expand Down

0 comments on commit 4671094

Please sign in to comment.