diff --git a/.github/workflows/changelog.yml b/.github/workflows/ci.yml similarity index 52% rename from .github/workflows/changelog.yml rename to .github/workflows/ci.yml index d4723155e..1c4824995 100644 --- a/.github/workflows/changelog.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -name: Changelog & checksums.md5 generation +name: Continuous integration on: push: @@ -29,21 +29,43 @@ jobs: - name: Print the changelog run: cat "${{ steps.git-cliff.outputs.changelog }}" - - name: Generate checksums file + - name: Commit changelog + run: | + git checkout master + git config --local user.name 'belomaxorka' + git config --local user.email 'roman25052006.kelesh@gmail.com' + set +e + git add CHANGELOG.md + git commit -m "Update CHANGELOG.md 📖" + git push https://${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git master + + checksums: + runs-on: ubuntu-latest + needs: + - changelog + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + ref: master + token: ${{ secrets.REPO_TOKEN }} + + - name: Generate checksums.md5 file run: | find . -type f -not -path "./.git/*" -exec md5sum {} \; > internal_data/checksums.md5 - - name: Commit changes (changelog & updated checksums) + - name: Commit and push checksums.md5 if changed run: | git checkout master - git config user.name 'belomaxorka' - git config user.email 'roman25052006.kelesh@gmail.com' - set +e + git config --local user.name 'belomaxorka' + git config --local user.email 'roman25052006.kelesh@gmail.com' + if git diff --quiet internal_data/checksums.md5; then - echo "No changes in checksums.md5" + echo "No changes in internal_data/checksums.md5" else + set +e git add internal_data/checksums.md5 + git commit -m "Update checksums.md5 📄" + git push https://${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git master fi - git add CHANGELOG.md - git commit -m "Update CHANGELOG.md & checksums.md5" - git push https://${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git master