diff --git a/.github/workflows/cron.yml b/.github/workflows/cron.yml new file mode 100644 index 00000000..42e631ba --- /dev/null +++ b/.github/workflows/cron.yml @@ -0,0 +1,22 @@ +on: + schedule: + - cron: "0 0/3 * * *" # Run every 3 hour + +jobs: + git_svn_sync: + runs-on: "ubuntu-latest" + steps: + - name: "Checkout git mpg123 clone" + uses: "actions/checkout@v2" + with: + fetch-depth: 0 + - name: "Download (new) revisions from mpg123 git-svn" + run: | + git remote add mpg123 https://mpg123.org/trunk/.git/ + git fetch mpg123 + - name: "Set mpg123's master as new master" + run: | + git switch -C master mpg123/master + - name: "Force push (new) master" + run: | + git push origin master -f diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml new file mode 100644 index 00000000..f6428220 --- /dev/null +++ b/.github/workflows/pr.yml @@ -0,0 +1,29 @@ +on: + schedule: + - cron: "0 * * * *" # Run every hour + +jobs: + send_mail: + runs-on: "ubuntu-latest" + steps: + - name: "Checkout git mpg123 clone" + uses: "actions/checkout@v2" + with: + ref: "updater" + - name: "Setup python" + uses: "actions/setup-python@v2" + with: + python-version: "3.x" + - name: "Install Python requirements" + run: | + python -m pip install --user pygithub + - name: "Send mail" + run: | + python scripts/mail-for-all-new-open-prs.py + env: + PUSH_GITHUB_TOKEN: ${{ secrets.PUSH_GITHUB_TOKEN }} + MAIL_RECEIVER: ${{ secrets.MAIL_RECEIVER }} + MAIL_SENDER: ${{ secrets.MAIL_SENDER }} + MAIL_SERVER: ${{ secrets.MAIL_SERVER }} + MAIL_LOGIN: ${{ secrets.MAIL_LOGIN }} + MAIL_PASSWORD: ${{ secrets.MAIL_PASSWORD }} diff --git a/AUTHORS b/AUTHORS index 3321f0ba..a71df7aa 100644 --- a/AUTHORS +++ b/AUTHORS @@ -30,6 +30,7 @@ The creator: Michael Hipp (email: hippm@informatik.uni-tuebingen.de - please bot Contributions/ideas Thomas Orgis era (includes backports from mhipp trunk): +madebr and manx: github mirror and CI Vitaly Kirsanov : ports/cmake (optional CMake build) Won-Kyu Park : patch to get rid of asm textrels (x86 PIC) Michael Weiser : update of coreaudio output to AudioComponents API diff --git a/README.md b/README.md new file mode 100644 index 00000000..736afddd --- /dev/null +++ b/README.md @@ -0,0 +1,22 @@ +# mpg123 git clone + +(See README for actual information about mpg123 itself, this is about the Github mirror.) + +This git repo tracks [mpg123's subversion repo](http://mpg123.org/cgi-bin/scm/mpg123/). + +## Branches + +(This is going to change to benefit from CI actions.) + +- [master](https://github.com/madebr/mpg123/tree/master): the actual mpg123 sources. This tracks mpg123 development. + +- updater: contains scripts to keep the master branch up-to-date. +This is the default branch as cron github actions need to be defined in the default branch. + +## Pull requests + +This clone just tracks upstream. It is not official in any means. +Pull requests will not get merged by this git repo. +It is possible to open a pull request here, and open a ticket on [mpg123's official issue tracker](https://sourceforge.net/p/mpg123/bugs/). +Or send a mail to [one of the mailing lists](https://sourceforge.net/p/mpg123/mailman/). + diff --git a/scripts/mail-for-all-new-open-prs.py b/scripts/mail-for-all-new-open-prs.py new file mode 100644 index 00000000..3e93a91e --- /dev/null +++ b/scripts/mail-for-all-new-open-prs.py @@ -0,0 +1,2021 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + mpg123/mail-for-all-new-open-prs.py at updater · madebr/mpg123 · GitHub + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Skip to content + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ + + + + +
+ + + + + + + + + + +
+
+
+ + + + + + + + + + +
+ +
+ +
+ +
+ + + + / + + mpg123 + + + Public +
+ + +
+ + + +
+ +
+
+ + + + + + +
+ + + + +
+ + + + + + +
+ + +
+ + + + + + + +Permalink + +
+ +
+
+ + + updater + + + + +
+
+
+ Switch branches/tags + +
+ + + +
+ +
+ +
+ + +
+ +
+ + + + + + + + + + + + + + + + + +
+ + +
+
+
+
+ +
+ +
+ + +
+ +
+
+
+

