Skip to content

Commit

Permalink
Use pipx to ensure command in path
Browse files Browse the repository at this point in the history
idk why I forgot this was an option
  • Loading branch information
drewcassidy committed Aug 22, 2024
1 parent 1f01bda commit e701a33
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 16 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,20 @@ jobs:
python -m pip install flake8
python -m pip install ${{ matrix.click-version }}
- name: Install module
run: python -m pip install .

- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Run unit tests
- name: Run Unit Tests
run: python -m unittest -v

- name: Run Action
id: yaclog-show
uses: ./

deploy:
# needs: test
runs-on: ubuntu-latest
Expand Down
19 changes: 7 additions & 12 deletions action.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
name: 'Yaclog'
description: 'Get version information from a changelog, and optionally create a new release'
name: Yaclog
description: >
Get version information from a changelog, and optionally create a new release.
The `yaclog` command is made available for use in future steps.
branding:
icon: file-text
color: blue
color: orange

inputs:
markdown:
Expand Down Expand Up @@ -44,19 +46,12 @@ runs:
- id: setup-python
uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: '3.12'
update-environment: 'false'

- name: Setup Yaclog
shell: bash
run: |
${{ steps.setup-python.outputs.python-path }} -m pip install ${{ github.action_path }}
# now make it available in $PATH
# this whole rigamarole is because we are using a python root that isnt in $PATH as to not step over other actions
mkdir -p "$GITHUB_ACTION_PATH/bin"
echo '${{ steps.setup-python.outputs.python-path }} -m yaclog.cli $@' > "$GITHUB_ACTION_PATH/bin/yaclog"
chmod +x "$GITHUB_ACTION_PATH/bin/yaclog"
echo "$GITHUB_ACTION_PATH/bin" > "$GITHUB_PATH"
run: pipx install --python ${{ steps.setup-python.outputs.python-path }} ${{ github.action_path }}

- name: Create New Release
shell: bash
Expand Down

0 comments on commit e701a33

Please sign in to comment.