Skip to content

Commit

Permalink
update: git release detail logs
Browse files Browse the repository at this point in the history
  • Loading branch information
Esonhugh committed Jun 18, 2024
1 parent bfaa5fe commit 7bb1649
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 25 deletions.
49 changes: 24 additions & 25 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,33 @@ name: Release
on:
push:
tags:
- '*'
- "*"

permissions:
contents: write
permissions:
contents: write

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2

- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: '3.x'
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2

- run: python3 craft.py
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: "3.x"

- run: |
python3 verify.py ./createhackenv.sh >> version.txt
echo '```' >> version.txt
- run: python3 craft.py

- name: Create Release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
body_path: ${{ github.workspace }}/version.txt
files: |
${{ github.workspace }}/createhackenv.sh
- run: |
python3 ./releaser.py > version.txt
- name: Create Release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
body_path: ${{ github.workspace }}/version.txt
files: |
${{ github.workspace }}/createhackenv.sh
20 changes: 20 additions & 0 deletions gitcmd.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
LATEST_TAG=`git tag --sort=refname |tail -n 2 |head -n 1`
NEW_TAG=`git tag --sort=refname |tail -n 1`
git log --format='%(trailers:key=Type,valueonly,separator=%x20)%x1c%s [%(trailers:key=Issue,valueonly,separator=,)]' $LATEST_TAG..$NEW_TAG | awk -F "\034" '
{
gsub(/\[\]$/, "", $2);
if (length($1) == 0) $1="";
if (!($1 in item_count)) item_count[$1]=0;
items[$1, item_count[$1]]=$2;
item_count[$1]++;
}
END {
for (k in item_count) {
print k;
k2=k;
gsub(/./, "-", k2);
print k2
for (i=0; i<item_count[k]; i++) print "* "items[k, i];
print ""
}
}'
20 changes: 20 additions & 0 deletions version.txt → releaser.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
template = """
# Weaponaized your VSCode
## What is this?
Expand All @@ -18,3 +19,22 @@
## Script Hash
```
__VERIFY_OUTPUT__
```
## Update Log
__UPDATE_LOGS__
"""

import os

def main():
verify_output = os.popen("python3 ./verify.py ./creathackenv.sh").read()
update_logs = os.popen("bash ./gitcmd.sh").read()
print(template.replace("__VERIFY_OUTPUT__", verify_output).replace("__UPDATE_LOGS__", update_logs))
pass

if __name__ == "__main__":
main()

0 comments on commit 7bb1649

Please sign in to comment.