Skip to content

Commit

Permalink
Merge branch 'release-5.7.5'
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions committed Mar 24, 2021
2 parents 289e139 + 6984222 commit 93e78a7
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 10 deletions.
75 changes: 67 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,77 @@
name: Relese Tao extension

on:
push:
pull_request:
branches:
- develop
types: [closed]
jobs:
auto-release:
if: github.event.pull_request.merged == true
name: Automated Tao extension release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Release
uses: oat-sa/extension-release-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
with:
github_token: ${{ secrets.GH_TOKEN }}
- name: Checkout code
uses: actions/checkout@v2

# Install PHP, composer v2
- name: Setup PHP,
uses: shivammathur/setup-php@v2
with:
php-version: '7.2'
tools: composer:v2
env:
COMPOSER_TOKEN: ${{ secrets.GH_TOKEN }}

# Prepare composer.json file
- name: Prepare composer file
run: |
php -r '$composerArray = json_decode(file_get_contents("./composer.json"), true);
$composerArray["require"][$composerArray["name"]] = "dev-develop";
$composerArray["repositories"] = array_key_exists("repositories", $composerArray) ? $composerArray["repositories"] : [];
$composerArray["repositories"][] = [
"type" => "vcs",
"url" => "https://github.com/".$composerArray["name"].".git"
];
unset($composerArray["name"]);
file_put_contents("./composer-release.json", json_encode($composerArray, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES));'
# Composer Install
- name: Install dependencies
run: |
COMPOSER=composer-release.json composer install --no-dev --no-interaction --prefer-source
# Prepare to release
- name: Prepare to release
run: |
mkdir -p taoQtiItem/views/js/mathjax/
touch taoQtiItem/views/js/mathjax/MathJax.js
mkdir -p tao/views/locales/en-US/
echo '{"serial":"9","date":1615820392,"version":"3.3.0-9","translations":{}}' > tao/views/locales/en-US/messages.json
touch index.php
mkdir -p config/
# Install node
- name: Use Node.js 12.x
uses: actions/setup-node@v1
with:
node-version: 12.x

# Do release
- name: Release Tao Extension
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
run: |
npm i -g @oat-sa/tao-extension-release
REPO_NAME=$(jq --raw-output '."name"' composer.json)
EXT_ID=$(jq --raw-output '.extra."tao-extension-name"' composer.json)
cd $EXT_ID
git config --global user.name github-actions
git config --global user.email [email protected]
git config --global url."https://github.com/".insteadOf [email protected]:
git config --global url."https://".insteadOf git://
git config --global url."https://github.com/".insteadOf ssh://[email protected]/
git remote set-url --push origin https://${GITHUB_TOKEN}@github.com/$REPO_NAME.git
git checkout .
cd ..
taoRelease extensionRelease --extension-to-release ${EXT_ID} --no-interactive --no-write
4 changes: 4 additions & 0 deletions views/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions views/package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{

"name": "@oat-sa/tao-foobar",
"description": "taoFooBar frontend modules",
"repository": {
"type": "git",
"url": "git+https://github.com/oat-sa/extension-tao-foobar.git"
},
"dependencies": {
"npm-dummy-package": "~1.0.1"
"npm-dummy-package": "~1.0.1",
"eve": "git://github.com/adobe-webplatform/eve.git#eef80ed"
}
}

0 comments on commit 93e78a7

Please sign in to comment.