Name already in use

+
+
+ +
+
+
+
+ +
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch? +
+ +
+
+ + +
+
+ + + + Go to file + +
+ + + + +
+
+
+ + + + + + + + + +
+ +
+
+
 
+
+ +
+
 
+ Cannot retrieve contributors at this time +
+
+ + + + + + + + + +
+ +
+ + +
+ + 86 lines (62 sloc) + + 2.35 KB +
+ +
+ + + + +
+ +
+
+
+
+ +
+
+
+
+
+ + + Open in GitHub Desktop +
+
+
+
+
+ + + +
+
+ + + +
+
+ +
+ +
+
+ + + +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
import logging
import os
import re
import smtplib
import ssl
+
import github
+
logging.basicConfig(format='[%(asctime)s] %(message)s')
logging.root.setLevel(logging.INFO)
+
mailinglist_message = "The [mpg123-devel mailing list](https://sourceforge.net/p/mpg123/mailman/mpg123-devel/) has been notified of the existence of this pr."
mailinglist_label = "mailing-list-notified"
+
g = github.Github(os.environ["PUSH_GITHUB_TOKEN"])
user_me = g.get_user()
repo = g.get_repo(os.environ["GITHUB_REPOSITORY"])
+
for pr in repo.get_pulls(state="open"):
logging.info("Checking PR #%d", pr.number)
already_handled = False
for label in pr.get_labels():
if label.name == mailinglist_label:
already_handled = True
if already_handled:
continue
+
logging.info("PR #%d was NOT handled already", pr.number)
+
mail_body = f"""\
A pull request by {pr.user.login} was opened at {pr.created_at}.
Please visit {pr.html_url} to give feedback and review the code.
---
{pr.body}
---
patch details:
- url: {pr.html_url}
- patch: {pr.html_url}.patch
url details:
- user name: {pr.user.login}
- user url: {pr.user.html_url}
"""
logging.info("mail body: %s", mail_body)
+
mail_title = "Opened GH-#{}: {} [{}]".format(pr.number, pr.title, pr.user.login)
+
logging.info("mail title: %s", mail_title)
logging.info("mail body: %s", mail_body)
+
mail_message = f"""\
MIME-Version: 1.0
Content-type: text/plain; charset=utf-8
Subject: {mail_title}
{mail_body}
"""
+
sender_email = "{} <{}>".format("{} (via github PR)".format(pr.user.login), os.environ["MAIL_SENDER"])
receiver_email = os.environ["MAIL_RECEIVER"].split(";")
+
logging.info("mail from: %s", re.sub("[a-z0-9]", "x", sender_email, flags=re.I))
logging.info("receiver to: %s", receiver_email)
+
port = 465
server = os.environ["MAIL_SERVER"]
login = os.environ["MAIL_LOGIN"]
password = os.environ["MAIL_PASSWORD"]
+
context = ssl.create_default_context()
+
with smtplib.SMTP_SSL(server, port, context=context) as server:
server.login(login, password)
server.sendmail(sender_email, receiver_email, mail_message)
+
logging.info("Creating comment at PR#%d", pr.number)
pr.add_to_labels(mailinglist_label)
comment = pr.create_issue_comment(mailinglist_message)
logging.info("Visit comment at %s", comment.html_url)
+
logging.info("mail sent")
+
+ + + +
+ +
+ + + + +
+ + +
+ + +
+
+ + + + + +
+ +
+ + +
+ +
+ + +
+
+ +
+ + + + + + + + + + + + + + + + + + + + +