-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #403 from Yoast/task/ter-releases
[TASK] Implement auto release to TYPO3 Extension Repository
- Loading branch information
Showing
7 changed files
with
87 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
name: TYPO3 Extension Repository | ||
|
||
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 | ||
php -v | ||
- name: Update Composer | ||
run: | | ||
sudo composer self-update | ||
composer --version | ||
- name: Composer Install | ||
run: | | ||
composer install | ||
- name: Create token | ||
run: | | ||
rm -f token.txt | ||
echo "Create token..." | ||
TYPO3_API_USERNAME=${{ secrets.TYPO3_API_USERNAME }} TYPO3_API_PASSWORD=${{ secrets.TYPO3_API_PASSWORD }} vendor/bin/tailor ter:token:create --name="token for yoast_seo" --extensions=yoast_seo --expires=300 --no-ansi > token.txt | ||
echo "And wait for token to be active... (60s)" | ||
sleep 60s | ||
- name: Get version | ||
id: get-version | ||
run: | | ||
echo ::set-output name=version::${GITHUB_REF/refs\/tags\//} | ||
- name: Get comment | ||
id: get-comment | ||
run: | | ||
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 EXT:yoast_seo | ||
else | ||
echo ::set-output name=comment::$comment | ||
fi | ||
- 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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters