Skip to content

Commit

Permalink
fix(release): add ngrok; run release on debug-release branch; fallbac…
Browse files Browse the repository at this point in the history
…k to python (#838)
  • Loading branch information
abrichr authored Jul 6, 2024
1 parent 5ae2b0a commit 8777574
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 3 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/release-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- main
- debug-release

jobs:
check_last_commit_author:
Expand Down Expand Up @@ -198,6 +199,29 @@ jobs:
echo "Current PATH: $PATH"
echo "Current GITHUB_PATH:"
cat $GITHUB_PATH
- name: Start SSH service
run: |
sudo apt-get update
sudo apt-get install -y openssh-server
sudo service ssh start
ssh-keygen -t rsa -b 4096 -f /tmp/sshkey -N ""
cat /tmp/sshkey.pub >> ~/.ssh/authorized_keys
echo "SSH private key:"
cat /tmp/sshkey
- name: Set up ngrok
run: |
curl -s https://ngrok-agent.s3.amazonaws.com/ngrok.asc | sudo tee /etc/apt/trusted.gpg.d/ngrok.asc >/dev/null
echo "deb https://ngrok-agent.s3.amazonaws.com buster main" | sudo tee /etc/apt/sources.list.d/ngrok.list
sudo apt-get update && sudo apt-get install ngrok
ngrok authtoken ${{ secrets.NGROK_AUTH_TOKEN }}
ngrok tcp 22 &
- name: Wait for ngrok
run: sleep 10
- name: Get ngrok URL
id: ngrok
run: curl -s localhost:4040/api/tunnels | jq -r .tunnels[0].public_url
- name: Display ngrok SSH URL
run: echo "SSH to your runner with: ssh -i /tmp/sshkey -o StrictHostKeyChecking=no root@$(echo ${{ steps.ngrok.outputs.ngrok }} | sed 's|tcp://||;s|:| -p |')"
- name: Python Semantic Release
id: semantic_release
uses: python-semantic-release/[email protected]
Expand Down
12 changes: 9 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -160,12 +160,18 @@ build_command = """
pip install poetry && \
echo "PYTHON_PATH is set to: $PYTHON_PATH" && \
if [ -z \"$PYTHON_PATH\" ]; then \
echo "PYTHON_PATH is empty, using default python3.10" && \
echo "PYTHON_PATH is empty, trying default python3.10" && \
POETRY_PYTHON_PATH=$(which python3.10 || echo "/opt/hostedtoolcache/Python/3.10.14/x64/bin/python3.10") && \
echo "Resolved Python path: $POETRY_PYTHON_PATH" && \
poetry env use $POETRY_PYTHON_PATH; \
if [ -x "$POETRY_PYTHON_PATH" ]; then \
echo "Resolved Python path: $POETRY_PYTHON_PATH" && \
poetry env use $POETRY_PYTHON_PATH; \
else \
echo "python3.10 not found, trying default python" && \
poetry env use python; \
fi; \
else \
echo "Using python from PYTHON_PATH: $PYTHON_PATH/python3.10" && \
ls -la $PYTHON_PATH && \
poetry env use $PYTHON_PATH/python3.10; \
fi && \
poetry build
Expand Down

0 comments on commit 8777574

Please sign in to comment.