From b49873f1761000c1d2f542b560107a4fc6a78586 Mon Sep 17 00:00:00 2001 From: Alexander Eimer Date: Wed, 25 Oct 2023 11:30:07 +0200 Subject: [PATCH] feat: put all CI code in shell files --- .ci-scripts/commit-push.sh | 14 ++++++++++++++ .ci-scripts/install-packages.sh | 12 ++++++++++++ .github/workflows/create-aliases.yml | 17 +++-------------- 3 files changed, 29 insertions(+), 14 deletions(-) create mode 100755 .ci-scripts/commit-push.sh create mode 100755 .ci-scripts/install-packages.sh diff --git a/.ci-scripts/commit-push.sh b/.ci-scripts/commit-push.sh new file mode 100755 index 0000000..f92e266 --- /dev/null +++ b/.ci-scripts/commit-push.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Enable debug - print commands +#set -x + +git config --global user.name 'QAware Homebrew Bot' +git config --global user.email 'qaware.homebrew.bot@qaware.de' +git add Aliases README.md +git commit --quiet -m "chore: update Aliases" || { + echo "Nothing to commit or commit failed, will exit now" + exit 0 +} +git push diff --git a/.ci-scripts/install-packages.sh b/.ci-scripts/install-packages.sh new file mode 100755 index 0000000..a987778 --- /dev/null +++ b/.ci-scripts/install-packages.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Enable debug - print commands +#set -x + +# Install yq +# https://github.com/marketplace/actions/yq-portable-yaml-processor +wget -q -O yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 +chmod +x yq +sudo mv yq /usr/bin/yq + diff --git a/.github/workflows/create-aliases.yml b/.github/workflows/create-aliases.yml index aa0f2e8..f155383 100644 --- a/.github/workflows/create-aliases.yml +++ b/.github/workflows/create-aliases.yml @@ -15,12 +15,9 @@ jobs: steps: - name: Check out repository code uses: actions/checkout@v4 + - name: Install packages - run: | - # https://github.com/marketplace/actions/yq-portable-yaml-processor - wget -q -O yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 - chmod +x yq - sudo mv yq /usr/bin/yq + run: .ci-scripts/install-packages.sh - name: Parse Formulas 1 run: .ci-scripts/parse-formulas.sh @@ -38,12 +35,4 @@ jobs: run: .ci-scripts/update-toc.sh - name: Commit & Push changes - run: | - git config --global user.name 'QAware Homebrew Bot' - git config --global user.email 'qaware.homebrew.bot@qaware.de' - git add Aliases README.md - git commit --quiet -m "chore: update Aliases" || { - echo "Nothing to commit or commit failed, will exit now" - exit 0 - } - git push + run: .ci-scripts/commit-push.sh