Skip to content

Commit

Permalink
Make alternative publish workflow proper
Browse files Browse the repository at this point in the history
  • Loading branch information
phackstock committed Aug 10, 2023
1 parent b48c3cb commit 97ff84c
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 65 deletions.
53 changes: 33 additions & 20 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -1,31 +1,44 @@
name: Publish ixmp4
# copied from https://github.com/marketplace/actions/install-poetry-action
name: publish

on:
push:
tags: ["v*"]
release:
types: ["published"]
workflow_dispatch:

jobs:
build:
publish:
runs-on: ubuntu-latest
steps:
- run: sudo apt-get install python-dev
- uses: actions/checkout@v3
# publish to pypi
- if: github.event_name == 'release'
name: Build and publish to pypi
uses: JRubics/[email protected]
#----------------------------------------------
# check-out repo and set-up python
#----------------------------------------------
- name: Check out repository
uses: actions/checkout@v3
- name: Set up python
id: setup-python
uses: actions/setup-python@v4
with:
python-version: "3.10"
#----------------------------------------------
# ----- install & configure poetry -----
#----------------------------------------------
- name: Install Poetry
uses: snok/install-poetry@v1
with:
pypi_token: ${{ secrets.PYPI_TOKEN }}
plugins: "poetry-dynamic-versioning[plugin]"
python_version: "3.10"
# publish to testpypi
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- name: Install poetry dynamic versioning plugin
run: poetry self add "poetry-dynamic-versioning[plugin]"
- name: Build package
run: poetry build
- if: github.event_name == 'release'
name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
- if: github.event_name != 'release'
name: Build and publish to testpypi
uses: JRubics/poetry-publish@v1.16
name: Publish distribution to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
python_version: "3.10"
repository_name: "testpypi"
repository_url: "https://test.pypi.org/legacy/"
pypi_token: ${{ secrets.TESTPYPI_TOKEN }}
plugins: "poetry-dynamic-versioning[plugin]"
repository-url: https://test.pypi.org/legacy/
45 changes: 0 additions & 45 deletions .github/workflows/publish_test.yaml

This file was deleted.

0 comments on commit 97ff84c

Please sign in to comment.