Skip to content

Commit

Permalink
trigger positive build
Browse files Browse the repository at this point in the history
  • Loading branch information
Ayesh committed Dec 6, 2024
1 parent 4b4df9f commit f1e2471
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 79 deletions.
45 changes: 35 additions & 10 deletions .github/workflows/sync-pr.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: Sync and PR

permissions:
contents: write
id-token: write
attestations: write

on:
workflow_dispatch:
workflow_call:
Expand Down Expand Up @@ -44,7 +48,12 @@ jobs:
else
echo "new_version=none" >> $GITHUB_OUTPUT
fi
- name: Add job summary when new releases are found
if: contains('none', steps.version_update.outputs.new_version) == true
run: |
run: echo 'No new releases found.' >> $GITHUB_STEP_SUMMARY
- name: Clone PHPWatch/winget-pkgs
uses: actions/checkout@v4
if: contains('none', steps.version_update.outputs.new_version) == false
Expand All @@ -71,6 +80,11 @@ jobs:
if: contains('none', steps.version_update.outputs.new_version) == false
run: find winget-pkgs/manifests/p/PHP/PHP | sed -e "s/[^-][^\/]*\// |/g" -e "s/|\([^ ]\)/|-\1/"

- uses: actions/attest-build-provenance@v2
id: attest
with:
subject-path: builder/manifests/p/PHP/PHP/${{ matrix.php-version-major }}/${{ matrix.php-version-minor }}

- name: Generate commit message
id: commit_msg
if: contains('none', steps.version_update.outputs.new_version) == false
Expand All @@ -79,29 +93,34 @@ jobs:
echo "commit_msg<<$EOF" >> $GITHUB_OUTPUT
cat builder/winget-commit-message.md >> $GITHUB_OUTPUT
echo "$EOF" >> $GITHUB_OUTPUT
echo "--New Version--"
echo ${{ steps.version_update.outputs.new_version }}
echo "${{ steps.version_update.outputs.new_version }}" | wc -c
echo "-${{ steps.version_update.outputs.new_version }}-" | wc -c
echo "-${{ steps.version_update.outputs.new_version }}-"
echo "## New Version" >> $GITHUB_STEP_SUMMARY
echo "${{ steps.version_update.outputs.new_version }}" >> $GITHUB_STEP_SUMMARY
echo "## Commit message" >> $GITHUB_STEP_SUMMARY
cat builder/winget-commit-message.md >> $GITHUB_STEP_SUMMARY
echo "## PR Content" >> $GITHUB_STEP_SUMMARY
cat builder/winget-pr-template.md >> $GITHUB_STEP_SUMMARY
- name: Remove old files from winget-pkgs
if: contains('none', steps.version_update.outputs.new_version) == false
run: |
rm -r winget-pkgs/manifests/p/PHP/PHP/${{ matrix.php-version-major }}/${{ matrix.php-version-minor }}
cp -r builder/manifests/p/PHP/PHP/${{ matrix.php-version-major }}/${{ matrix.php-version-minor }} winget-pkgs/manifests/p/PHP/PHP/${{ matrix.php-version-major }}/${{ matrix.php-version-minor }}
- name: Commit data
- name: Commit data to own repo
uses: stefanzweifel/git-auto-commit-action@v5
if: contains('none', steps.version_update.outputs.new_version) == false
with:
commit_message: ${{ steps.commit_msg.outputs.commit_msg }}
branch: main
add_options: '-A'
repository: builder
tagging_message: ${{ steps.commit_msg.outputs.commit_msg }}
tagging_message: ${{ steps.version_update.outputs.new_version }}

- name: Create Pull Request
id: create_pr
uses: peter-evans/create-pull-request@v7
if: contains('none', steps.version_update.outputs.new_version) == false
with:
Expand All @@ -110,7 +129,13 @@ jobs:
body-path: builder/winget-pr-template.md
add-paths: "manifests/p/PHP/PHP/${{ matrix.php-version-major }}/${{ matrix.php-version-minor }}"
commit-message: ${{ steps.commit_msg.outputs.commit_msg }}
title: "[PHP] Add new version ${{ matrix.php-version-major }}.${{ matrix.php-version-minor }}"
title: "[PHP] Add new version `PHP.PHP.${{ matrix.php-version-major }}.${{ matrix.php-version-minor }}` - `${{ steps.version_update.outputs.new_version }}`"
committer: "Ayesh Karunaratne <ayesh@aye.sh>"
author: "Ayesh Karunaratne <ayesh@aye.sh>"
branch: "php-version-${{ matrix.php-version-major }}-${{ matrix.php-version-minor }}"
branch: "php-v-${{ steps.version_update.outputs.new_version }}"

- name: Add Pull request information
if: ${{ steps.create_pr.outputs.pull-request-ur }}
run: |
echo "## PR ${{ steps.create_pr.outputs.pull-request-operation }}" >> $GITHUB_STEP_SUMMARY
echo "${{ steps.create_pr.outputs.pull-request-url }}" >> $GITHUB_STEP_SUMMARY
32 changes: 0 additions & 32 deletions manifests/p/PHP/PHP/8/4/8.4.1/PHP.PHP.8.4.installer.yaml

This file was deleted.

25 changes: 0 additions & 25 deletions manifests/p/PHP/PHP/8/4/8.4.1/PHP.PHP.8.4.locale.en-US.yaml

This file was deleted.

8 changes: 0 additions & 8 deletions manifests/p/PHP/PHP/8/4/8.4.1/PHP.PHP.8.4.yaml

This file was deleted.

12 changes: 8 additions & 4 deletions templates/winget-pr-template.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
Updates `PHP.PHP.%versionmajor%.%versionminor%` to PHP `%fullversion%`

---

**PHP %fullversion%**
Download x86: %url-x86%
Checksum x86: %hash-x86%
Download x64: %url-x64%
Checksum x64: %hash-x64%
x86 zip Download: %url-x86%
x86 zip checksum: %hash-x86%
x64 zip Download: %url-x64%
x64 zip Checksum: %hash-x64%

---

Checklist for Pull Requests
- [x] Have you signed the [Contributor License Agreement](https://cla.opensource.microsoft.com/microsoft/winget-pkgs)?
Expand Down

0 comments on commit f1e2471

Please sign in to comment.