Skip to content

Commit 4ad41f1

Browse files
committed
feat: 支持上传发行版的文件包
1 parent 57d5609 commit 4ad41f1

File tree

3 files changed

+64
-15
lines changed

3 files changed

+64
-15
lines changed

.github/workflows/release.yml

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,12 @@ on:
66
- "*"
77

88
jobs:
9-
build:
9+
publish-release:
1010
runs-on: ubuntu-latest
11+
12+
env:
13+
GH_TOKEN: ${{ github.token }}
14+
1115
steps:
1216
- uses: actions/checkout@v4
1317
- name: Get version
@@ -18,12 +22,43 @@ jobs:
1822
1923
- name: Write Changelog
2024
run: |
21-
prev_to_latest="${{ env.PREV_VERSION }}...${{ env.RELEASE_VERSION }}"
22-
printf "\n\n**Full Changelog:** [\`${prev_to_latest}\`](https://github.com/${{ github.repository }}/compare/${prev_to_latest})" >> .CurrentChangelog.md
25+
touch .CurrentChangelog.md
26+
if [ -n "${{ env.PREV_VERSION }}" ]; then
27+
prev_to_latest="${{ env.PREV_VERSION }}...${{ env.RELEASE_VERSION }}"
28+
printf "\n\n**Full Changelog:** [\`${prev_to_latest}\`](https://github.com/${{ github.repository }}/compare/${prev_to_latest})" >> .CurrentChangelog.md
29+
fi
2330
- uses: oven-sh/setup-bun@v2
2431
with:
2532
bun-version: latest
2633
- name: Build
2734
run: |
2835
bun install
2936
bun run build
37+
38+
- name: Create Package
39+
run: |
40+
mv dist shortener
41+
tar -czvf "shortener-frontend_${{ env.RELEASE_VERSION }}.tar.gz" shortener
42+
ls -lh
43+
44+
- name: Create Release
45+
env:
46+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47+
run: |
48+
ls -lh
49+
gh release create ${{ env.RELEASE_VERSION }} --draft --notes-file .CurrentChangelog.md --prerelease --title "${{ env.RELEASE_VERSION }}" --verify-tag
50+
51+
- name: Upload Release Asset
52+
run: |
53+
ls -lh
54+
gh release upload ${{ env.RELEASE_VERSION }} ./*.tar.gz --clobber
55+
56+
- name: Publish Release
57+
run: |
58+
gh release edit ${{ env.RELEASE_VERSION }} --draft=false --prerelease=false --latest
59+
60+
# - name: Upload artifacts
61+
# uses: actions/upload-artifact@v4
62+
# with:
63+
# name: artifact
64+
# path: ./*.tar.gz

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ npm run build
4242

4343
## 部署
4444

45-
部署教程查看 [**shortener-server**](https://git.jetsung.com/idev/shortener-frontend#文档) 项目。
45+
部署教程查看 [**shortener-server**](https://git.jetsung.com/idev/shortener-server#文档) 项目。
4646

4747
## 仓库镜像
4848

src/pages/Dashboard.tsx

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const useStyles = createStyles(({ token }) => {
3030
gap: 16,
3131
},
3232
};
33-
})
33+
});
3434

3535
const Dashboard: React.FC = () => {
3636
const { token } = theme.useToken();
@@ -43,20 +43,34 @@ const Dashboard: React.FC = () => {
4343
borderRadius: 8,
4444
}}
4545
styles={{
46-
body:{
47-
backgroundImage:
48-
initialState?.settings?.navTheme === 'realDark'
49-
? 'background-image: linear-gradient(75deg, #1A1B1F 0%, #191C1F 100%)'
50-
: 'background-image: linear-gradient(75deg, #FBFDFF 0%, #F5F7FF 100%)',
51-
}
46+
body: {
47+
backgroundImage:
48+
initialState?.settings?.navTheme === 'realDark'
49+
? 'background-image: linear-gradient(75deg, #1A1B1F 0%, #191C1F 100%)'
50+
: 'background-image: linear-gradient(75deg, #FBFDFF 0%, #F5F7FF 100%)',
51+
},
5252
}}
5353
>
5454
<div className={styles.container}>
55-
<div className={styles.textHeading}>
56-
欢迎使用 Shortener 短网址生成器
57-
</div>
55+
<div className={styles.textHeading}>欢迎使用 Shortener 短网址生成器</div>
5856
<p className={styles.welcome}>
59-
Shortener 是一个使用 Go 语言开发的短网址生成器。<a href='https://git.jetsung.com/idev/shortener' target='_blank'>后端使用 Gin 框架</a><a href='https://git.jetsung.com/idev/shortener-frontend' target='_blank'>前端使用 React 框架</a>,UI 框架使用 Ant Design。
57+
Shortener 是一个使用 Go 语言开发的短网址生成器。
58+
<a
59+
rel="noopener noreferrer"
60+
href="https://git.jetsung.com/idev/shortener-server"
61+
target="_blank"
62+
>
63+
后端使用 Gin 框架
64+
</a>
65+
66+
<a
67+
rel="noopener noreferrer"
68+
href="https://git.jetsung.com/idev/shortener-frontend"
69+
target="_blank"
70+
>
71+
前端使用 React 框架
72+
</a>
73+
,UI 框架使用 Ant Design。
6074
</p>
6175
</div>
6276
</Card>

0 commit comments

Comments
 (0)