Skip to content

Commit c2bb744

Browse files
authored
feat(build): publish release
1 parent c8b74b7 commit c2bb744

1 file changed

Lines changed: 36 additions & 35 deletions

File tree

.github/workflows/build.yml

Lines changed: 36 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,60 @@
11
name: Build
2-
32
on:
43
push:
54
branches:
65
- main
76

7+
permissions:
8+
contents: write
9+
810
jobs:
911
build:
1012
runs-on: ubuntu-latest
1113
steps:
1214
- name: Checkout repository
1315
uses: actions/checkout@v4
14-
16+
with:
17+
fetch-depth: 0 # Needed for git operations
18+
1519
- name: Setup Node.js
1620
uses: actions/setup-node@v4
1721
with:
1822
node-version: '18'
1923
cache: 'npm'
20-
24+
2125
- name: Install dependencies
2226
run: npm install
23-
27+
2428
- name: Build project
2529
run: npm run build
26-
27-
- name: Upload dist artifact
30+
31+
- name: Create dist archive
32+
run: zip -r jellobounce.zip dist/
33+
34+
- name: Upload jellobounce.zip artifact
2835
uses: actions/upload-artifact@v4
2936
with:
30-
name: dist
31-
path: dist/
37+
name: jellobounce
38+
path: jellobounce.zip
39+
40+
- name: Generate version tag
41+
id: version_tag
42+
run: |
43+
COMMIT_HASH=$(git rev-parse --short HEAD)
44+
TAG="build-$COMMIT_HASH-$(date +'%Y%m%d%H%M%S')"
45+
echo "version=$TAG" >> $GITHUB_OUTPUT
3246
33-
# Uncomment the sections below if you want to create GitHub releases
34-
#
35-
# - name: Create dist archive
36-
# run: zip -r dist.zip dist/
37-
#
38-
# - name: Generate version tag
39-
# id: version_tag
40-
# run: |
41-
# COMMIT_HASH=$(git rev-parse --short HEAD)
42-
# TAG="build-$COMMIT_HASH-$(date +'%Y%m%d%H%M%S')"
43-
# echo "version=$TAG" >> $GITHUB_OUTPUT
44-
#
45-
# - name: Create and push Git tag
46-
# run: |
47-
# git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
48-
# git config --local user.name "github-actions[bot]"
49-
# git tag ${{ steps.version_tag.outputs.version }}
50-
# git push origin ${{ steps.version_tag.outputs.version }}
51-
#
52-
# - name: Upload to GitHub Release
53-
# uses: softprops/action-gh-release@v1
54-
# with:
55-
# files: dist.zip
56-
# token: ${{ secrets.GITHUB_TOKEN }}
57-
# tag_name: ${{ steps.version_tag.outputs.version }}
58-
# prerelease: false
59-
# name: "Build Release ${{ steps.version_tag.outputs.version }}"
47+
- name: Create and push Git tag
48+
run: |
49+
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
50+
git config --local user.name "github-actions[bot]"
51+
git tag ${{ steps.version_tag.outputs.version }}
52+
git push origin ${{ steps.version_tag.outputs.version }}
53+
54+
- name: Upload to GitHub Release
55+
uses: softprops/action-gh-release@v1
56+
with:
57+
files: jellobounce.zip
58+
tag_name: ${{ steps.version_tag.outputs.version }}
59+
prerelease: false
60+
name: "Build Release ${{ steps.version_tag.outputs.version }}"

0 commit comments

Comments
 (0)