2024-07-09 16:35:23 +03:00
|
|
|
name: release-please-core
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
permissions:
|
|
|
|
contents: write
|
|
|
|
pull-requests: write
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
release-please:
|
|
|
|
runs-on: ubuntu-latest
|
2024-07-09 17:19:26 +03:00
|
|
|
outputs:
|
2024-07-09 17:28:54 +03:00
|
|
|
release_created: ${{ steps.release.outputs['backend/core--release_created'] }}
|
2024-07-09 16:35:23 +03:00
|
|
|
steps:
|
|
|
|
- name: Checkout repository
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
fetch-depth: 0 # Fetch all history for tags and releases
|
|
|
|
|
|
|
|
- name: Setup Python
|
|
|
|
uses: actions/setup-python@v4
|
|
|
|
with:
|
|
|
|
python-version: '3.11'
|
|
|
|
|
|
|
|
- name: Run release-please
|
2024-07-09 17:19:26 +03:00
|
|
|
id: release
|
2024-07-09 16:43:45 +03:00
|
|
|
uses: google-github-actions/release-please-action@v4
|
2024-07-09 16:35:23 +03:00
|
|
|
with:
|
2024-07-09 17:36:23 +03:00
|
|
|
path: backend/core
|
2024-07-09 16:35:23 +03:00
|
|
|
token: ${{ secrets.RELEASE_PLEASE_TOKEN }}
|
2024-09-10 12:11:35 +03:00
|
|
|
|
|
|
|
|
|
|
|
deploy:
|
|
|
|
if: needs.release-please.outputs.release_created == 'true'
|
|
|
|
needs: release-please
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
working-directory: backend/
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Install Rye
|
|
|
|
uses: eifinger/setup-rye@v2
|
|
|
|
with:
|
|
|
|
enable-cache: true
|
|
|
|
working-directory: backend/
|
|
|
|
- name: Rye Sync
|
|
|
|
run: cd core/ && UV_INDEX_STRATEGY=unsafe-first-match rye sync --no-lock
|
|
|
|
- name: Rye Build
|
|
|
|
run: cd core/ && rye build
|
|
|
|
- name: Rye Publish
|
|
|
|
run: rye publish --token ${{ secrets.PYPI_API_TOKEN }} --yes --skip-existing
|