Merge pull request #32 from XiangRongLin/github_actions

Migrate to github actions from travis CI
This commit is contained in:
TheAssassin 2021-11-28 22:01:19 +01:00 committed by GitHub
commit d37689a030
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 44 additions and 29 deletions

17
.github/workflows/linkcheck.yml vendored Normal file
View File

@ -0,0 +1,17 @@
name: linkcheck
on:
push:
branches:
- master
pull_request:
workflow_dispatch:
jobs:
linkcheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Verify links
run: bash ci/docker-linkcheck.sh

1
.gitignore vendored
View File

@ -1,2 +1,3 @@
.idea .idea
site/ site/
*.*swp

View File

@ -1,19 +0,0 @@
language: python
python:
- "3.6"
branches:
only:
- master
before_install:
- "pip3 install -U pip"
- "export PYTHONPATH=$PYTHONPATH:$(pwd)"
cache: pip
install:
- pip install -r requirements.txt
script: python linkcheck.py

16
ci/docker-linkcheck.sh Normal file
View File

@ -0,0 +1,16 @@
#! /bin/bash
set -e
set -o pipefail
set -x
this_dir="$(readlink -f -- "$(dirname -- "${BASH_SOURCE[0]}")")"
image="python:3-alpine"
# as we use a pipe to stdin and thus cannot use -it, Ctrl-C does not work by default
# turns out that combining -i with --init solves that problem
# see https://stackoverflow.com/a/60812082
docker run --rm -i -v "$this_dir"/..:/ws -w /ws --init "$image" sh <<\EOF
pip install -r requirements.txt
python linkcheck.py
EOF

View File

