Skip to content

Commit

Permalink
fix: semver temp
Browse files Browse the repository at this point in the history
  • Loading branch information
jjjermiah committed Mar 9, 2024
1 parent 24b90c3 commit d378670
Show file tree
Hide file tree
Showing 2 changed files with 136 additions and 136 deletions.
270 changes: 135 additions & 135 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -210,138 +210,138 @@ jobs:
ghcr.io/${{ github.repository }}/nbiatoolkit:latest
labels: ${{ steps.meta.outputs.labels }}

test_install_withPyPi:
needs: Continuous-Deployment
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, macos-14]
python-version: ["3.12", "3.11"]

steps:
- uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install using PyPi
run: |
pip install nbiatoolkit;
NBIAToolkit
test_image_with_new_tag:
needs: Continuous-Deployment
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Test Image With new Tag
run: |
# test image with latest tag
docker run --rm \
${{ secrets.DOCKERHUB_USERNAME }}/nbiatoolkit:${{ steps.release.outputs.tag }} \
NBIAToolkit
test_image_with_latest_tag:
needs: Continuous-Deployment
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Test Image with "latest" Tag
run: |
docker run --rm \
${{ secrets.DOCKERHUB_USERNAME }}/nbiatoolkit:latest \
NBIAToolkit
Update-README:
needs: Continuous-Deployment
runs-on: ubuntu-latest
# if: jobs.Continuous-Deployment.outputs.released == 'true'
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Get Current branch
run: |
echo "Current branch is: ${{ github.ref }}"
echo "Current branch is: ${{ github.head_ref }}"
echo "Current branch is: ${{ github.base_ref }}"
echo "Current branch is: ${{ github.event_name }}"
# if main, then git pull main
if [ "${{ github.ref }}" == "refs/heads/main" ]; then
git pull origin main
fi
# fix diverged branch
git fetch origin ${{ github.head_ref }}
git checkout ${{ github.head_ref }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install using PyPi
run: |
# update pip
pip install .
NBIAToolkit
- name: Update README code block
run: |
awk '/``` bash NBIAToolkit-Output/ {
print "``` bash NBIAToolkit-Output";
print "> NBIAToolkit --version";
system("NBIAToolkit --version");
f=1;
next
} f && /```/ {
print "```";
f=0;
next
} !f' README.md > temp && mv temp README.md
- name: Commit and push changes
run: |
LATEST_TAG=$(curl -s \
"https://api.github.com/repos/${{ github.repository }}/releases/latest" \
| jq -r .tag_name | sed 's/^v//')
echo "LATEST_TAG=${LATEST_TAG}"
# Check for changes
if [[ $(git status --porcelain) ]]; then
# Changes are present
echo "Changes found. Committing and pushing..."
git config --global user.name 'jjjermiah'
git config --global user.email 'jjjermiah@users.noreply.github.com'
# Add all changes
git add .
# Commit with a timestamp
git commit -m "chore: Update README: $LATEST_TAG"
# Push changes to the remote repository
# if github.head_ref is not null
# then push to the branch
# else push to the base branch
if [ -n "${{ github.head_ref }}" ]; then
git push origin HEAD:${{ github.head_ref }}
else
git push origin HEAD:${{ github.ref }}
fi
echo "Changes committed and pushed successfully."
else
# No changes
echo "No changes found. Nothing to commit or push."
fi
# test_install_withPyPi:
# needs: Continuous-Deployment
# runs-on: ${{ matrix.os }}
# strategy:
# matrix:
# os: [ubuntu-latest, macos-latest, macos-14]
# python-version: ["3.12", "3.11"]

# steps:
# - uses: actions/checkout@v3

# - name: Set up Python ${{ matrix.python-version }}
# uses: actions/setup-python@v4
# with:
# python-version: ${{ matrix.python-version }}

# - name: Install using PyPi
# run: |
# pip install nbiatoolkit;
# NBIAToolkit


# test_image_with_new_tag:
# needs: Continuous-Deployment
# runs-on: ubuntu-latest
# steps:
# - name: Checkout code
# uses: actions/checkout@v3

# - name: Test Image With new Tag
# run: |
# # test image with latest tag
# docker run --rm \
# ${{ secrets.DOCKERHUB_USERNAME }}/nbiatoolkit:${{ steps.release.outputs.tag }} \
# NBIAToolkit


# test_image_with_latest_tag:
# needs: Continuous-Deployment
# runs-on: ubuntu-latest
# steps:
# - name: Checkout code
# uses: actions/checkout@v2

# - name: Test Image with "latest" Tag
# run: |
# docker run --rm \
# ${{ secrets.DOCKERHUB_USERNAME }}/nbiatoolkit:latest \
# NBIAToolkit

# Update-README:
# needs: Continuous-Deployment
# runs-on: ubuntu-latest
# # if: jobs.Continuous-Deployment.outputs.released == 'true'
# steps:
# - name: Checkout code
# uses: actions/checkout@v3

# - name: Get Current branch
# run: |
# echo "Current branch is: ${{ github.ref }}"
# echo "Current branch is: ${{ github.head_ref }}"
# echo "Current branch is: ${{ github.base_ref }}"
# echo "Current branch is: ${{ github.event_name }}"

# # if main, then git pull main
# if [ "${{ github.ref }}" == "refs/heads/main" ]; then
# git pull origin main
# fi

# # fix diverged branch
# git fetch origin ${{ github.head_ref }}
# git checkout ${{ github.head_ref }}

# - name: Set up Python ${{ matrix.python-version }}
# uses: actions/setup-python@v4
# with:
# python-version: ${{ matrix.python-version }}

# - name: Install using PyPi
# run: |
# # update pip
# pip install .
# NBIAToolkit

# - name: Update README code block
# run: |
# awk '/``` bash NBIAToolkit-Output/ {
# print "``` bash NBIAToolkit-Output";
# print "> NBIAToolkit --version";
# system("NBIAToolkit --version");
# f=1;
# next
# } f && /```/ {
# print "```";
# f=0;
# next
# } !f' README.md > temp && mv temp README.md

# - name: Commit and push changes
# run: |
# LATEST_TAG=$(curl -s \
# "https://api.github.com/repos/${{ github.repository }}/releases/latest" \
# | jq -r .tag_name | sed 's/^v//')
# echo "LATEST_TAG=${LATEST_TAG}"
# # Check for changes
# if [[ $(git status --porcelain) ]]; then
# # Changes are present
# echo "Changes found. Committing and pushing..."

# git config --global user.name 'jjjermiah'
# git config --global user.email 'jjjermiah@users.noreply.github.com'

# # Add all changes
# git add .

# # Commit with a timestamp
# git commit -m "chore: Update README: $LATEST_TAG"

# # Push changes to the remote repository
# # if github.head_ref is not null
# # then push to the branch
# # else push to the base branch
# if [ -n "${{ github.head_ref }}" ]; then
# git push origin HEAD:${{ github.head_ref }}
# else
# git push origin HEAD:${{ github.ref }}
# fi


# echo "Changes committed and pushed successfully."
# else
# # No changes
# echo "No changes found. Nothing to commit or push."
# fi
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ version_variables = [
version_toml = [
"pyproject.toml:tool.poetry.version",
]
branch = "main"
branch = ["main", "development"]
dist_path = "dist/"
upload_to_release = true
upload_to_pypi = false
Expand Down

0 comments on commit d378670

Please sign in to comment.