Skip to content

Commit

Permalink
Fix ci
Browse files Browse the repository at this point in the history
  • Loading branch information
kekefreedog committed Oct 29, 2023
1 parent edfe1f6 commit 83f1123
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 36 deletions.
28 changes: 4 additions & 24 deletions .github/workflows/publishing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,9 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
node-version: '14'
- name: Install jq
run: sudo apt-get install -y jq
php-version: '7.4'
- name: Run custom script to update versions
run: bash ./scripts/update-versions.sh "${{ github.event.release.tag_name }}"

# If there's an updated version of version-composer that resolves the add-path issue, use it here:
# version-composer:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout code
# uses: actions/checkout@v2
# - name: Version Composer
# uses: juliansangillo/version-composer@<new-version>

# If the update-package-version action requires a tag without the 'v' prefix, you might need to adjust your tagging scheme or find an alternative action.
# update-package-version:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout code
# - uses: actions/checkout@v2
# - name: Update package.json version on release
# - uses: medallyon/update-package-version-on-release@v1
run: php ./scripts/update-versions.php "${{ github.event.release.tag_name }}"
18 changes: 18 additions & 0 deletions .github/workflows/scripts/update-versions.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// scripts/update-versions.php

<?php

// Get the version from the GitHub release tag, removing the 'v' prefix if present
$version = ltrim($argv[1], 'v');

// Update composer.json
$composerJson = json_decode(file_get_contents('composer.json'), true);
$composerJson['version'] = $version;
file_put_contents('composer.json', json_encode($composerJson, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES));

// Update package.json
$packageJson = json_decode(file_get_contents('package.json'), true);
$packageJson['version'] = $version;
file_put_contents('package.json', json_encode($packageJson, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES));

?>
12 changes: 0 additions & 12 deletions .github/workflows/scripts/update-versions.sh

This file was deleted.

0 comments on commit 83f1123

Please sign in to comment.