-
-
Notifications
You must be signed in to change notification settings - Fork 38
59 lines (51 loc) · 2.67 KB
/
Deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: Deploy
on:
push:
tags:
- "v?[0-9]+.[0-9]+.[0-9]+"
jobs:
Ship-to-TER:
name: 'Ship to TER'
if: github.repository == 'helhum/typoscript_rendering'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Composer Cache Vars
id: composer-cache-vars
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
echo "::set-output name=timestamp::$(date +"%s")"
- name: Cache Composer dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache-vars.outputs.dir }}
key: ${{ runner.os }}-composer-^11.5.5-stable-7.4-${{ steps.composer-cache-vars.outputs.timestamp }}
restore-keys: |
${{ runner.os }}-composer-^11.5.5-stable-7.4-
${{ runner.os }}-composer-^11.5.5-stable-
${{ runner.os }}-composer-^11.5.5-
${{ runner.os }}-composer-
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
coverage: none
- name: "Extract tag, branch, version from GITHUB_REF"
id: "github-ref"
run: |
echo "::set-output name=tag::$(echo $GITHUB_REF | sed -E -n 's#^refs/tags/(.*)$#\1#p')"
echo "::set-output name=branch::$(echo $GITHUB_REF | sed -E -n 's#^refs/heads/(.*)$#\1#p')"
echo "::set-output name=version::$(echo $GITHUB_REF | sed -E -n 's#^refs/tags/v?([0-9]+\.)([0-9]+\.)([0-9]+)#\1\2\3#p')"
- name: Deploy to TER
run: |
if [ -n "${{ secrets.TYPO3_ORG_USERNAME }}" ] && [ -n "${{ secrets.TYPO3_ORG_PASSWORD }}" ]; then
echo -e "Preparing upload of release ${{ steps.github-ref.outputs.version }} to TER\n";
# Install ter client
composer global require helhum/ter-client
PATH=$PATH:$(composer global config bin-dir --absolute --quiet);
# Upload
TAG_MESSAGE=$(git tag -n10 -l ${{ steps.github-ref.outputs.tag }} | sed 's/^[v]*[0-9.]*[ ]*//g')
echo "Uploading release ${{ steps.github-ref.outputs.version }} to TER"
ter-client upload typoscript_rendering . -u "${{ secrets.TYPO3_ORG_USERNAME }}" -p "${{ secrets.TYPO3_ORG_PASSWORD }}" -m "$TAG_MESSAGE"
fi;