Skip to content

Commit

Permalink
fix(cd): automatic release & publish on pypi
Browse files Browse the repository at this point in the history
  • Loading branch information
hadrien committed Sep 9, 2024
1 parent efbbbba commit c96cefa
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 18 deletions.
22 changes: 4 additions & 18 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,22 @@
name: Publish on PyPI
name: Publish

on:
push:
branches:
- main
tags:
- '*'

jobs:

Publish:
runs-on: ubuntu-latest
concurrency: release
permissions:
id-token: write
contents: write
contents: read
steps:
- name: 📥 checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: 🔧 setup uv
uses: ./.github/uv
- name: 📜 semantic release version
run: |
RET_CODE=0
uv run semantic-release --strict version || RET_CODE=$?
if [ $RET_CODE -ne 0 ]; then
echo "Nothing to publish"
exit 0
fi
continue-on-error: true
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: 🛠️ build
run: uv build
- name: 📰 publish on pypi
Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Release

on:
push:
branches:
- main

jobs:

Release:
runs-on: ubuntu-latest
concurrency: release
permissions:
contents: write
id-token: write
steps:
- name: 📥 checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: 🔧 setup uv
uses: ./.github/uv
- name: 📜 semantic release version
run:
RET_CODE=0
uv run semantic-release --strict version || RET_CODE=$?
if [ $RET_CODE -ne 0 ]; then
echo "Nothing to publish"
exit 0
fi
env:
GH_TOKEN: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
- name: 🛠️ uv build
run:
uv build
echo $RET_CODE
echo "yolo"

0 comments on commit c96cefa

Please sign in to comment.