Skip to content

Commit

Permalink
[RELEASE] Version 2.0.0
Browse files Browse the repository at this point in the history
This release switches from helhum/ter-client to typo3/tailor. 
This allows us to use tokens instead of user/password
  • Loading branch information
tomasnorre committed Jan 21, 2021
1 parent bb591ec commit 5462a6a
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 37 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/DockerHub.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: "Update Docker Images"

on: [ push, pull_request ]

jobs:
MoveTag:
name: "Docker Image"
runs-on: "ubuntu-latest"
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Docker Login
run: docker login --username=${{ secrets.DOCKER_HUB_USERNAME }} --password=${{ secrets.DOCKER_HUB_PASSWORD }}

- name: Docker Build
run: docker build -t tomasnorre/typo3teruploader:latest Docker/

- name: Docker Push
run: docker push tomasnorre/typo3teruploader:latest
24 changes: 24 additions & 0 deletions Docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM composer:2
FROM bash:5
FROM php:7.4-alpine

# copy from the images into the PHP Image
COPY --from=composer /usr/bin/composer /usr/bin/composer
COPY --from=bash /usr/local/bin/bash /usr/bin/bash

COPY entrypoint.sh /entrypoint.sh

RUN apk update && apk upgrade && \
apk add bash git jq libxml2-dev libzip-dev icu-dev curl && \
rm -rf /var/cache/apk/*

RUN docker-php-ext-install soap && \
docker-php-ext-install zip && \
docker-php-ext-configure intl && docker-php-ext-install intl

RUN echo -e "Install typo3/tailor" && \
composer global require typo3/tailor --prefer-dist --no-progress --no-suggest

RUN ln -nfs /root/.composer/vendor/typo3/tailor/bin/tailor /usr/bin/tailor

ENTRYPOINT ["/entrypoint.sh"]
17 changes: 8 additions & 9 deletions entrypoint.sh → Docker/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

echo -e "Preparing upload of release ${GITHUB_REF#refs/tags/} to TER\n";

echo -e "Install helhum/ter-client"
composer global require helhum/ter-client
# Prepare Tag information
TAG_WITHOUT_V=$(echo ${GITHUB_REF#refs/tags/} | sed 's/v//');
TAG_MESSAGE=$(git log -1 --pretty=%B)

echo -e "Preparing Release"
COMPOSER_PREPARE_RELEASE=$(cat composer.json | jq '.scripts."prepare-release"')
Expand All @@ -16,14 +17,12 @@ else
fi

# Fetch extension-key from composer.json
EXTKEY=$(cat composer.json | jq '.extra."typo3/cms"."extension-key"')
export TYPO3_EXTENSION_KEY=$(cat composer.json | jq '.extra."typo3/cms"."extension-key"' | tr -d '"')
export TYPO3_API_TOKEN=$1

if [ -z "$EXTKEY" ]
if [ -z "$TYPO3_EXTENSION_KEY" ]
then
echo "You have to set your extensionkey in composer.json, this will soon be mandatory in all TYPO3 Extensions., see README.md"
echo "You have to set your extension-key in composer.json, this will soon be mandatory in all TYPO3 Extensions., see README.md"
fi

TAG_MESSAGE=$(git log -1 --pretty=%B)

$HOME/.composer/vendor/helhum/ter-client/ter-client upload $EXTKEY . -u "$1" -p "$2" -m "$TAG_MESSAGE"

tailor ter:publish --comment="$TAG_MESSAGE" $TAG_WITHOUT_V
17 changes: 1 addition & 16 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1 @@
FROM composer:2
FROM bash:5
FROM php:7.4-alpine

# copy from the images into the PHP Image
COPY --from=composer /usr/bin/composer /usr/bin/composer
COPY --from=bash /usr/local/bin/bash /usr/bin/bash

COPY entrypoint.sh /entrypoint.sh

RUN apk update && apk upgrade && \
apk add bash git jq libxml2-dev && rm -rf /var/cache/apk/*

RUN docker-php-ext-install soap

ENTRYPOINT ["/entrypoint.sh"]
FROM tomasnorre/typo3teruploader:latest
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,14 @@ jobs:
fail-fast: false
steps:
- uses: actions/checkout@v1
- uses: tomasnorre/typo3-upload-ter@v1
- uses: tomasnorre/typo3-upload-ter@v2
with:
username: ${{ secrets.TYPO3_ORG_USERNAME }}
password: ${{ secrets.TYPO3_ORG_PASSWORD }}
api-token: ${{ secrets.TYPO3_API_TOKEN }}
```

### Requirement

You have to set your extensionkey in `composer.json`, this will soon be mandatory in all TYPO3 Extensions.
You have to set your extension-key in `composer.json`, this will soon be mandatory in all TYPO3 Extensions.

https://docs.typo3.org/m/typo3/reference-coreapi/master/en-us/ExtensionArchitecture/ComposerJson/Index.html#extra

Expand All @@ -39,6 +38,10 @@ https://docs.typo3.org/m/typo3/reference-coreapi/master/en-us/ExtensionArchitect
},
```

### Information

The commit message will be you commit message of your `tag`, both `X.Y.Z` and `vX.Y.Z`-formatted tags are accepted.

### Recommendation

It's recommended to add a `prepare-release` to your composer.json `script`-section, if this exists it will run before zipping and uploading.
Expand Down
11 changes: 3 additions & 8 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,12 @@ branding:
icon: upload
color: orange
inputs:
username: # id of input
description: 'Your TYPO3 Username - Use github.secrets'
required: true
default: ''
password: # id of input
description: 'Your TYPO3 Password - Use github.secrets'
api-token: # id of input
description: 'Your TYPO3 API Token - Use github.secrets'
required: true
default: ''
runs:
using: 'docker'
image: 'Dockerfile'
args:
- ${{ inputs.username }}
- ${{ inputs.password }}
- ${{ inputs.api-token }}

0 comments on commit 5462a6a

Please sign in to comment.