From b733f59a0c349336993fae4b376bbcfd8930a7a5 Mon Sep 17 00:00:00 2001 From: Fadi Asbih Date: Thu, 14 Nov 2024 21:16:14 +0200 Subject: [PATCH] fix: update for ilias9 --- .github/scripts/update_readme_version.sh | 27 +++++++++++++++++++ .github/workflows/release-please.yml | 33 ++++++++++++++++++++++++ .gitignore | 1 + README.md | 4 +-- plugin.php | 6 ++--- 5 files changed, 66 insertions(+), 5 deletions(-) create mode 100755 .github/scripts/update_readme_version.sh create mode 100755 .github/workflows/release-please.yml create mode 100644 .gitignore diff --git a/.github/scripts/update_readme_version.sh b/.github/scripts/update_readme_version.sh new file mode 100755 index 0000000..229a844 --- /dev/null +++ b/.github/scripts/update_readme_version.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +# Get the latest version (assuming it's stored in a file or as a Git tag) +latest_version=$(git describe --tags `git rev-list --tags --max-count=1`) + +# Check if latest_version is not empty +if [ -z "$latest_version" ]; then + echo "Error: Could not determine latest version." + exit 1 +fi + +# Update the README.md file +sed -i "/^## Version/{N;s/.*/## Version\n$latest_version/}" README.md + + +# Check if README was updated +if ! git diff --exit-code --quiet README.md; then + # Configure Git (Replace with your details) + git config --global user.email "fadi@asbih.com" + git config --global user.name "Fadi Asbih" + + # Add and commit changes + git add README.md + git commit -m "chore: update version in README to $latest_version" +else + echo "No changes to README.md" +fi diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml new file mode 100755 index 0000000..1698398 --- /dev/null +++ b/.github/workflows/release-please.yml @@ -0,0 +1,33 @@ +on: + push: + branches: + - main + +permissions: + contents: write + pull-requests: write + +name: release-please + +jobs: + release-please: + runs-on: ubuntu-latest + steps: + - uses: google-github-actions/release-please-action@v4 + with: + token: ${{ secrets.MY_RELEASE_PLEASE_TOKEN }} + release-type: simple + + - name: Checkout code + uses: actions/checkout@v2 + with: + fetch-depth: 0 # Fetches all history for all branches and tags + + - name: Update README Version + run: bash .github/scripts/update_readme_version.sh + + - name: Push changes + uses: ad-m/github-push-action@master + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + branch: main diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9f11b75 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.idea/ diff --git a/README.md b/README.md index 1ff1e42..b39e094 100755 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ git clone https://github.com/iFadi/LUHShibAuth.git Now check a specific Tag: ```bash -git checkout v1.0.2 +git checkout v1.0.3 ``` Goto "Administration -> Plugin" and install and activate the plugin. @@ -40,4 +40,4 @@ to check if there are errors. #### v1.0.1: * Add falling back mechanism to the default ILIAS login, if "ext_account" is not available -* Login/Username is now all in capital \ No newline at end of file +* Login/Username is now all in capital diff --git a/plugin.php b/plugin.php index f543b4d..5b66759 100755 --- a/plugin.php +++ b/plugin.php @@ -2,11 +2,11 @@ // alphanumerical ID of the plugin; never change this $id = 'luhshibauth'; // code version; must be changed for all code changes -$version = '1.0.2'; +$version = '1.0.3'; // ilias min and max version; must always reflect the versions that should // run with the plugin -$ilias_min_version = "8.0"; -$ilias_max_version = "8.99"; +$ilias_min_version = "9.0"; +$ilias_max_version = "9.99"; // optional, but useful: Add one or more responsible persons and a contact email $responsible = "Stefan Meyer";