Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: automatic publish on version change#214

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
MelvinKl merged 2 commits intomainfromrewrite_cd
Nov 21, 2024
Merged
Show file tree
Hide file tree
Changes fromall 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
41 changes: 17 additions & 24 deletions.github/workflows/cd.yaml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,28 @@
name: CD Workflow

on:
on:
push:
tags:
- "services/[a-zA-Z]+/v[0-9]+.[0-9]+.[0-9]+*"
- "core/v[0-9]+.[0-9]+.[0-9]+*"
workflow_dispatch:
branches:
- main

jobs:
main:
name: Build & Publish module
runs-on: "ubuntu-latest"
steps:
- name: Checkout
uses: actions/checkout@v4
check-version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: "3.8"
- name:Extract updated module path
python-version: "3.8"
- name:Push tag for each updated package
env:
TAG: ${{ github.event.ref }}
run: |
# Remove the `refs/tags` prefix of the git tag
TAG_NO_PREFIX=$(echo "$TAG" | sed 's/^refs\/tags\///')
# Extract the path of the module to publish from the tag
PACKAGE_PATH=$(echo "$TAG_NO_PREFIX" | rev | cut -d'/' -f2- | rev)
# Save the path to the module for use in the build/publish step to only update the module associated with this tag
echo "PACKAGE_PATH=$PACKAGE_PATH" >> $GITHUB_ENV
- name: Build & Publish to PyPi
GH_TOKEN: ${{ secrets.RENOVATE_TOKEN }}
run: |
git config --global user.name "SDK Releaser Bot"
git config --global user.email "noreply@stackit.de"

pip install poetry
cd $PACKAGE_PATH
poetry publish --build --username="__token__" --no-interaction --password="${{ secrets.PYPI_TOKEN }}"
scripts/cd.sh

28 changes: 0 additions & 28 deletions.github/workflows/release-trigger.yaml
View file
Open in desktop

This file was deleted.

2 changes: 2 additions & 0 deletionsscripts/trigger_script.sh → scripts/cd.sh
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -10,8 +10,10 @@ for file in $(git diff --name-only HEAD~1..HEAD | grep pyproject.toml); do
if git rev-parse --verify $expected_tag^{tag} &> /dev/null; then
echo "Tag '$expected_tag' already exists."
else
# Tag doesn't exist. Create tag and build/publish to PyPi
echo "Tag '$expected_tag' does not exist. Creating new tag to trigger release."
git tag -a $expected_tag -m "Release $version"
git push origin tag $expected_tag
poetry publish --build --username="__token__" --no-interaction --password="${{ secrets.PYPI_TOKEN }}"
fi
done
Loading

[8]ページ先頭

©2009-2025 Movatter.jp