File tree Expand file tree Collapse file tree 1 file changed +33
-2
lines changed
Expand file tree Collapse file tree 1 file changed +33
-2
lines changed Original file line number Diff line number Diff line change 1010 steps :
1111 - name : Checkout
1212 uses : actions/checkout@v3
13+
1314 - name : Typst
1415 uses : lvignoli/typst-action@main
1516 with :
2122 name : PDF
2223 path : src/main.pdf
2324
24- - name : Release
25+ - name : Get current date for release
26+ id : date
27+ if : github.ref_type == 'tag'
28+ run : echo "::set-output name=date::$(date +'%Y-%m-%d')"
29+
30+ - name : Format tag for release
31+ id : format_tag
32+ if : github.ref_type == 'tag'
33+ env :
34+ TAG_NAME : ${{ github.ref_name }}
35+ run : |
36+ TAG="$TAG_NAME"
37+ # normalize separators to spaces
38+ TAG="${TAG//_/ }"
39+ TAG="${TAG//-/ }"
40+ # split and capitalize each word
41+ read -ra parts <<< "$TAG"
42+ pretty=""
43+ for w in "${parts[@]}"; do
44+ if [[ -z "$w" ]]; then continue; fi
45+ first="${w:0:1}"
46+ rest="${w:1}"
47+ pretty+="${first^^}${rest} "
48+ done
49+ pretty="${pretty% }"
50+ echo "formatted tag: '$pretty'"
51+ echo "::set-output name=pretty::$pretty"
52+
53+ - name : Create release
2554 uses : softprops/action-gh-release@v1
2655 if : github.ref_type == 'tag'
2756 with :
28- name : " ${{ github.ref_name }} — ${{ env.DATE }}"
57+ name : " ${{ steps.format_tag.outputs.pretty }} — ${{ steps.date.outputs.date }}"
2958 files : src/main.pdf
59+
60+
You can’t perform that action at this time.
0 commit comments