Release 12.0.1 #212
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: build | |
on: | |
push: | |
branches: [ 'main', 'release-12.0.x', 'release-11.0.x', 'release-10.0.x' ] | |
tags: | |
- "**" | |
pull_request: | |
branches: [ 'main', 'release-12.0.x', 'release-11.0.x', 'release-10.0.x' ] | |
env: | |
CI_BUILD_DIRECTORY: '/home/runner/work/ext-tika/ext-tika/.Build' | |
TIKA_PATH: '/home/runner/work/ext-tika/ext-tika/.Build/data-tika-binaries' | |
SOLR_IMAGE_TAG: '12.0.x-dev' | |
SOLR_CONTAINER_NAME: 'solrci-container' | |
TESTING_SOLR_PORT: 8983 | |
SOLR_VOLUME_NAME: 'solrci-volume' | |
SOLR_VOLUME_PATH: '/home/runner/work/ext-tika/ext-tika/.Build/data-solr' | |
jobs: | |
tests: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
PHP: [ '8.1', '8.2', '8.3' ] | |
TYPO3: [ '^12.4', '12.4.x-dev' ] | |
env: | |
TYPO3_DATABASE_NAME: 'typo3_ci' | |
TYPO3_DATABASE_HOST: '127.0.0.1' | |
TYPO3_DATABASE_USERNAME: 'root' | |
TYPO3_DATABASE_PASSWORD: 'root' | |
TYPO3_VERSION: ${{ matrix.TYPO3 }} | |
name: TYPO3 ${{ matrix.TYPO3 }} on PHP ${{ matrix.PHP }} | |
steps: | |
# Workaround for issue with actions/checkout@v2 wrong PR commit checkout: See https://github.com/actions/checkout/issues/299#issuecomment-677674415 | |
- | |
name: Checkout current state of Pull Request | |
if: github.event_name == 'pull_request' | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 2 | |
ref: ${{ github.event.pull_request.head.sha }} | |
- | |
name: Checkout current state of Branch | |
if: github.event_name == 'push' | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 2 | |
# End: Workaround for issue with actions/checkout@v2 wrong PR commit checkout | |
- | |
name: Cache Apache Tika Binaries | |
id: tika-binaries | |
uses: actions/cache@v2 | |
with: | |
path: $TIKA_PATH | |
key: tika-binaries | |
- | |
name: Mount RAMFS | |
run: | | |
sudo mkdir -p ${{ env.CI_BUILD_DIRECTORY }} | |
sudo mount -t tmpfs -o size=2560m none ${{ env.CI_BUILD_DIRECTORY }} | |
sudo mkdir -p ${{ env.CI_BUILD_DIRECTORY }}/data-{solr,mysql,tika-binaries} \ | |
&& sudo chown $USER ${{ env.CI_BUILD_DIRECTORY }}/data-{mysql,tika-binaries} \ | |
&& sudo chown 8983:8983 ${{ env.CI_BUILD_DIRECTORY }}/data-solr | |
- | |
name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.PHP }} | |
coverage: pcov | |
tools: composer:v2 | |
- | |
name: 'Start Docker: Solr, Tika, MySQL' | |
run: | | |
docker run --name "MySQL-CI" -v ${{ env.CI_BUILD_DIRECTORY }}/data-mysql:/var/lib/mysql -p 3306:3306 \ | |
-e MYSQL_DATABASE=$TYPO3_DATABASE_NAME \ | |
-e MYSQL_ROOT_PASSWORD=$TYPO3_DATABASE_PASSWORD \ | |
-d mysql:8.0 mysqld --default-authentication-plugin=mysql_native_password | |
sudo chmod g+w "$SOLR_VOLUME_PATH" | |
docker volume create --name "$SOLR_VOLUME_NAME" --opt type=none --opt device="$SOLR_VOLUME_PATH" --opt o=bind | |
docker run --rm --name="$SOLR_CONTAINER_NAME" -d -p 127.0.0.1:8983:8983 -v "$SOLR_VOLUME_NAME":"/var/solr" "typo3solr/ext-solr:$SOLR_IMAGE_TAG" | |
docker run -d -p 9998:9998 apache/tika:$(composer tika:req:tika)"-full" | |
docker ps | |
- | |
name: CI-Bootstrap | |
run: | | |
composer info | |
composer tests:setup && composer tests:setup:global-require | |
echo "Current Size of EXT:tika build Artefacts: " \ | |
&& sudo du -sh "${{ env.CI_BUILD_DIRECTORY }}" | |
- | |
name: CI-Build | |
run: | | |
./.Build/vendor/apache-solr-for-typo3/solr/Build/Test/cibuild.sh | |
echo "Current Size of EXT:tika build Artefacts: " \ | |
&& sudo du -sh $CI_BUILD_DIRECTORY/ \ | |
&& sudo du -sh $CI_BUILD_DIRECTORY/* | |
publish: | |
name: Publish new version to TER | |
needs: tests | |
if: startsWith(github.ref, 'refs/tags/') | |
runs-on: ubuntu-20.04 | |
env: | |
TYPO3_API_TOKEN: ${{ secrets.TYPO3_API_TOKEN }} | |
steps: | |
- | |
name: Checkout repository | |
uses: actions/checkout@v2 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
- | |
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: 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 -n99 -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:tika | |
else | |
echo ::set-output name=comment::$comment | |
fi | |
- | |
name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: 8.1 | |
extensions: intl, mbstring, json, zip, curl | |
tools: composer:v2 | |
- | |
name: Install tailor | |
run: composer global require typo3/tailor --prefer-dist --no-progress | |
- | |
name: Publish EXT:tika to TER | |
run: | | |
export RELEASE_VERSION=${GITHUB_REF/refs\/tags\//} | |
export TER_COMMENT=$(git tag -n99 -l "$RELEASE_VERSION" | sed "s/^[0-9.]*[ ]*//g") | |
if [[ -z "${TER_COMMENT// }" ]]; then | |
export TER_COMMENT="Released version $RELEASE_VERSION of EXT:tika" | |
fi | |
echo "Following message will be printed in TER as release description:" | |
echo -e "$TER_COMMENT" | |
php ~/.composer/vendor/bin/tailor ter:publish --comment "$TER_COMMENT" "$RELEASE_VERSION" | |