Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: add exit codes #175

Merged
merged 1 commit into from
Mar 26, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 8 additions & 64 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,67 +13,11 @@ jobs:
name: Automated Tao extension release
runs-on: ubuntu-latest
steps:
- 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 github-actions@github.com
git config --global url."https://github.com/".insteadOf git@github.com:
git config --global url."https://".insteadOf git://
git config --global url."https://github.com/".insteadOf ssh://git@github.com/
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
- name: Checkout
uses: actions/checkout@v2
- name: Release
uses: oat-sa/extension-release-action@v0
env:
DEFAULT_BRANCH: ${{ secrets.GH_TOKEN }}
with:
github_token: ${{ secrets.GH_TOKEN }}