-
-
Notifications
You must be signed in to change notification settings - Fork 128
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bb53b53
commit 684b6f6
Showing
6 changed files
with
63 additions
and
2 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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import os | ||
import os | ||
from importlib.util import module_from_spec, spec_from_file_location | ||
|
||
ROOT = os.path.dirname(os.path.abspath(__file__)) | ||
|
||
|
||
def get_version(package_path): | ||
spec = spec_from_file_location("version", os.path.join(package_path, "_version.py")) | ||
module = module_from_spec(spec) | ||
spec.loader.exec_module(module) | ||
version = module.get_version_for_setup() | ||
return version | ||
|
||
|
||
try: | ||
version = get_version(os.path.join(ROOT, "..", "..", "ersilia")) | ||
except: | ||
version = get_version(os.path.join(ROOT, "ersilia")) | ||
|
||
print(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,36 @@ | ||
name: Tag to version | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
|
||
workflow_dispatch: | ||
|
||
jobs: | ||
version: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout persist credentials | ||
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # pin@v3.5.2 | ||
with: | ||
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token | ||
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo | ||
|
||
- name: Make a change and commit | ||
run: | | ||
wget https://raw.githubusercontent.com/ersilia-os/ersilia/master/.github/scripts/static_version_writer.py | ||
python static_version_writer.py | ||
rm static_version_writer.py | ||
- name: Commit and push changes done to the README file | ||
uses: actions-js/push@156f2b10c3aa000c44dbe75ea7018f32ae999772 # pin@v1.4 | ||
with: | ||
author_name: "ersilia-bot" | ||
author_email: "ersilia-bot@users.noreply.github.com" | ||
message: "update version [skip ci]" | ||
repository: "ersilia-os/${{ github.event.repository.name }}" | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
amend: true | ||
force: true |
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 @@ | ||
version = "0.1.12" |
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
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