Skip to content

Commit c445a27

Browse files
authored
Merge pull request #53 from zenuo/feat_favicon [skip ci]
Feat favicon
2 parents f79b023 + bbaecfb commit c445a27

14 files changed

+194
-20
lines changed

.github/workflows/ci_cli.yml

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ on:
99
jobs:
1010
build-cli:
1111
runs-on: ${{ matrix.os }}
12+
if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]')"
1213
strategy:
1314
fail-fast: false
1415
matrix:

.github/workflows/ci_server_and_web.yml

+74-17
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,33 @@ on:
99
workflow_dispatch:
1010

1111
jobs:
12-
build-server-web:
12+
build-web:
13+
if: ${{!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]')}}
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
- name: Install Npm
18+
uses: actions/setup-node@v4
19+
with:
20+
node-version: 20
21+
22+
- name: Npm Build
23+
working-directory: ./gogo-web
24+
run: |
25+
npm install
26+
npm run build --omit=dev
27+
28+
- name: Archive artifacts
29+
uses: actions/upload-artifact@v4
30+
with:
31+
name: gogo-web
32+
path: ./gogo-web/dist/
33+
retention-days: 1
34+
35+
build-server:
36+
needs: [build-web]
1337
runs-on: ${{ matrix.os }}
38+
if: ${{!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]')}}
1439
strategy:
1540
fail-fast: false
1641
matrix:
@@ -44,23 +69,17 @@ jobs:
4469
working-directory: ./gogo-server
4570
run: cargo build --release ${{ matrix.target && '--target' }} ${{ matrix.target }}
4671

47-
- name: Install Npm
48-
uses: actions/setup-node@v4
49-
with:
50-
node-version: 20
51-
52-
- name: Npm Build
53-
working-directory: ./gogo-web
54-
run: |
55-
npm install
56-
npm run build --omit=dev
57-
5872
- name: Package common
5973
run: |
6074
mkdir package
61-
cp ./gogo-server/config.json package/config.json
62-
cp -r ./gogo-web/dist/gogo-web package/
63-
75+
cp ./gogo-server/config.json package/
76+
77+
- name: Download web package
78+
uses: actions/download-artifact@v4
79+
with:
80+
name: gogo-web
81+
path: package/
82+
6483
- name: Package Windows
6584
if: runner.os == 'Windows'
6685
run: |
@@ -80,11 +99,49 @@ jobs:
8099
uses: actions/upload-artifact@v4
81100
with:
82101
name: server-web-${{ matrix.target }}
83-
path: ${{ env.PACKAGE_FILE }}
102+
# path: ${{ env.PACKAGE_FILE }}
103+
path: package/
84104
retention-days: 7
85105

86106
# - name: Upload package
87107
# if: runner.os != 'macOS'
88108
# run: gh release upload "${{ needs.create-nightly-release.outputs.tag_name }}" "${{ env.PACKAGE_FILE }}"
89109
# env:
90-
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
110+
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
111+
build-server-for-alpine:
112+
needs: [build-web]
113+
if: ${{!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]')}}
114+
runs-on: ubuntu-latest
115+
container:
116+
image: rust:alpine
117+
volumes:
118+
- ./gogo-server:/gogo-server
119+
env:
120+
RUST_TARGET: x86_64-unknown-linux-musl
121+
steps:
122+
- name: Clone repo
123+
uses: actions/checkout@v4
124+
- name: Install Rust toolchain
125+
run: apk add --no-cache musl-dev openssl-dev
126+
- name: Cargo build
127+
run: |
128+
ls -lh
129+
cd gogo-server
130+
cargo build --release --target ${{ env.RUST_TARGET }}
131+
- name: Package
132+
run: |
133+
ls -lh
134+
mkdir package
135+
cp ./gogo-server/config.json package/
136+
cp ./gogo-server/target/x86_64-unknown-linux-musl/release/gogo-server package/
137+
- name: Download web package
138+
uses: actions/download-artifact@v4
139+
with:
140+
name: gogo-web
141+
path: package/
142+
- name: Archive artifacts
143+
uses: actions/upload-artifact@v4
144+
with:
145+
name: server-web-${{ env.RUST_TARGET }}
146+
path: package/
147+
retention-days: 7

gogo-web/angular.json

+10-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,16 @@
2424
"tsConfig": "tsconfig.app.json",
2525
"assets": [
2626
"src/favicon.ico",
27-
"src/assets"
27+
"src/assets",
28+
"src/android-chrome-192x192.png",
29+
"src/android-chrome-256x256.png",
30+
"src/apple-touch-icon.png",
31+
"src/browserconfig.xml",
32+
"src/favicon-16x16.png",
33+
"src/favicon-32x32.png",
34+
"src/mstile-150x150.png",
35+
"src/safari-pinned-tab.svg",
36+
"src/site.webmanifest"
2837
],
2938
"styles": [
3039
"src/styles.less"
3.63 KB
Loading
4.72 KB
Loading

gogo-web/src/apple-touch-icon.png

3.25 KB
Loading

gogo-web/src/browserconfig.xml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<browserconfig>
3+
<msapplication>
4+
<tile>
5+
<square150x150logo src="/mstile-150x150.png"/>
6+
<TileColor>#da532c</TileColor>
7+
</tile>
8+
</msapplication>
9+
</browserconfig>

gogo-web/src/favicon-16x16.png

630 Bytes
Loading

gogo-web/src/favicon-32x32.png

841 Bytes
Loading

gogo-web/src/favicon.ico

3.81 KB
Binary file not shown.

gogo-web/src/index.html

+14-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,25 @@
11
<!doctype html>
22
<html lang="en">
3+
34
<head>
45
<meta charset="utf-8">
56
<title>勾勾</title>
67
<base href="/">
78
<meta name="viewport" content="width=device-width, initial-scale=1, no-scale=1">
8-
<link rel="icon" type="image/x-icon" href="favicon.ico">
9+
10+
<!-- thanks to https://realfavicongenerator.net/ -->
11+
<link rel="apple-touch-icon" sizes="180x180" href="apple-touch-icon.png">
12+
<link rel="icon" type="image/png" sizes="32x32" href="favicon-32x32.png">
13+
<link rel="icon" type="image/png" sizes="16x16" href="favicon-16x16.png">
14+
<link rel="manifest" href="site.webmanifest">
15+
<link rel="mask-icon" href="safari-pinned-tab.svg" color="#5bbad5">
16+
<meta name="msapplication-TileColor" content="#da532c">
17+
<meta name="theme-color" content="#ffffff">
18+
919
</head>
20+
1021
<body>
1122
<app-root></app-root>
1223
</body>
13-
</html>
24+
25+
</html>

gogo-web/src/mstile-150x150.png

2.16 KB
Loading

gogo-web/src/safari-pinned-tab.svg

+67
Loading

gogo-web/src/site.webmanifest

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"name": "",
3+
"short_name": "",
4+
"icons": [
5+
{
6+
"src": "/android-chrome-192x192.png",
7+
"sizes": "192x192",
8+
"type": "image/png"
9+
},
10+
{
11+
"src": "/android-chrome-256x256.png",
12+
"sizes": "256x256",
13+
"type": "image/png"
14+
}
15+
],
16+
"theme_color": "#ffffff",
17+
"background_color": "#ffffff",
18+
"display": "standalone"
19+
}

0 commit comments

Comments
 (0)