@@ -3,7 +3,10 @@ name: Release
33on :
44 push :
55 tags :
6- - " *"
6+ - ' v*'
7+
8+ permissions :
9+ contents : write
710
811jobs :
912 build-and-attach :
@@ -24,20 +27,40 @@ jobs:
2427 - name : Build
2528 run : bun run build
2629
30+ - name : Package source
31+ run : |
32+ archive="nhentai-telegram-bot-${GITHUB_REF_NAME}-source.tar.gz"
33+ git archive --format=tar.gz --output "$archive" "$GITHUB_SHA"
34+
35+ - name : Package build output
36+ run : |
37+ archive="nhentai-telegram-bot-${GITHUB_REF_NAME}-built.tar.gz"
38+ tar -czf "$archive" built
39+
40+ - name : Upload workflow artifacts
41+ uses : actions/upload-artifact@v4
42+ with :
43+ name : release-${{ github.ref_name }}
44+ path : |
45+ nhentai-telegram-bot-${{ github.ref_name }}-source.tar.gz
46+ nhentai-telegram-bot-${{ github.ref_name }}-built.tar.gz
47+
2748 - name : Upload release assets
2849 env :
2950 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
3051 run : |
31- tag="${GITHUB_REF#refs/tags/}"
52+ tag="$GITHUB_REF_NAME"
53+ source="nhentai-telegram-bot-${tag}-source.tar.gz"
54+ built="nhentai-telegram-bot-${tag}-built.tar.gz"
3255
3356 # Check if release already exists (created via UI)
3457 if gh release view "$tag" > /dev/null 2>&1; then
3558 # Upload assets to existing release
36- gh release upload "$tag" main.js manifest.json styles.css cumban.zip --clobber
59+ gh release upload "$tag" "$source" "$built" --clobber
3760 else
3861 # Create new release with assets
3962 gh release create "$tag" \
4063 --title="$tag" \
4164 --generate-notes \
42- main.js manifest.json styles.css cumban.zip
65+ "$source" "$built"
4366 fi
0 commit comments