From 4137305acaccae9b0c6442a83bd57bf6e8eea56f Mon Sep 17 00:00:00 2001 From: Aleh Hutnikau Date: Fri, 26 Mar 2021 16:42:38 +0300 Subject: [PATCH 1/8] ci: add exit codes --- .github/workflows/release.yml | 72 ++++------------------------------- 1 file changed, 8 insertions(+), 64 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ef93de9..d4593d2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 \ No newline at end of file + - 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 }} From 13c7b6e4e3af0fb8a13f0778b14a739ce5fefbed Mon Sep 17 00:00:00 2001 From: Aleh Hutnikau Date: Fri, 26 Mar 2021 16:51:31 +0300 Subject: [PATCH 2/8] add github token env variable --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d4593d2..857a6fc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,6 +18,6 @@ jobs: - name: Release uses: oat-sa/extension-release-action@v0 env: - DEFAULT_BRANCH: ${{ secrets.GH_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} with: github_token: ${{ secrets.GH_TOKEN }} From f231505b1c812b1bc99162c46979ffe5b1dacdc8 Mon Sep 17 00:00:00 2001 From: Aleh Hutnikau Date: Fri, 26 Mar 2021 17:36:01 +0300 Subject: [PATCH 3/8] use commit hash --- .github/workflows/continous-integration.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/continous-integration.yml b/.github/workflows/continous-integration.yml index 2b2f24f..afccea0 100644 --- a/.github/workflows/continous-integration.yml +++ b/.github/workflows/continous-integration.yml @@ -15,6 +15,6 @@ jobs: - run: git fetch --unshallow --tags - name: Check commit if: always() - uses: oat-sa/conventional-commit-action@v0 + uses: oat-sa/conventional-commit-action@c49fc428210c16ff3879a00ee1128fbeeb96322a with: github_token: ${{ secrets.GITHUB_TOKEN }} From f0006905e56b51f4789c5607a31a8799d65c24f5 Mon Sep 17 00:00:00 2001 From: Aleh Hutnikau Date: Fri, 26 Mar 2021 17:45:36 +0300 Subject: [PATCH 4/8] fix: user hash --- .github/workflows/continous-integration.yml | 2 +- .github/workflows/release.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/continous-integration.yml b/.github/workflows/continous-integration.yml index afccea0..2b2f24f 100644 --- a/.github/workflows/continous-integration.yml +++ b/.github/workflows/continous-integration.yml @@ -15,6 +15,6 @@ jobs: - run: git fetch --unshallow --tags - name: Check commit if: always() - uses: oat-sa/conventional-commit-action@c49fc428210c16ff3879a00ee1128fbeeb96322a + uses: oat-sa/conventional-commit-action@v0 with: github_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 857a6fc..b52f491 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,7 +16,7 @@ jobs: - name: Checkout uses: actions/checkout@v2 - name: Release - uses: oat-sa/extension-release-action@v0 + uses: oat-sa/extension-release-action@ve5ab8169fb7bd960423d0eba05e032b5409559b0 env: GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} with: From 4bfd5a90f943d73b0d79479a6c318286c51c1c27 Mon Sep 17 00:00:00 2001 From: Aleh Hutnikau Date: Fri, 26 Mar 2021 17:48:44 +0300 Subject: [PATCH 5/8] fix: user hash --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b52f491..706388d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,7 +16,7 @@ jobs: - name: Checkout uses: actions/checkout@v2 - name: Release - uses: oat-sa/extension-release-action@ve5ab8169fb7bd960423d0eba05e032b5409559b0 + uses: oat-sa/extension-release-action@c49fc428210c16ff3879a00ee1128fbeeb96322a env: GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} with: From 9f417d53f9fd9f2976bbefd467030ddc45836f0c Mon Sep 17 00:00:00 2001 From: Aleh Hutnikau Date: Fri, 26 Mar 2021 17:52:12 +0300 Subject: [PATCH 6/8] ci: change hash --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 706388d..396d6e6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,7 +16,7 @@ jobs: - name: Checkout uses: actions/checkout@v2 - name: Release - uses: oat-sa/extension-release-action@c49fc428210c16ff3879a00ee1128fbeeb96322a + uses: oat-sa/extension-release-action@926e4ead3b4dc98413e29acf4f9ad4552515475f env: GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} with: From 7c86e4e1ec82813f081105519f54a69fca181e33 Mon Sep 17 00:00:00 2001 From: Aleh Hutnikau Date: Fri, 26 Mar 2021 17:55:47 +0300 Subject: [PATCH 7/8] ci: copy files to workspace directory --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 396d6e6..6f23f45 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,7 +16,7 @@ jobs: - name: Checkout uses: actions/checkout@v2 - name: Release - uses: oat-sa/extension-release-action@926e4ead3b4dc98413e29acf4f9ad4552515475f + uses: oat-sa/extension-release-action@3cda2820a98c595221da48adcbc42e0e2dcc721c env: GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} with: From 64e142532c52167e1315e1b7ff5e4c51ca36b5e2 Mon Sep 17 00:00:00 2001 From: Aleh Hutnikau Date: Mon, 29 Mar 2021 10:14:37 +0300 Subject: [PATCH 8/8] ci: change commit hash --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6f23f45..8bf1e14 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,7 +16,7 @@ jobs: - name: Checkout uses: actions/checkout@v2 - name: Release - uses: oat-sa/extension-release-action@3cda2820a98c595221da48adcbc42e0e2dcc721c + uses: oat-sa/extension-release-action@9773e29fac02e58c35ec456bab20f7ad9ec46678 env: GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} with: