From d2df540c1f1bbe6a4d75b88884dfeda6dbe0a172 Mon Sep 17 00:00:00 2001 From: Craig Knudsen Date: Mon, 11 Sep 2023 15:22:24 -0400 Subject: [PATCH 01/11] Add GitHub workflow for creating releases on updates to the "release" branch --- .github/workflows/release.yml | 59 +++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000..9f90b50f8 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,59 @@ +name: Create Release + +on: + push: + branches: + - release + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Setup Node.js environment + uses: actions/setup-node@v2.1.2 + + - name: Get release version + run: echo "RELEASE_VERSION=$(./bump_version.sh -p)" >> $GITHUB_ENV + + - name: Create release directory + run: mkdir release-dir + + - name: Copy files to release directory + run: | + while IFS= read -r file; do + cp --parents "$file" release-dir/ + done < release-files + + - name: Zip the release + run: zip -r WebCalendar-${{ env.RELEASE_VERSION }}.zip release-dir/ + + - name: Create GitHub Release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: v${{ env.RELEASE_VERSION }} + release_name: WebCalendar v${{ env.RELEASE_VERSION }} + body: Release of WebCalendar v${{ env.RELEASE_VERSION }} + draft: false + prerelease: false + + - name: Upload Release Asset + uses: actions/upload-release-asset@v1.0.2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./WebCalendar-${{ env.RELEASE_VERSION }}.zip + asset_name: WebCalendar-${{ env.RELEASE_VERSION }}.zip + asset_content_type: application/zip + + - name: Tag the Release Branch + run: | + git tag v${{ env.RELEASE_VERSION }} + git push origin v${{ env.RELEASE_VERSION }} + From cf4a73b964e3e5f0532d00b1a73dc6faad93febd Mon Sep 17 00:00:00 2001 From: Craig Knudsen Date: Mon, 11 Sep 2023 15:27:51 -0400 Subject: [PATCH 02/11] Fixed list of files for release --- release-files | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/release-files b/release-files index 16a1becff..03e21a443 100644 --- a/release-files +++ b/release-files @@ -112,6 +112,7 @@ includes/css/access.css includes/css/docs.css includes/css/print_styles.css includes/css/punctuation.css +includes/css/rss-style.css includes/css/styles.css includes/css/styles.php includes/date_formats.php @@ -159,7 +160,6 @@ includes/site_extras.php includes/trailer.php includes/translate.php includes/user-app-joomla.php -includes/user-app-postnuke.php includes/user-imap.php includes/user-ldap.php includes/user-nis.php @@ -328,7 +328,6 @@ report.php resourcecal_mgmt.php rss_activity_log.php rss.php -rss-style.css rss_unapproved.php search_handler.php search.php From e936788236ae3341b1172d5655f67579daf17ca4 Mon Sep 17 00:00:00 2001 From: Craig Knudsen Date: Mon, 11 Sep 2023 15:31:56 -0400 Subject: [PATCH 03/11] Hopefully a fix for building the release --- .github/workflows/release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9f90b50f8..43e5fcb7d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -32,6 +32,7 @@ jobs: run: zip -r WebCalendar-${{ env.RELEASE_VERSION }}.zip release-dir/ - name: Create GitHub Release + id: create_release uses: actions/create-release@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 08dd7320bcf1c9163737b165f58879fd34b7e5fb Mon Sep 17 00:00:00 2001 From: Craig Knudsen Date: Mon, 11 Sep 2023 15:39:07 -0400 Subject: [PATCH 04/11] Adding release debug echo comments --- .github/workflows/release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 43e5fcb7d..a8da43893 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -25,6 +25,7 @@ jobs: - name: Copy files to release directory run: | while IFS= read -r file; do + echo "Copying $file" cp --parents "$file" release-dir/ done < release-files From 6d45152f5eb23a3e9e448a5f9595011d7479200a Mon Sep 17 00:00:00 2001 From: Craig Knudsen Date: Mon, 11 Sep 2023 15:46:52 -0400 Subject: [PATCH 05/11] Attempting to fix release process --- .github/workflows/release.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a8da43893..d37539dd2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -25,12 +25,12 @@ jobs: - name: Copy files to release directory run: | while IFS= read -r file; do - echo "Copying $file" - cp --parents "$file" release-dir/ + echo "Copying $file" + cp --parents "$file" WebCalendar-${{ env.RELEASE_VERSION }}/ done < release-files - name: Zip the release - run: zip -r WebCalendar-${{ env.RELEASE_VERSION }}.zip release-dir/ + run: zip -r WebCalendar-${{ env.RELEASE_VERSION }}.zip WebCalendar-${{ env.RELEASE_VERSION }}/ - name: Create GitHub Release id: create_release From 94a9e11e61bbcfa56c274295595d12a190414498 Mon Sep 17 00:00:00 2001 From: Craig Knudsen Date: Mon, 11 Sep 2023 15:49:34 -0400 Subject: [PATCH 06/11] Attempting to fix release process #2 --- .github/workflows/release.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d37539dd2..5243c4c2a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -26,7 +26,9 @@ jobs: run: | while IFS= read -r file; do echo "Copying $file" - cp --parents "$file" WebCalendar-${{ env.RELEASE_VERSION }}/ + # Ensure that the target directory structure exists + mkdir -p WebCalendar-1.9.8/$(dirname "$file") + cp "$file" WebCalendar-1.9.8/"$file" done < release-files - name: Zip the release From 80c1c82d905eccf055ae0807222502fe2fe851e4 Mon Sep 17 00:00:00 2001 From: Craig Knudsen Date: Tue, 12 Sep 2023 09:41:27 -0400 Subject: [PATCH 07/11] Updating workflow to build images for release and push to dockerhub --- .github/workflows/docker.yml | 8 ++++++-- .gitignore | 3 +++ bump_version.sh | 17 ----------------- 3 files changed, 9 insertions(+), 19 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 26545e7e2..197050c4b 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -2,7 +2,7 @@ name: Publish Docker image on: push: - branches: [ master ] + branches: [ release ] release: types: [ published ] @@ -14,6 +14,10 @@ jobs: - name: Check out the repo uses: actions/checkout@v4 + - name: Extract WebCalendar Version + id: extract_version + run: echo "::set-output name=version::$(./bump_version.sh -p)" + - name: Log in to Docker Hub uses: docker/login-action@v2 with: @@ -32,4 +36,4 @@ jobs: context: . file: ./docker/Dockerfile-php8 push: true - tags: ${{ secrets.DOCKER_HUB_USERNAME }}/webcalendar:v1.9.8-dev-php8 + tags: ${{ secrets.DOCKER_HUB_USERNAME }}/webcalendar:${{ steps.extract_version.outputs.version }}-php8-apache \ No newline at end of file diff --git a/.gitignore b/.gitignore index 9949d32eb..4adc06949 100644 --- a/.gitignore +++ b/.gitignore @@ -8,4 +8,7 @@ vendor *.orig *.save *.class +*.log *.jar +*.old +__pycache__ diff --git a/bump_version.sh b/bump_version.sh index 024c96488..167d32ee9 100755 --- a/bump_version.sh +++ b/bump_version.sh @@ -67,22 +67,6 @@ update_config_php() { -# Function to update version in .github/workflows/docker.yml -update_docker_yml() { - local file_path=".github/workflows/docker.yml" - local new_version="$1" - - # Get the line number containing the version tag - local line_num=$(grep -nE 'tags: \${{ secrets.DOCKER_HUB_USERNAME }}/webcalendar:[^ ]*-dev-php8' "$file_path" | cut -d: -f1) - - # If we found the line, update the version on that line - if [[ -n "$line_num" ]]; then - sed -i "${line_num}s|webcalendar:[^ ]*-dev-php8|webcalendar:${new_version}-dev-php8|" "$file_path" - fi - - echo "Updated $file_path to version $new_version" -} - # Function to update version in UPGRADING.html update_upgrading_html() { local file_path="UPGRADING.html" @@ -152,7 +136,6 @@ for file in "${sql_files[@]}"; do done update_config_php "$new_version" -update_docker_yml "$new_version" update_upgrading_html "$new_version" update_composer_json "$new_version" update_upgrade_matrix "$new_version" From 879ea8a8cec931c0e550cfa27250184326e5da86 Mon Sep 17 00:00:00 2001 From: Craig Knudsen Date: Tue, 12 Sep 2023 10:12:01 -0400 Subject: [PATCH 08/11] Updated docker image tags --- .github/workflows/docker.yml | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 197050c4b..44d90c228 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -24,16 +24,13 @@ jobs: username: ${{ secrets.DOCKER_HUB_USERNAME }} password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} - - name: Extract metadata (like version) from the repository - id: meta - uses: docker/metadata-action@v4 - with: - images: ${{ secrets.DOCKER_HUB_USERNAME }}/webcalendar - - name: Build and push Docker image uses: docker/build-push-action@v4 with: context: . file: ./docker/Dockerfile-php8 push: true - tags: ${{ secrets.DOCKER_HUB_USERNAME }}/webcalendar:${{ steps.extract_version.outputs.version }}-php8-apache \ No newline at end of file + tags: | + ${{ secrets.DOCKER_HUB_USERNAME }}/webcalendar:${{ steps.extract_version.outputs.version }}-php8-apache + ${{ secrets.DOCKER_HUB_USERNAME }}/webcalendar:latest-php8-apache + ${{ secrets.DOCKER_HUB_USERNAME }}/webcalendar:latest From 328891fe8f82d28c37f396cc44951ae78164df01 Mon Sep 17 00:00:00 2001 From: Craig Knudsen Date: Tue, 12 Sep 2023 10:37:59 -0400 Subject: [PATCH 09/11] Don't fail if git tag already exists --- .github/workflows/release.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5243c4c2a..cea1a31ba 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,9 +13,6 @@ jobs: - name: Checkout code uses: actions/checkout@v2 - - name: Setup Node.js environment - uses: actions/setup-node@v2.1.2 - - name: Get release version run: echo "RELEASE_VERSION=$(./bump_version.sh -p)" >> $GITHUB_ENV @@ -26,7 +23,6 @@ jobs: run: | while IFS= read -r file; do echo "Copying $file" - # Ensure that the target directory structure exists mkdir -p WebCalendar-1.9.8/$(dirname "$file") cp "$file" WebCalendar-1.9.8/"$file" done < release-files @@ -58,6 +54,12 @@ jobs: - name: Tag the Release Branch run: | + # Check if the tag exists + if git rev-parse "v${{ env.RELEASE_VERSION }}" >/dev/null 2>&1; then + echo "Tag exists, deleting..." + git tag -d "v${{ env.RELEASE_VERSION }}" + git push --delete origin "v${{ env.RELEASE_VERSION }}" + fi + # Create and push the tag git tag v${{ env.RELEASE_VERSION }} - git push origin v${{ env.RELEASE_VERSION }} - + git push origin v${{ env.RELEASE_VERSION }} \ No newline at end of file From e6d9f07d1b708260047e1cc26eb7e90affe80f5d Mon Sep 17 00:00:00 2001 From: Craig Knudsen Date: Tue, 12 Sep 2023 10:43:19 -0400 Subject: [PATCH 10/11] Another attempt at fixing error on existing tag --- .github/workflows/release.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cea1a31ba..251a406bc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -30,6 +30,15 @@ jobs: - name: Zip the release run: zip -r WebCalendar-${{ env.RELEASE_VERSION }}.zip WebCalendar-${{ env.RELEASE_VERSION }}/ + - name: Check and Delete Existing Tag + run: | + # Check if the tag exists + if git rev-parse "v${{ env.RELEASE_VERSION }}" >/dev/null 2>&1; then + echo "Tag exists, deleting..." + git tag -d "v${{ env.RELEASE_VERSION }}" + git push --delete origin "v${{ env.RELEASE_VERSION }}" + fi + - name: Create GitHub Release id: create_release uses: actions/create-release@v1 From 8a5cfcd9b2b769b9d872cd1f084b8d274f529a24 Mon Sep 17 00:00:00 2001 From: Craig Knudsen Date: Tue, 12 Sep 2023 10:50:17 -0400 Subject: [PATCH 11/11] Updated composer.lock --- composer.lock | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/composer.lock b/composer.lock index 2b8d3603a..13c1139a0 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "a1b2c3ebd99952ed9030de51e6422314", + "content-hash": "7138a3f201af89ef5048eb1cc8ce7591", "packages": [ { "name": "ckeditor/ckeditor", @@ -481,16 +481,16 @@ }, { "name": "phpunit/php-code-coverage", - "version": "9.2.27", + "version": "9.2.28", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "b0a88255cb70d52653d80c890bd7f38740ea50d1" + "reference": "7134a5ccaaf0f1c92a4f5501a6c9f98ac4dcc0ef" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/b0a88255cb70d52653d80c890bd7f38740ea50d1", - "reference": "b0a88255cb70d52653d80c890bd7f38740ea50d1", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/7134a5ccaaf0f1c92a4f5501a6c9f98ac4dcc0ef", + "reference": "7134a5ccaaf0f1c92a4f5501a6c9f98ac4dcc0ef", "shasum": "" }, "require": { @@ -547,7 +547,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.27" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.28" }, "funding": [ { @@ -555,7 +555,7 @@ "type": "github" } ], - "time": "2023-07-26T13:44:30+00:00" + "time": "2023-09-12T14:36:20+00:00" }, { "name": "phpunit/php-file-iterator", @@ -800,16 +800,16 @@ }, { "name": "phpunit/phpunit", - "version": "9.6.11", + "version": "9.6.12", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "810500e92855eba8a7a5319ae913be2da6f957b0" + "reference": "a122c2ebd469b751d774aa0f613dc0d67697653f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/810500e92855eba8a7a5319ae913be2da6f957b0", - "reference": "810500e92855eba8a7a5319ae913be2da6f957b0", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/a122c2ebd469b751d774aa0f613dc0d67697653f", + "reference": "a122c2ebd469b751d774aa0f613dc0d67697653f", "shasum": "" }, "require": { @@ -824,7 +824,7 @@ "phar-io/manifest": "^2.0.3", "phar-io/version": "^3.0.2", "php": ">=7.3", - "phpunit/php-code-coverage": "^9.2.13", + "phpunit/php-code-coverage": "^9.2.28", "phpunit/php-file-iterator": "^3.0.5", "phpunit/php-invoker": "^3.1.1", "phpunit/php-text-template": "^2.0.3", @@ -883,7 +883,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.11" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.12" }, "funding": [ { @@ -899,7 +899,7 @@ "type": "tidelift" } ], - "time": "2023-08-19T07:10:56+00:00" + "time": "2023-09-12T14:39:31+00:00" }, { "name": "sebastian/cli-parser",