@ -25,7 +25,7 @@ First and foremost, you need to meet the following conditions in order to write
- A dev environment/IDE that supports: - A dev environment/IDE that supports:
- __[Git](https://git-scm.com/downloads/guis)__ - __[Git](https://git-scm.com/downloads/guis)__
- __[Java 8](https://www.java.com/en/download/faq/java8.xml)__ - __[Java 8](https://adoptium.net/?variant=openjdk8&jvmVariant=hotspot)__
- __[Gradle](https://gradle.org/)__ - __[Gradle](https://gradle.org/)__
- __[Unit testing](https://junit.org/junit5/)__ - __[Unit testing](https://junit.org/junit5/)__
- [IDEA Community](https://www.jetbrains.com/idea/) (Strongly recommended, but not required) - [IDEA Community](https://www.jetbrains.com/idea/) (Strongly recommended, but not required)

View File

@ -34,7 +34,7 @@ ask us to introduce a new library than start using Regex too often.
- Html/XML Parsing: [jsoup](https://jsoup.org/apidocs/overview-summary.html) - Html/XML Parsing: [jsoup](https://jsoup.org/apidocs/overview-summary.html)
- JSON Parsing: [nanojson](https://github.com/mmastrac/nanojson#parser-example) - JSON Parsing: [nanojson](https://github.com/mmastrac/nanojson#parser-example)
- JavaScript Parsing/Execution: [Mozilla Rhino](https://developer.mozilla.org/en-US/docs/Mozilla/Projects/Rhino/Documentation) - JavaScript Parsing/Execution: [Mozilla Rhino](https://github.com/mozilla/rhino)
- Link detection in strings: [AutoLink](https://github.com/robinst/autolink-java) - Link detection in strings: [AutoLink](https://github.com/robinst/autolink-java)
If you need to introduce new libraries, please tell us before you do so. If you need to introduce new libraries, please tell us before you do so.

View File

@ -74,9 +74,9 @@ For NewPipe, this means: __Don't do a release if you don't have time for it!!!__
By following the steps listed below, you can publish a stable version of NewPipe: By following the steps listed below, you can publish a stable version of NewPipe:
1. [Merge the translations from Weblate into NewPipe](../07_maintainers_view#merge-changes-from-weblate-into-newpipe). 1. [Merge the translations from Weblate into NewPipe](../08_maintainers_view#merge-changes-from-weblate-into-newpipe).
2. Update your local __dev__ branch and create a [changelog file](#changelog-file). 2. Update your local __dev__ branch and create a [changelog file](#changelog-file).
Make sure to push the changes and [update Weblate](../07_maintainers_view#update-weblate). Make sure to push the changes and [update Weblate](../08_maintainers_view#update-weblate).
3. In your local NewPipe repo, fork the __dev__ branch into a new __release/x.y.z__ branch. 3. In your local NewPipe repo, fork the __dev__ branch into a new __release/x.y.z__ branch.
4. Increase the [version number](#version-nomenclature) and update the version code in the `build.gradle` file. 4. Increase the [version number](#version-nomenclature) and update the version code in the `build.gradle` file.
5. Open a pull request form the new __release/x.y.z__ branch into the __master__ branch. 5. Open a pull request form the new __release/x.y.z__ branch into the __master__ branch.
@ -96,7 +96,7 @@ PRs which aim to fix regressions of the upcoming release need to target the __re
Read [Quickfixes](#quickfixes) for more info. Read [Quickfixes](#quickfixes) for more info.
The changelogs are translated during the test phase. The changelogs are translated during the test phase.
Therefore, [the translations need to be merged from Weblate](../07_maintainers_view#merge-changes-from-weblate-into-newpipe) once more. Therefore, [the translations need to be merged from Weblate](../08_maintainers_view#merge-changes-from-weblate-into-newpipe) once more.
The translation commit is cherry-picked into the release branch. The translation commit is cherry-picked into the release branch.
Once testing is done and the release branch does not contain critical regressions, and you think the update is ready, Once testing is done and the release branch does not contain critical regressions, and you think the update is ready,
@ -122,7 +122,7 @@ _Don't update the actual version number. :P_
### Releasing ### Releasing
Once the glorious day of all days has come, and you fulfill the ceremony of releasing. Once the glorious day of all days has come, and you fulfill the ceremony of releasing.
After going through the release procedure of [creating a new release](#create_a_new_release) After going through the release procedure of [creating a new release](#creating-a-new-release)
and maybe a few [quickfixes](#quickfixes) on the new release, and maybe a few [quickfixes](#quickfixes) on the new release,
this is what you should do when releasing: this is what you should do when releasing:
@ -275,7 +275,7 @@ For this reason it is recommended to keep the changelog at 400 bytes.
When creating the changelog file be aware of changes which were done in the extractor as well. When creating the changelog file be aware of changes which were done in the extractor as well.
Before pushing the changelog to NewPipe's repo, ask other maintainers to review it. Before pushing the changelog to NewPipe's repo, ask other maintainers to review it.
After pushing the changelog to NewPipe's GitHub repo, [updating Weblate](07_maintainers_view/#update-webalte) is necessary. After pushing the changelog to NewPipe's GitHub repo, [updating Weblate](../08_maintainers_view#update-weblate) is necessary.
This enables translators to work on localized versions of the changelog before a release is tagged and published. This enables translators to work on localized versions of the changelog before a release is tagged and published.
## Publish on F-Droid ## Publish on F-Droid

View File

@ -18,7 +18,7 @@ for filename in os.listdir():
for link in re.findall('\[.*\]\(([^\)]*)\)', filedata): for link in re.findall('\[.*\]\(([^\)]*)\)', filedata):
if link.startswith("#"): if link.startswith("#"):
checkstring = "# " + link.replace("#", "").replace("-", " ") checkstring = "# " + link.replace("#", "").replace("-", " ")
if not checkstring in filedata.lower(): if not checkstring in filedata.lower().replace("-", " "):
RETURN_VALUE = 1 RETURN_VALUE = 1
print(filename + ": Could not find target for " + link) print(filename + ": Could not find target for " + link)
else: else:
@ -31,7 +31,7 @@ for filename in os.listdir():
RETURN_VALUE = 1 RETURN_VALUE = 1
print(filename + ": " + link + " is not https") print(filename + ": " + link + " is not https")
else: else:
res = requests.get(link) res = requests.get(link, timeout=5)
if res.status_code != 200: if res.status_code != 200:
RETURN_VALUE = 1 RETURN_VALUE = 1
print(filename + ": " + link + " returns " + str(res.status_code)) print(filename + ": " + link + " returns " + str(res.status_code))