diff --git a/.drone.yml b/.drone.yml index e308f60..aa245ac 100644 --- a/.drone.yml +++ b/.drone.yml @@ -224,3 +224,180 @@ steps: - telegram-client-build-push - text-matcher-migrator-build-push - users-migrator-build-push + +--- +# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +# 📦 Contracts-only pipeline for telegram-listener +# Trigger: commit message contains "contracts_only:telegram_listener" +# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +kind: pipeline +type: kubernetes +name: telegram-listener-contracts-only + +metadata: + namespace: musk-drone + +trigger: + ref: + - refs/tags/* + event: + - tag + +clone: + disable: true + +steps: + - name: clone + image: alpine/git + commands: + - git clone https://gitea.musk.fun/nocr/flea + - cd flea + - git submodule update --init --recursive + + - name: check-commit-message + image: alpine/git + commands: + - cd flea + - COMMIT_MSG=$(git log -1 --pretty=%B) + - echo "Commit message':' $COMMIT_MSG" + - | + if echo "$COMMIT_MSG" | grep -q "contracts_only:telegram_listener"; then + echo "✅ Commit message contains 'contracts_only:telegram_listener', proceeding..." + exit 0 + else + echo "❌ Commit message does not contain 'contracts_only:telegram_listener', skipping..." + exit 78 + fi + depends_on: + - clone + + - name: telegram-listener-contracts-publish + image: mcr.microsoft.com/dotnet/sdk:8.0 + environment: + VERSION: ${DRONE_TAG} + NUGETAPIKEY: + from_secret: nuget_musk_api_key + commands: + - dotnet nuget add source --name musk https://gitea.musk.fun/api/packages/nocr/nuget/index.json + - dotnet pack ./flea/telegram-listener/Nocr.TelegramListener.sln -o ./flea/telegram-listener/bin -p:PackageVersion=${DRONE_TAG} + - dotnet nuget push ./flea/telegram-listener/bin/*Contract*.nupkg --api-key $NUGETAPIKEY --source musk --skip-duplicate + depends_on: + - check-commit-message + +--- +# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +# 📦 Contracts-only pipeline for text-matcher +# Trigger: commit message contains "contracts_only:text_matcher" +# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +kind: pipeline +type: kubernetes +name: text-matcher-contracts-only + +metadata: + namespace: musk-drone + +trigger: + ref: + - refs/tags/* + event: + - tag + +clone: + disable: true + +steps: + - name: clone + image: alpine/git + commands: + - git clone https://gitea.musk.fun/nocr/flea + - cd flea + - git submodule update --init --recursive + + - name: check-commit-message + image: alpine/git + commands: + - cd flea + - COMMIT_MSG=$(git log -1 --pretty=%B) + - echo "Commit message':' $COMMIT_MSG" + - | + if echo "$COMMIT_MSG" | grep -q "contracts_only:text_matcher"; then + echo "✅ Commit message contains 'contracts_only:text_matcher', proceeding..." + exit 0 + else + echo "❌ Commit message does not contain 'contracts_only:text_matcher', skipping..." + exit 78 + fi + depends_on: + - clone + + - name: text-matcher-contracts-publish + image: mcr.microsoft.com/dotnet/sdk:8.0 + environment: + VERSION: ${DRONE_TAG} + NUGETAPIKEY: + from_secret: nuget_musk_api_key + commands: + - dotnet nuget add source --name musk https://gitea.musk.fun/api/packages/nocr/nuget/index.json + - dotnet pack ./flea/text-matcher/Nocr.TextMatcher.sln -o ./flea/text-matcher/bin -p:PackageVersion=${DRONE_TAG} + - dotnet nuget push ./flea/text-matcher/bin/*Contract*.nupkg --api-key $NUGETAPIKEY --source musk --skip-duplicate + depends_on: + - check-commit-message + +--- +# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +# 📦 Contracts-only pipeline for users +# Trigger: commit message contains "contracts_only:users" +# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +kind: pipeline +type: kubernetes +name: users-contracts-only + +metadata: + namespace: musk-drone + +trigger: + ref: + - refs/tags/* + event: + - tag + +clone: + disable: true + +steps: + - name: clone + image: alpine/git + commands: + - git clone https://gitea.musk.fun/nocr/flea + - cd flea + - git submodule update --init --recursive + + - name: check-commit-message + image: alpine/git + commands: + - cd flea + - COMMIT_MSG=$(git log -1 --pretty=%B) + - echo "Commit message':' $COMMIT_MSG" + - | + if echo "$COMMIT_MSG" | grep -q "contracts_only:users"; then + echo "✅ Commit message contains 'contracts_only:users', proceeding..." + exit 0 + else + echo "❌ Commit message does not contain 'contracts_only:users', skipping..." + exit 78 + fi + depends_on: + - clone + + - name: users-contracts-publish + image: mcr.microsoft.com/dotnet/sdk:8.0 + environment: + VERSION: ${DRONE_TAG} + NUGETAPIKEY: + from_secret: nuget_musk_api_key + commands: + - dotnet nuget add source --name musk https://gitea.musk.fun/api/packages/nocr/nuget/index.json + - dotnet pack ./flea/users/Nocr.Users.sln -o ./flea/users/bin -p:PackageVersion=${DRONE_TAG} + - dotnet nuget push ./flea/users/bin/*Contract*.nupkg --api-key $NUGETAPIKEY --source musk --skip-duplicate + depends_on: + - check-commit-message