Skip to content

Commit

Permalink
[TASK] Implement auto release to TYPO3 Extension Repository
Browse files Browse the repository at this point in the history
  • Loading branch information
Richard Haeser committed Dec 23, 2020
1 parent 78f637f commit 048e620
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 10 deletions.
10 changes: 10 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,16 @@ At this point you're waiting on us to merge your pull request. We'll review all

Some issues are labeled "Patch-welcome". This means we see the value in the particular enhancement being suggested but have decided for now not to prioritize it. If you however decide to write a patch for it we'll gladly include it after some code review.

## Releasing a new version of the extension

To release a new version of the extension, you should follow these steps:
1. Make sure the `CHANGELOG.md` is updated
2. Make sure the new version is updated in `ext_emconf.php`
3. All latest code should be in the `master` branch
4. Create a new release and use the syntax `x.y.z` for the title of the release as well as the title of the tag.
5. A GitHub action `Publish new version to TER` should be triggered and will make sure the new version is released to TER
6. Check for the new version on https://packagist.org/packages/yoast-seo-for-typo3/yoast_seo

# Additional Resources
* [General GitHub Documentation](http://help.github.com/)
* [GitHub Pull Request documentation](http://help.github.com/send-pull-requests/)
22 changes: 12 additions & 10 deletions .github/workflows/ter.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,23 @@
name: TYPO3 Extension Repository

on: [push]
on:
push:
tag:

jobs:
publish:
name: Publish new version to TER
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-20.04
steps:
- name: Checkout repository
uses: actions/checkout@v2

- 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
- name: Set up PHP Version
run: |
sudo update-alternatives --set php /usr/bin/php7.4
Expand Down Expand Up @@ -43,16 +51,10 @@ jobs:
readonly local comment=$(git tag -n10 -l ${{ steps.get-version.outputs.version }} | sed "s/^[0-9.]*[ ]*//g")
if [[ -z "${comment// }" ]]; then
echo ::set-output name=comment::Released version ${{ steps.get-version.outputs.version }} of ${{ env.TYPO3_EXTENSION_KEY }}
echo ::set-output name=comment::Released version ${{ steps.get-version.outputs.version }} of EXT:yoast_seo
else
echo ::set-output name=comment::$comment
fi
- name: Check versions
run: |
TYPO3_API_USERNAME=${{ secrets.TYPO3_API_USERNAME }} TYPO3_API_PASSWORD=${{ secrets.TYPO3_API_PASSWORD }} TYPO3_API_TOKEN=$(awk '/Access token:(.*)/ { print $3 }' token.txt) vendor/bin/tailor ter:versions yoast_seo --no-ansi -vvv
- name: Debug
run: |
echo "Version: ${{ steps.get-version.outputs.version }}"
echo "Comment: ${{ steps.get-comment.outputs.comment }}"
- name: Publish to TER
run: TYPO3_API_USERNAME=${{ secrets.TYPO3_API_USERNAME }} TYPO3_API_PASSWORD=${{ secrets.TYPO3_API_PASSWORD }} TYPO3_API_TOKEN=$(awk '/Access token:(.*)/ { print $3 }' token.txt) vendor/bin/tailor ter:publish --comment "${{ steps.get-comment.outputs.comment }}" ${{ steps.get-version.outputs.version }}

0 comments on commit 048e620

Please sign in to comment.