mirror of
https://github.com/bombsquad-community/plugin-manager.git
synced 2025-10-08 14:54:36 +00:00
Updated ci and release workflow
This commit is contained in:
parent
0fd23a5063
commit
9c1ff8b0f2
4 changed files with 20 additions and 9 deletions
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
|
|
@ -11,7 +11,7 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
python-version: ["3.11"]
|
python-version: ["3.12"]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
|
|
|
||||||
10
.github/workflows/release.yml
vendored
10
.github/workflows/release.yml
vendored
|
|
@ -16,7 +16,7 @@ jobs:
|
||||||
- name: Set up Python
|
- name: Set up Python
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
with:
|
with:
|
||||||
python-version: '3.11'
|
python-version: '3.12'
|
||||||
|
|
||||||
- name: 'Get Previous tag'
|
- name: 'Get Previous tag'
|
||||||
uses: oprypin/find-latest-tag@v1.1.2
|
uses: oprypin/find-latest-tag@v1.1.2
|
||||||
|
|
@ -27,14 +27,16 @@ jobs:
|
||||||
|
|
||||||
- name: set_variables
|
- name: set_variables
|
||||||
run: |
|
run: |
|
||||||
output1=$(python3 test/get_latest.py)
|
output1=$(python3 test/get_latest.py get_latest_version)
|
||||||
{
|
{
|
||||||
echo "changelog<<EOF"
|
echo "changelog<<EOF"
|
||||||
python3 test/get_changes.py "$(python3 test/get_latest.py)"
|
python3 test/get_changes.py "$(python3 test/get_latest.py get_latest_version)"
|
||||||
echo EOF
|
echo EOF
|
||||||
} >> "$GITHUB_OUTPUT"
|
} >> "$GITHUB_OUTPUT"
|
||||||
|
output2=$(python3 test/get_latest.py get_latest_api)
|
||||||
output3=$(python3 test/version_is_lower.py ${{ steps.previoustag.outputs.tag }})
|
output3=$(python3 test/version_is_lower.py ${{ steps.previoustag.outputs.tag }})
|
||||||
echo "latestVersion=$output1" >> $GITHUB_OUTPUT
|
echo "latestVersion=$output1" >> $GITHUB_OUTPUT
|
||||||
|
echo "latestAPI=$output2" >> $GITHUB_OUTPUT
|
||||||
echo "shouldRun=$output3" >> $GITHUB_OUTPUT
|
echo "shouldRun=$output3" >> $GITHUB_OUTPUT
|
||||||
id: set_variables
|
id: set_variables
|
||||||
|
|
||||||
|
|
@ -54,7 +56,7 @@ jobs:
|
||||||
uses: ncipollo/release-action@v1
|
uses: ncipollo/release-action@v1
|
||||||
with:
|
with:
|
||||||
tag: ${{ steps.tag_version.outputs.new_tag }}
|
tag: ${{ steps.tag_version.outputs.new_tag }}
|
||||||
name: Release ${{ steps.tag_version.outputs.new_tag }}
|
name: ${{ steps.tag_version.outputs.new_tag }} (api ${{ steps.set_variables.outputs.latestAPI }})
|
||||||
artifacts: "plugin_manager.py"
|
artifacts: "plugin_manager.py"
|
||||||
body: |
|
body: |
|
||||||
## Changelog
|
## Changelog
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
### 1.1.0 (15-01-2025)
|
### 1.1.0 (15-01-2025)
|
||||||
|
|
||||||
- Updating to bombsquad api 9.
|
- Updated to bombsquad api 9.
|
||||||
|
|
||||||
### 1.0.23 (13-01-2025)
|
### 1.0.23 (13-01-2025)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,22 @@
|
||||||
import json
|
import json
|
||||||
|
import sys
|
||||||
|
|
||||||
|
def get_latest_version():
|
||||||
def get_latest():
|
|
||||||
"""Get latest version entry from index.json"""
|
"""Get latest version entry from index.json"""
|
||||||
with open('index.json', 'r') as file:
|
with open('index.json', 'r') as file:
|
||||||
content = json.loads(file.read())
|
content = json.loads(file.read())
|
||||||
latest_version = list(content["versions"].keys())[0]
|
latest_version = list(content["versions"].keys())[0]
|
||||||
return latest_version
|
return latest_version
|
||||||
|
|
||||||
|
def get_latest_api():
|
||||||
|
"""Get latest api entry from index.json"""
|
||||||
|
with open('index.json', 'r') as file:
|
||||||
|
content = json.loads(file.read())
|
||||||
|
latest_api = content["versions"][get_latest_version()]["api_version"]
|
||||||
|
return latest_api
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
print(get_latest())
|
if len(sys.argv) < 2:
|
||||||
|
print(f"Usage: python3 {__file__.split('/')[-1]} function")
|
||||||
|
sys.exit(1)
|
||||||
|
print(globals()[sys.argv[1]]()) # used to call the fucntion passed as cli parameter
|
||||||
Loading…
Add table
Add a link
Reference in a new issue