Sync repo #24
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Sync repo | |
on: | |
workflow_dispatch: | |
permissions: | |
contents: write | |
pull-requests: write | |
jobs: | |
sync-original: | |
name: Sync the exiftool repo | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: sync the repo | |
id: sync-original | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
git config --global user.email "daniel-robot@woss.io" | |
git config --global user.name "Woss Bot" | |
rm -rf exiftool_git | |
git clone https://github.com/exiftool/exiftool.git exiftool_git | |
rm -rf exiftool_git/.git | |
cd ./exiftool_git || exit | |
perl Makefile.PL | |
make | |
make test | |
cd ../ | |
mkdir -p ./exiftool | |
cp -R ./exiftool_git/lib ./exiftool_git/exiftool ./exiftool | |
chmod +x ./exiftool/exiftool | |
rm -rf exiftool_git | |
VERSION=$(./exiftool/exiftool -ver) | |
echo "Version: ${VERSION}" | |
git checkout -b "v${VERSION}" | |
git add exiftool | |
git commit -m "Update exiftool to version ${VERSION}" | |
git push --set-upstream origin "v${VERSION}" | |
echo "branchName=v${VERSION}" >> $GITHUB_OUTPUT | |
- name: create pull request | |
run: gh pr create --assignee woss -B main -H ${{ steps.sync-original.outputs.branchName }} --title "Update exiftool to version ${{ steps.sync-original.outputs.branchName }}" --body "This PR updates the exiftool to version ${{ steps.sync-original.outputs.branchName }}." | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: merge pull request | |
run: gh pr merge ${{ steps.sync-original.outputs.branchName }} --merge --delete-branch | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: create tag | |
run: | | |
git tag -a "${{ steps.sync-original.outputs.branchName }}" -m "Update exiftool to version ${{ steps.sync-original.outputs.branchName }}" | |
git push origin "${{ steps.sync-original.outputs.branchName }}" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: generate release | |
run: | | |
gh release create ${{ steps.sync-original.outputs.branchName }} --generate-notes | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |