[BUGFIX] Fix extension version of TYPO3 Console #299
Workflow file for this run
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
name: Update | |
on: [ push ] | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
Extension-Repo: | |
name: 'Extension Repo' | |
if: github.repository == 'TYPO3-Console/TYPO3-Console' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout main repo | |
uses: actions/checkout@v4 | |
with: | |
path: ./typo3-console | |
- name: Checkout extension repo | |
uses: actions/checkout@v4 | |
with: | |
repository: TYPO3-Console/Extension | |
token: ${{ secrets.EXTENSION_UPDATE_TOKEN }} | |
path: ./extension | |
- name: Composer Cache Vars | |
id: composer-cache-vars | |
run: | | |
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | |
echo "timestamp=$(date +"%s")" >> $GITHUB_OUTPUT | |
- name: Cache Composer dependencies | |
uses: actions/cache@v4 | |
with: | |
path: ${{ steps.composer-cache-vars.outputs.dir }} | |
key: ${{ runner.os }}-composer-^11.5.26-stable-8.1-${{ steps.composer-cache-vars.outputs.timestamp }} | |
restore-keys: | | |
${{ runner.os }}-composer-^11.5.26-stable-8.1- | |
${{ runner.os }}-composer-^11.5.26-stable- | |
${{ runner.os }}-composer-^11.5.26- | |
${{ runner.os }}-composer- | |
- name: Set up PHP Version 8.1 | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: 8.1 | |
tools: composer:v2 | |
coverage: none | |
- name: "Extract tag, branch, version from GITHUB_REF" | |
id: "github-ref" | |
run: | | |
echo "tag=$(echo $GITHUB_REF | sed -E -n 's#^refs/tags/(.*)$#\1#p')" >> $GITHUB_OUTPUT | |
echo "branch=$(echo $GITHUB_REF | sed -E -n 's#^refs/heads/(.*)$#\1#p')" >> $GITHUB_OUTPUT | |
echo "version=$(echo $GITHUB_REF | sed -E -n 's#^refs/tags/v?([0-9]+\.)([0-9]+\.)([0-9]+)#\1\2\3#p')" >> $GITHUB_OUTPUT | |
- name: Checkout extension branch | |
if: steps.github-ref.outputs.branch != '' | |
run: | | |
cd ./extension | |
git fetch origin && git checkout origin/${{ steps.github-ref.outputs.branch }} -b ${{ steps.github-ref.outputs.branch }} || true | |
cd - | |
- name: Package extension | |
run: | | |
cd ./typo3-console | |
composer extension-release | |
cd - | |
- name: Add extension changes | |
run: | | |
cd ./extension | |
git config user.email "[email protected]" | |
git config user.name "Helmut Hummel" | |
git checkout README.md | |
git add . | |
cd - | |
- name: Commit and push extension version | |
if: steps.github-ref.outputs.version != '' | |
run: | | |
cd ./extension | |
git commit -m "Release extension version ${{ steps.github-ref.outputs.version }}" | |
git tag ${{ steps.github-ref.outputs.tag }} | |
git push --tags | |
- name: Commit and push extension branch | |
if: steps.github-ref.outputs.branch != '' | |
run: | | |
cd ./extension | |
git commit -m "Update extension based on commit $GITHUB_SHA" | |
git push origin HEAD:${{ steps.github-ref.outputs.branch }} |