35 lines
No EOL
1.2 KiB
YAML
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" |