Skip to content

Commit

Permalink
fix: Remove echo from build pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
hdakhli committed Nov 24, 2023
1 parent 0e8047c commit f34b838
Showing 1 changed file with 43 additions and 41 deletions.
84 changes: 43 additions & 41 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,65 +15,67 @@ on:
branches: [ main ]

jobs:
unit_tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- 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@v4
# - 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
# needs: unit_tests
outputs:
new_version: ${{ steps.tag.outputs.new_version }}
# run: |
# sha=$(echo ${{github.sha}} | cut -c1-8)
# echo "suffix=$sha" >> $GITHUB_OUTPUT
steps:
- uses: actions/checkout@v4
- name: Bump version and push tag
id: tag_version
uses: mathieudutour/[email protected]
if: github.ref != 'refs/heads/main'
with:
release_branches: main
github_token: ${{ secrets.GITHUB_TOKEN }}
if: github.ref != 'refs/heads/main'
dry_run: true

- name: Add tag to output step
id: tag
run: |
echo "outputs: ${{ steps.tag_version.outputs }}"
if [ ${{ github.ref }} == 'refs/heads/main' ]; then
echo "new_version=${{ steps.tag_version.outputs.new_version }}" >> $GITHUB_OUTPUT
else
echo "new_version=${{ steps.tag_version.outputs.new_version }}-dev" >> $GITHUB_OUTPUT
echo "new_version=${{ steps.tag_version.outputs.new_version }}-dev.$(echo ${{github.sha}} | cut -c1-8)" >> $GITHUB_OUTPUT
fi
deploy:
runs-on: ubuntu-latest
needs: tags
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.8'
- name: Install dependencies
run: |
echo "VERSION = '${{ needs.tags.outputs.new_version }}'" >| version.py
python -m pip install --upgrade pip
python -m pip install --upgrade setuptools wheel
- name: Build package
run: python setup.py sdist bdist_wheel
- name: Publish package
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
# deploy:
# runs-on: ubuntu-latest
# needs: tags
# steps:
# - uses: actions/checkout@v4
# - name: Set up Python
# uses: actions/setup-python@v3
# with:
# python-version: '3.8'
# - name: Install dependencies
# run: |
# echo "VERSION = '${{ needs.tags.outputs.new_version }}'" >| version.py
# python -m pip install --upgrade pip
# python -m pip install --upgrade setuptools wheel
# - name: Build package
# run: python setup.py sdist bdist_wheel
# - name: Publish package
# uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
# with:
# user: __token__
# password: ${{ secrets.PYPI_API_TOKEN }}

0 comments on commit f34b838

Please sign in to comment.