-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add cron job to check for new Octez versions
- Loading branch information
1 parent
c6efbf9
commit 9fc4736
Showing
7 changed files
with
81 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Build | ||
name: Publish on Docker Hub | ||
|
||
on: | ||
push: | ||
|
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 |
---|---|---|
@@ -1,9 +1,9 @@ | ||
name: Build | ||
name: Publish on GHCR | ||
|
||
on: | ||
push: | ||
tags: | ||
- '*' | ||
- 'v*' | ||
|
||
jobs: | ||
build: | ||
|
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,19 @@ | ||
name: Check Octez version | ||
|
||
on: | ||
schedule: | ||
- cron: '0 0 * * *' | ||
# REMOVE | ||
push: | ||
branches: | ||
- aux/octez-version-checker | ||
|
||
jobs: | ||
octez_version: | ||
name: Check the latest Octez release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Install python-requests | ||
run: sudo apt-get install python3-requests | ||
- name: make octez_version | ||
run: make octez_version |
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,15 @@ | ||
name: Tag the current Octez release | ||
|
||
|
||
on: | ||
push: | ||
branches: | ||
- 'master' | ||
|
||
jobs: | ||
build: | ||
name: Force push tag of the current Octez release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: make release | ||
run: make release |
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
Empty file.
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,40 @@ | ||
from pathlib import Path | ||
import requests | ||
from os import environ as env | ||
import subprocess | ||
|
||
def run(*args, **kwargs): | ||
print(f"$ {' '.join(args)}") | ||
subprocess.run(args, check=True, **kwargs) | ||
|
||
|
||
OCTEZ_REPO_URL = 'https://github.com/serokell/tezos-packaging/releases/latest' | ||
|
||
|
||
def main(): | ||
|
||
version_file = Path('octez_version') | ||
current_version = version_file.read_text().strip() if version_file.exists() else '' | ||
print(f'Current version: {current_version}') | ||
latest_version = requests.get(OCTEZ_REPO_URL).url.split("/")[-1] | ||
print(f'Latest version: {latest_version}') | ||
|
||
if current_version == latest_version: | ||
return | ||
|
||
if not env.get("GITHUB_ACTIONS"): | ||
print("This script is intended to be run in a GitHub Action.") | ||
exit(1) | ||
|
||
print('Octez version has changed. Updating...') | ||
Path('octez_version').write_text(latest_version) | ||
|
||
run('make', 'build') | ||
run('git', 'checkout', '-b', f'octez-{latest_version}') | ||
run('git', 'add', 'octez_version') | ||
run('git', 'commit', '-m', f'Update Octez binaries to {latest_version}') | ||
|
||
|
||
|
||
if __name__ == "__main__": | ||
main() |