From da1f4d802b07eb6b1e1fef8d12a75a43813299e2 Mon Sep 17 00:00:00 2001 From: Timothy MacDonald Date: Thu, 8 Feb 2024 15:01:16 -0600 Subject: [PATCH] ci(release): update github release action (#156) * ci(release): updates to gh release action Signed-off-by: Timothy MacDonald * ci(release): update git username Signed-off-by: Timothy MacDonald * ci(release): add correct username and email for release Signed-off-by: Timothy MacDonald * ci(release) fix commit user Signed-off-by: Timothy MacDonald * ci(release): remove incorrect flag from semantic-release in GH action Signed-off-by: Timothy MacDonald --------- Signed-off-by: Timothy MacDonald --- .github/workflows/python-publish.yml | 6 ++--- .github/workflows/python-release.yml | 35 ++++++++++++++++++++++------ 2 files changed, 31 insertions(+), 10 deletions(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 4ae4fe7..089d45c 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -1,8 +1,8 @@ name: Publish Python Package to PyPi -on: - release: - types: [published] +on: workflow_dispatch +# release: +# types: [published] jobs: publish: diff --git a/.github/workflows/python-release.yml b/.github/workflows/python-release.yml index bbacce7..2f68254 100644 --- a/.github/workflows/python-release.yml +++ b/.github/workflows/python-release.yml @@ -29,15 +29,36 @@ jobs: run: | pipx install poetry + - name: Set up Python 3.11 + uses: actions/setup-python@v4 + with: + python-version: 3.11 + cache: 'poetry' + + - name: Install dependencies + run: | + poetry check + poetry lock --no-update + poetry install --verbose + - name: Python Semantic Major Release if: ${{ inputs.bump_major == 'true' }} - uses: python-semantic-release/python-semantic-release@master - with: - force: "major" - github_token: ${{ secrets.GITHUB_TOKEN }} + run: | + git config --global user.name "tech-ally" + git config --global user.email tech-ally@lacework.net + semantic-release version --major + semantic-release publish + env: + GH_TOKEN: ${{secrets.GITHUB_TOKEN}} + PyPI_TOKEN: ${{secrets.PYPI_PASSWORD}} + - name: Python Semantic Release if: ${{ inputs.bump_major == 'false' }} - uses: python-semantic-release/python-semantic-release@master - with: - github_token: ${{ secrets.GITHUB_TOKEN }} + run: | + git config --global user.name "tech-ally" + git config --global user.email tech-ally@lacework.net + semantic-release publish + env: + GH_TOKEN: ${{secrets.GITHUB_TOKEN}} + PyPI_TOKEN: ${{secrets.PYPI_PASSWORD}}