Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add github release workflow + TER upload #17

Merged
merged 1 commit into from
Mar 11, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
75 changes: 75 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Release
on:
push:
tags:
- '*'

jobs:
# Job: Create release
release:
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
outputs:
release-notes-url: ${{ steps.create-release.outputs.url }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

# Check if tag is valid
- name: Check tag
run: |
if ! [[ ${{ github.ref }} =~ ^refs/tags/[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}$ ]]; then
exit 1
fi
# Create release
- name: Create release
id: create-release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true

# Job: Publish on TER
ter-publish:
if: startsWith(github.ref, 'refs/tags/')
needs: [release]
runs-on: ubuntu-latest
env:
TYPO3_EXTENSION_KEY: warming
TYPO3_API_TOKEN: ${{ secrets.TYPO3_API_TOKEN }}
TYPO3_EXCLUDE_FROM_PACKAGING: packaging_exclude.php
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

# Check if tag is valid
- name: Check tag
run: |
if ! [[ ${{ github.ref }} =~ ^refs/tags/[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}$ ]]; then
exit 1
fi
# Prepare version
- id: get-version
run: echo "version=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT
- id: get-comment
run: echo "comment=See release notes at ${{ needs.release.outputs.release-notes-url }}" >> $GITHUB_OUTPUT

# Prepare environment
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
extensions: intl, mbstring, json, zip, curl
tools: composer:v2, typo3/tailor

- name: Reset files
run: git reset --hard HEAD && git clean -dfx

# Release
- name: Publish to TER
run: |
php ~/.composer/vendor/bin/tailor set-version "${{ steps.get-version.outputs.version }}"
php ~/.composer/vendor/bin/tailor ter:publish --comment "${{ steps.get-comment.outputs.comment }}" "${{ steps.get-version.outputs.version }}"
46 changes: 46 additions & 0 deletions packaging_exclude.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?php

declare(strict_types=1);

return [
'directories' => [
'.build',
'.ddev',
'.git',
'.github',
'bin',
'build',
'public',
'resources\\/private\\/frontend',
'resources\\/private\\/libs\\/build',
'tailor-version-upload',
'tests',
'var',
'vendor',
],
'files' => [
'DS_Store',
'CODE_OF_CONDUCT.md',
'codeception.yml',
'codecov.yml',
'CODEOWNERS',
'composer.lock',
'CONTRIBUTING.md',
'crowdin.yaml',
'dependency-checker.json',
'docker-compose.yml',
'editorconfig',
'editorconfig-lint.php',
'gitattributes',
'gitignore',
'packaging_exclude.php',
'php-cs-fixer.php',
'phpstan.php',
'phpstan-baseline.neon',
'phpunit.functional.xml',
'phpunit.unit.xml',
'rector.php',
'renovate.json',
'typoscript-lint.yml',
],
];
Loading