Skip to content
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
65 changes: 65 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: publish

on:
push:
tags:
- '*'

jobs:
publish:
name: Publish new version to TER
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
env:
TYPO3_API_TOKEN: ${{ secrets.TYPO3_API_TOKEN }}

steps:
# Tags are fetched in full: the release comment below is read back off the
# annotated tag, which a shallow checkout would not carry.
- name: Checkout repository
uses: actions/checkout@v7
with:
fetch-depth: 0

# Only ever publish plain x.y.z tags - TER has no concept of pre-releases, and a
# typo in a tag name would otherwise be published under whatever it happened to say.
- name: Check tag
run: |
if ! [[ "${GITHUB_REF}" =~ ^refs/tags/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then
echo "Refusing to publish '${GITHUB_REF}': expected a tag of the form 1.2.3."
exit 1
fi

- name: Get version
id: get-version
run: echo "version=${GITHUB_REF#refs/tags/}" >> "$GITHUB_OUTPUT"

# The annotated tag's own message becomes the TER upload comment, so a release can
# be described where it is created. Falls back to a generic line for a lightweight tag.
- name: Get comment
id: get-comment
run: |
comment=$(git tag -n10 -l "${{ steps.get-version.outputs.version }}" | sed 's/^[0-9.]*[ ]*//g')
if [[ -z "${comment// }" ]]; then
comment="Released version ${{ steps.get-version.outputs.version }} of ai_label"
fi
{
echo "comment<<EOF"
echo "${comment}"
echo "EOF"
} >> "$GITHUB_OUTPUT"

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
extensions: intl, mbstring, json, zip, curl

- name: Install tailor
run: composer global require typo3/tailor --prefer-dist --no-progress

- name: Publish to TER
run: >
php ~/.composer/vendor/bin/tailor ter:publish
--comment "${{ steps.get-comment.outputs.comment }}"
"${{ steps.get-version.outputs.version }}"
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"web-dir": ".Build/Web",
"app-dir": ".Build",
"extension-key": "ai_label",
"version": "0.0.1",
"version": "1.0.0",
"Package": {
"providesPackages": {}
}
Expand Down
2 changes: 1 addition & 1 deletion ext_emconf.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
'author_email' => 'typo3@b13.com',
'author_company' => 'b13 GmbH',
'state' => 'stable',
'version' => '0.0.1',
'version' => '1.0.0',
'constraints' => [
'depends' => [
'typo3' => '13.4.0-14.99.99',
Expand Down