php-xmpp/.forgejo/workflows/publish-composer.yml
Tristan a77742fc20
All checks were successful
Publish Composer Package / publish (push) Successful in 40s
use ref_name
2025-01-09 17:13:34 +01:00

35 lines
No EOL
1.2 KiB
YAML

name: Publish Composer Package
on:
push:
tags:
- 'v*' # Workflow wird bei Tags gestartet, die mit "v" beginnen (z.B. v1.0.0)
jobs:
publish:
runs-on: docker # Oder ein selbst gehosteter Runner mit PHP und Composer
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Setup PHP
uses: https://github.com/shivammathur/setup-php@v2
with:
php-version: '8.1' # Oder deine benötigte PHP-Version
extensions: composer
tools: composer
- name: Install Dependencies
run: composer install --no-dev --no-interaction --prefer-dist
- name: Build package
run: composer archive --format=zip --file=package
- name: Publish to Forgejo Package Registry
run: |
echo "Publishing to https://git.fucktheforce.de/api/packages/${{ github.repository_owner }}/composer?version=${{ github.ref_name }}"
curl --request PUT --fail --silent \
--url "https://git.fucktheforce.de/api/packages/${{ github.repository_owner }}/composer?version=${{ github.ref_name }}" \
--header "Authorization: Bearer ${{ secrets.WORKFLOW_TOKEN }}" \
--header "Content-Type: application/zip" \
--data-binary "@package.zip"