Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update python semantic release and add pre-release pipeline #127

Merged
merged 2 commits into from
Jun 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions .github/workflows/pre-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: 🍦 Create Pre-Release

on:
pull_request:
branches:
- develop
types:
- closed
jobs:
release:
#if: ${{ github.event.pull_request.merged }}
name: 🏗️ Build package and publish to pypi
runs-on: ubuntu-latest
concurrency: release
permissions:
id-token: write
environment:
name: pypi
url: https://pypi.org/p/niceml
steps:
- name: ⬇️ Checkout repository
uses: actions/checkout@v3
with:
ref: 'develop'
fetch-depth: 0
token: ${{ secrets.RELEASE_WORKFLOW }}
- name: 🐍Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: 🔨 Setup poetry
uses: abatilo/[email protected]
with:
poetry-version: "1.7.1"
- name: 🔨Install dependencies
run: |
poetry config virtualenvs.create false
poetry install --no-interaction --no-ansi --with dev
- name: 🚀 Python Semantic Release
id: release
uses: python-semantic-release/[email protected]
with:
github_token: ${{ secrets.RELEASE_WORKFLOW }}
force: "prerelease"

- name: 🐍 Publish package distributions to PyPI
uses: pypa/[email protected]
if: steps.release.outputs.released == 'true'

- name: 🐙 Publish package distributions to GitHub Releases
uses: python-semantic-release/[email protected]
if: steps.release.outputs.released == 'true'
with:
github_token: ${{ secrets.RELEASE_WORKFLOW }}
28 changes: 18 additions & 10 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ jobs:
name: 🏗️ Build package and publish to pypi
runs-on: ubuntu-latest
concurrency: build
environment:
name: pypi
url: https://pypi.org/p/niceml
steps:
- name: ⬇️ Checkout repository
uses: actions/checkout@v3
Expand All @@ -34,16 +37,21 @@ jobs:
run: |
poetry config virtualenvs.create false
poetry install --no-interaction --no-ansi --with dev
- name: 🍦 Release new version
run: |
git config --global user.name "github-actions"
git config --global user.email "[email protected]"
cp -r configs template
semantic-release publish
env:
GH_TOKEN: ${{secrets.RELEASE_WORKFLOW}}
REPOSITORY_PASSWORD: ${{secrets.PYPI_TOKEN}}
REPOSITORY_USERNAME: __token__
- name: 🚀 Python Semantic Release
id: release
uses: python-semantic-release/[email protected]
with:
github_token: ${{ secrets.RELEASE_WORKFLOW }}

- name: 🐍 Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@v1
if: steps.release.outputs.released == 'true'

- name: 🐙 Publish package distributions to GitHub Releases
uses: python-semantic-release/[email protected]
if: steps.release.outputs.released == 'true'
with:
github_token: ${{ secrets.RELEASE_WORKFLOW }}
documentation:
if: ${{ github.event.pull_request.merged }}
uses: ./.github/workflows/docs.yaml
Loading
Loading