From 6d384f813d9899f28e2213b0bcf6303fc59abe32 Mon Sep 17 00:00:00 2001 From: Willow Ahrens Date: Fri, 26 Jan 2024 08:43:27 -0500 Subject: [PATCH 1/2] try that --- .github/workflows/publish.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index ef51d2b..7f90ca7 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -3,6 +3,7 @@ on: workflow_dispatch: jobs: build: + if: github.ref == 'refs/heads/master' runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -13,7 +14,7 @@ jobs: - name: Install dependencies run: pip install toml - name: Get version - run: echo "VERSION=$(python -c 'import toml; print(toml.load(\"pyproject.toml\")[\"tool\"][\"poetry\"][\"version\"])')" >> $GITHUB_ENV + run: echo "VERSION=$(python -c 'import toml; print(toml.load("pyproject.toml")["tool"]["poetry"]["version"])')" >> $GITHUB_ENV - name: Build and publish to pypi uses: JRubics/poetry-publish@v1.17 with: From 254bf74154c6cf4a5baef2c87d50e5e4c4720591 Mon Sep 17 00:00:00 2001 From: Willow Ahrens Date: Fri, 26 Jan 2024 09:03:58 -0500 Subject: [PATCH 2/2] try this --- .github/workflows/publish.yml | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 7f90ca7..9664b8b 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -3,7 +3,7 @@ on: workflow_dispatch: jobs: build: - if: github.ref == 'refs/heads/master' + #if: github.ref == 'refs/heads/master' runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -14,18 +14,21 @@ jobs: - name: Install dependencies run: pip install toml - name: Get version - run: echo "VERSION=$(python -c 'import toml; print(toml.load("pyproject.toml")["tool"]["poetry"]["version"])')" >> $GITHUB_ENV - - name: Build and publish to pypi - uses: JRubics/poetry-publish@v1.17 - with: - pypi_token: ${{ secrets.PYPI_TOKEN }} + run: | + VERSION=$(python -c 'import toml; print("v" + toml.load("pyproject.toml")["tool"]["poetry"]["version"])') + if [ $? -ne 0 ]; then exit 1; fi + echo "VERSION=$VERSION" >> $GITHUB_ENV + #- name: Build and publish to pypi + # uses: JRubics/poetry-publish@v1.17 + # with: + # pypi_token: ${{ secrets.PYPI_TOKEN }} - name: Create Release uses: actions/create-release@v1 if: success() env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - tag_name: v${{ env.VERSION }} - release_name: Release v${{ env.VERSION }} + tag_name: ${{ env.VERSION }} + release_name: Release ${{ env.VERSION }} draft: false prerelease: false