-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #293 from github/update-v1-f13bd452
Merge main into v1
- Loading branch information
Showing
53 changed files
with
475 additions
and
89 deletions.
There are no files selected for viewing
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
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
43 changes: 43 additions & 0 deletions
43
.github/workflows/update-supported-enterprise-server-versions.yml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: Update Supported Enterprise Server Versions | ||
|
||
on: | ||
schedule: | ||
- cron: "0 0 * * *" | ||
|
||
jobs: | ||
update-supported-enterprise-server-versions: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Setup Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: "3.7" | ||
- name: Checkout CodeQL Action | ||
uses: actions/checkout@v2 | ||
- name: Checkout Enterprise Releases | ||
uses: actions/checkout@v2 | ||
with: | ||
repository: github/enterprise-releases | ||
ssh-key: ${{ secrets.ENTERPRISE_RELEASES_SSH_KEY }} | ||
path: ${{ github.workspace }}/enterprise-releases/ | ||
- name: Update Supported Enterprise Server Versions | ||
run: | | ||
cd ./.github/workflows/update-supported-enterprise-server-versions/ | ||
python3 -m pip install pipenv | ||
pipenv install | ||
pipenv run ./update.py | ||
rm --recursive "$ENTERPRISE_RELEASES_PATH" | ||
npm run build | ||
env: | ||
ENTERPRISE_RELEASES_PATH: ${{ github.workspace }}/enterprise-releases/ | ||
- name: Commit Changes | ||
uses: peter-evans/create-pull-request@c7f493a8000b8aeb17a1332e326ba76b57cb83eb # v3.4.1 | ||
with: | ||
commit-message: Update supported GitHub Enterprise Server versions. | ||
title: Update supported GitHub Enterprise Server versions. | ||
body: "" | ||
author: GitHub <noreply@github.com> | ||
branch: update-supported-enterprise-server-versions | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
9 changes: 9 additions & 0 deletions
9
.github/workflows/update-supported-enterprise-server-versions/Pipfile
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[[source]] | ||
name = "pypi" | ||
url = "https://pypi.org/simple" | ||
verify_ssl = true | ||
|
||
[dev-packages] | ||
|
||
[packages] | ||
semver = "*" |
27 changes: 27 additions & 0 deletions
27
.github/workflows/update-supported-enterprise-server-versions/Pipfile.lock
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
43 changes: 43 additions & 0 deletions
43
.github/workflows/update-supported-enterprise-server-versions/update.py
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#!/usr/bin/env python3 | ||
import datetime | ||
import json | ||
import os | ||
import pathlib | ||
|
||
import semver | ||
|
||
_API_COMPATIBILITY_PATH = pathlib.Path(__file__).absolute().parents[3] / "src" / "api-compatibility.json" | ||
_ENTERPRISE_RELEASES_PATH = pathlib.Path(os.environ["ENTERPRISE_RELEASES_PATH"]) | ||
_RELEASE_FILE_PATH = _ENTERPRISE_RELEASES_PATH / "releases.json" | ||
_FIRST_SUPPORTED_RELEASE = semver.VersionInfo.parse("2.22.0") # Versions older than this did not include Code Scanning. | ||
|
||
def main(): | ||
api_compatibility_data = json.loads(_API_COMPATIBILITY_PATH.read_text()) | ||
|
||
releases = json.loads(_RELEASE_FILE_PATH.read_text()) | ||
oldest_supported_release = None | ||
newest_supported_release = semver.VersionInfo.parse(api_compatibility_data["maximumVersion"] + ".0") | ||
|
||
for release_version_string, release_data in releases.items(): | ||
release_version = semver.VersionInfo.parse(release_version_string + ".0") | ||
if release_version < _FIRST_SUPPORTED_RELEASE: | ||
continue | ||
|
||
if release_version > newest_supported_release: | ||
feature_freeze_date = datetime.date.fromisoformat(release_data["feature_freeze"]) | ||
if feature_freeze_date < datetime.date.today() + datetime.timedelta(weeks=2): | ||
newest_supported_release = release_version | ||
|
||
if oldest_supported_release is None or release_version < oldest_supported_release: | ||
end_of_life_date = datetime.date.fromisoformat(release_data["end"]) | ||
if end_of_life_date > datetime.date.today(): | ||
oldest_supported_release = release_version | ||
|
||
api_compatibility_data = { | ||
"minimumVersion": f"{oldest_supported_release.major}.{oldest_supported_release.minor}", | ||
"maximumVersion": f"{newest_supported_release.major}.{newest_supported_release.minor}", | ||
} | ||
_API_COMPATIBILITY_PATH.write_text(json.dumps(api_compatibility_data, sort_keys=True) + "\n") | ||
|
||
if __name__ == "__main__": | ||
main() |
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.