2 Commits

Author SHA1 Message Date
suchmememanyskill
5bbdc9e509 Fix version extractor 2024-02-09 21:51:24 +01:00
suchmememanyskill
4302c4492c More CI changes 2024-02-09 21:44:21 +01:00
3 changed files with 18 additions and 7 deletions

View File

@@ -4,7 +4,12 @@ permissions:
pages: write
id-token: write
on: [push, pull_request, workflow_dispatch]
on:
push:
pull_request:
workflow_dispatch:
release:
types: [created]
jobs:
build:
@@ -48,7 +53,7 @@ jobs:
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/master'
if: (github.event_name == 'release' && github.event.action == 'created') || (github.event_name != 'pull_request' && github.ref == 'refs/heads/master')
steps:
- name: Print GitHub event name
run: |

View File

@@ -1,17 +1,19 @@
import subprocess
def extract_commit() -> tuple[str, str]: # Version, Commit
def extract_commit() -> str:
git_describe_output = subprocess.run(["git", "describe", "--tags"], stdout=subprocess.PIPE, text=True, check=True).stdout.strip()
split_output = git_describe_output.split("-")
return split_output[0], split_output[2][1:]
if (len(split_output) >= 3):
return f"{split_output[0]}\\ ({split_output[2][1:]})"
else:
return split_output[0]
try:
data = extract_commit()
version = f"{data[0]}\\ ({data[1]})"
version = extract_commit()
except:
version = "Unknown"
flag = "-D REPO_VERSION=\\\"" + version + "\\\""
print(f"Version: {version}")
print(f"Flag: {flag}")

View File

@@ -31,6 +31,10 @@
color: green;
filter: drop-shadow(0 0 0.75rem lime);
}
#changelog-body {
white-space: break-spaces;
}
</style>
<script type="module" src="https://unpkg.com/esp-web-tools@9/dist/web/install-button.js?module"></script>
<script src="//code.iconify.design/1/1.0.6/iconify.min.js"></script>