File tree Expand file tree Collapse file tree 5 files changed +39
-13
lines changed
Expand file tree Collapse file tree 5 files changed +39
-13
lines changed Original file line number Diff line number Diff line change @@ -33,32 +33,36 @@ jobs:
3333 restore-keys : |
3434 ${{ runner.os }}-go-
3535
36- # - name: Minify HTML files
37- # run: |
38- # npm install html-minifier -g
39- # html-minifier --collapse-whitespace --minify-css true --minify-js true index.html>index.min.html
40- # html-minifier --collapse-whitespace --minify-css true --minify-js true receive.html>receive.min.html
41- # mv index.min.html index.html
42- # mv receive.min.html receive.html
43-
4436 - name : Build
4537 run : |
38+ sh minify.sh
39+
4640 export GOOS=linux
4741 export GOARCH=amd64
48- go build -trimpath -ldflags="-s -w" -o "dist/onesend" .
42+ go build -trimpath -ldflags="-s -w" -o "dist/onesend-amd64" .
43+
44+ export GOOS=linux
45+ export GOARCH=arm64
46+ go build -trimpath -ldflags="-s -w" -o "dist/onesend-arm64" .
4947
5048 export GOOS=windows
5149 export GOARCH=amd64
5250 go build -trimpath -ldflags="-s -w" -o "dist/onesend.exe" .
5351
52+ cp config.sample.toml dist/config.toml
53+ touch dist/token.txt
54+
5455 cd dist
55- tar zcf onesend-test-${GITHUB_SHA:0:7}-linux-x86_64.tar.gz onesend
56- zip onesend-test-${GITHUB_SHA:0:7}-windows-x86_64.zip onesend.exe
56+ mv onesend-amd64 onesend
57+ tar Jcf onesend-ci-${GITHUB_SHA:0:7}-linux-x86_64.tar.xz onesend config.toml token.txt
58+ mv onesend-arm64 onesend
59+ tar Jcf onesend-ci-${GITHUB_SHA:0:7}-linux-arm64.tar.xz onesend config.toml token.txt
60+ zip onesend-ci-${GITHUB_SHA:0:7}-windows-x86_64.zip onesend.exe config.toml token.txt
5761
5862 - name : Upload artifact
5963 uses : actions/upload-artifact@v2
6064 with :
6165 name : executable
6266 path : |
63- dist/*.tar.gz
67+ dist/*.tar.xz
6468 dist/*.zip
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ ClientID = ""
33ClientSecret = " "
44AccountArea = " global"
55SavePath = " /onesend"
6+ Drive = " /me/drive"
67
78[Sender ]
89Listen = " 0.0.0.0:7777"
Original file line number Diff line number Diff line change @@ -27,7 +27,6 @@ <h1>Share your files</h1>
2727 < button id ="upload-button " class ="action-button " disabled >
2828 Upload
2929 </ button >
30- < div id ="upload-process "> </ div >
3130 < div id ="main-display "> </ div >
3231 </ div >
3332 </ body >
Original file line number Diff line number Diff line change 1+ npm install html-minifier uglifycss uglify-js -g
2+
3+ html-minifier --collapse-whitespace --minify-css true --minify-js true homepage.html > homepage.min.html
4+ mv homepage.min.html homepage.html
5+ html-minifier --collapse-whitespace --minify-css true --minify-js true receive.html > receive.min.html
6+ mv receive.min.html receive.html
7+
8+ uglifycss assets/homepage.css > assets/homepage.min.css
9+ mv assets/homepage.min.css assets/homepage.css
10+ uglifycss assets/receive.css > assets/receive.min.css
11+ mv assets/receive.min.css assets/receive.css
12+
13+ uglifyjs assets/homepage.js > assets/homepage.min.js
14+ mv assets/homepage.min.js assets/homepage.js
15+ uglifyjs assets/receive.js > assets/receive.min.js
16+ mv assets/receive.min.js assets/receive.js
17+ uglifyjs assets/human-readable.js > assets/human-readable.min.js
18+ mv assets/human-readable.min.js assets/human-readable.js
Original file line number Diff line number Diff line change @@ -213,6 +213,10 @@ func entry() error {
213213 c .Header ("Cache-Control" , "public, max-age=604800" )
214214 c .Data (200 , "text/html" , publicIndex )
215215 })
216+ r .GET ("/index.html" , func (c * gin.Context ) {
217+ c .Header ("Cache-Control" , "public, max-age=604800" )
218+ c .Data (200 , "text/html" , publicIndex )
219+ })
216220 r .GET ("/s/:read_id" , func (c * gin.Context ) {
217221 //readID := c.Param("read_id")
218222 //if pusher := c.Writer.Pusher(); pusher != nil {
You can’t perform that action at this time.
0 commit comments