Alcex commited on
Commit
8e108cf
·
2 Parent(s): dca6a23 27a8aca

Add application file

Browse files
.chglog/CHANGELOG.tpl.md DELETED
@@ -1,42 +0,0 @@
1
- {{ range .Versions }}
2
- <a name="{{ .Tag.Name }}"></a>
3
- ## {{ if .Tag.Previous }}[{{ .Tag.Name }}]{{ else }}{{ .Tag.Name }}{{ end }} - {{ datetime "2006-01-02" .Tag.Date }}
4
- {{ range .CommitGroups -}}
5
- ### {{ .Title }}
6
- {{ range .Commits -}}
7
- - {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }}
8
- {{ end }}
9
- {{ end -}}
10
-
11
- {{- if .RevertCommits -}}
12
- ### Reverts
13
- {{ range .RevertCommits -}}
14
- - {{ .Revert.Header }}
15
- {{ end }}
16
- {{ end -}}
17
-
18
- {{- if .MergeCommits -}}
19
- ### Pull Requests
20
- {{ range .MergeCommits -}}
21
- - {{ .Header }}
22
- {{ end }}
23
- {{ end -}}
24
-
25
- {{- if .NoteGroups -}}
26
- {{ range .NoteGroups -}}
27
- ### {{ .Title }}
28
- {{ range .Notes }}
29
- {{ .Body }}
30
- {{ end }}
31
- {{ end -}}
32
- {{ end -}}
33
- {{ end -}}
34
-
35
- {{- if .Versions }}
36
- [Unreleased]: {{ .Info.RepositoryURL }}/compare/{{ $latest := index .Versions 0 }}{{ $latest.Tag.Name }}...HEAD
37
- {{ range .Versions -}}
38
- {{ if .Tag.Previous -}}
39
- [{{ .Tag.Name }}]: {{ $.Info.RepositoryURL }}/compare/{{ .Tag.Previous.Name }}...{{ .Tag.Name }}
40
- {{ end -}}
41
- {{ end -}}
42
- {{ end -}}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
.chglog/config.yml DELETED
@@ -1,28 +0,0 @@
1
- style: github
2
- template: CHANGELOG.tpl.md
3
- info:
4
- title: CHANGELOG
5
- repository_url: https://github.com/aurorax-neo/free-gpt3.5-2api
6
- options:
7
- commits:
8
- # filters:
9
- # Type:
10
- # - feat
11
- # - fix
12
- # - perf
13
- # - refactor
14
- commit_groups:
15
- # title_maps:
16
- # feat: Features
17
- # fix: Bug Fixes
18
- # perf: Performance Improvements
19
- # refactor: Code Refactoring
20
- header:
21
- pattern: "^(\\w*)(?:\\(([\\w\\$\\.\\-\\*\\s]*)\\))?\\:\\s(.*)$"
22
- pattern_maps:
23
- - Type
24
- - Scope
25
- - Subject
26
- notes:
27
- keywords:
28
- - BREAKING CHANGE
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
.github/workflows/Auto Release.yml DELETED
@@ -1,89 +0,0 @@
1
- name: Auto Release
2
-
3
- on:
4
- push:
5
- tags:
6
- - 'release-v*'
7
-
8
- env:
9
- APP_NAME: free-gpt3.5-2api
10
-
11
- jobs:
12
- release:
13
- runs-on: ubuntu-latest
14
- steps:
15
-
16
- - name: Checkout code
17
- uses: actions/checkout@v4
18
- with:
19
- fetch-depth: 0
20
-
21
- - name: Set up Go
22
- uses: actions/setup-go@v5
23
- with:
24
- go-version: 'stable'
25
- check-latest: true
26
-
27
- - name: Build Binary
28
- run: |
29
- GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o ${{ env.APP_NAME }} -a -ldflags '-s -w -extldflags "-static"' . && rm -rf artifact && mkdir -p artifact && cp ${{ env.APP_NAME }} artifact/${{ env.APP_NAME }} && cd artifact && tar -czvf ../${{ env.APP_NAME }}-linux-amd64.tar.gz * && cd ..
30
- GOOS=darwin GOARCH=amd64 CGO_ENABLED=0 go build -o ${{ env.APP_NAME }} -a -ldflags '-s -w -extldflags "-static"' . && rm -rf artifact && mkdir -p artifact && cp ${{ env.APP_NAME }} artifact/${{ env.APP_NAME }} && cd artifact && tar -czvf ../${{ env.APP_NAME }}-darwin-amd64.tar.gz * && cd ..
31
- GOOS=freebsd GOARCH=amd64 CGO_ENABLED=0 go build -o ${{ env.APP_NAME }} -a -ldflags '-s -w -extldflags "-static"' . && rm -rf artifact && mkdir -p artifact && cp ${{ env.APP_NAME }} artifact/${{ env.APP_NAME }} && cd artifact && tar -czvf ../${{ env.APP_NAME }}-freebsd-amd64.tar.gz * && cd ..
32
- GOOS=windows GOARCH=amd64 CGO_ENABLED=0 go build -o ${{ env.APP_NAME }} -a -ldflags '-s -w -extldflags "-static"' . && rm -rf artifact && mkdir -p artifact && cp ${{ env.APP_NAME }} artifact/${{ env.APP_NAME }}.exe && cd artifact && tar -czvf ../${{ env.APP_NAME }}-windows-amd64.tar.gz * && cd ..
33
-
34
- - name: Upload Artifact
35
- uses: actions/upload-artifact@main
36
- with:
37
- name: ${{ env.APP_NAME }}-pre-built.zip
38
- path: |
39
- ${{ env.APP_NAME }}-windows-amd64.tar.gz
40
- ${{ env.APP_NAME }}-linux-amd64.tar.gz
41
- ${{ env.APP_NAME }}-darwin-amd64.tar.gz
42
- ${{ env.APP_NAME }}-freebsd-amd64.tar.gz
43
-
44
- - name: Get Release Name
45
- shell: bash
46
- id: grn
47
- run: echo "tag=$(echo $GITHUB_REF | sed 's|refs/tags/||')" >> $GITHUB_OUTPUT
48
-
49
- - name: Generate Changelog
50
- id: changelog
51
- run: |
52
- export PATH=$PATH:$HOME/go/bin
53
- go install github.com/git-chglog/git-chglog/cmd/git-chglog@latest
54
- git-chglog -o CHANGELOG.md ${{ steps.grn.outputs.tag }}
55
-
56
- - name: Release
57
- id: release
58
- uses: softprops/action-gh-release@v2
59
- if: startsWith(github.ref, 'refs/tags/')
60
- env:
61
- # GITHUB_TOKEN
62
- GITHUB_TOKEN: ${{ secrets.GB_TOKEN }}
63
- with:
64
- # tag_name: 使用 tag
65
- tag_name: ${{ github.ref }}
66
- # release_name: 使用 tag
67
- name: ${{ steps.grn.outputs.tag }}
68
- # body: 使用 changelog
69
- body_path: CHANGELOG.md
70
- # 草稿
71
- draft: false
72
- # 预发布
73
- prerelease: false
74
- # 自动生成 release notes
75
- generate_release_notes: true
76
- # 上传文件
77
- files: |
78
- ${{ env.APP_NAME }}-linux-amd64.tar.gz
79
- ${{ env.APP_NAME }}-windows-amd64.tar.gz
80
- ${{ env.APP_NAME }}-darwin-amd64.tar.gz
81
- ${{ env.APP_NAME }}-freebsd-amd64.tar.gz
82
-
83
- - name: Delete Workflow Runs
84
- uses: Mattraks/delete-workflow-runs@v2
85
- with:
86
- token: ${{ secrets.GB_TOKEN }}
87
- repository: ${{ github.repository }}
88
- retain_days: 1
89
- keep_minimum_runs: 8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
.github/workflows/Build Docker Image.yml DELETED
@@ -1,67 +0,0 @@
1
- name: Build Docker Image
2
-
3
- on:
4
- push:
5
- tags:
6
- - 'release-v*'
7
- workflow_dispatch:
8
-
9
- env:
10
- GHCR_REPO: ghcr.io/aurorax-neo/free-gpt3.5-2api
11
-
12
- jobs:
13
- main:
14
- runs-on: ubuntu-latest
15
- steps:
16
- - name: Checkout
17
- uses: actions/checkout@v4
18
- with:
19
- fetch-depth: 0
20
-
21
- - name: Get Docker Image Tag
22
- shell: bash
23
- id: get_docker_image_tag
24
- run: echo "tag=$(echo $GITHUB_REF | sed 's|refs/tags/release-v||')" >> $GITHUB_OUTPUT
25
-
26
- - name: Set Up QEMU
27
- uses: docker/setup-qemu-action@v3
28
-
29
- - name: Set Up Docker Buildx
30
- uses: docker/setup-buildx-action@v3
31
-
32
- - name: Login To GitHub Container Registry
33
- uses: docker/login-action@v3
34
- with:
35
- registry: ghcr.io
36
- username: ${{ github.repository_owner }}
37
- password: ${{ secrets.GB_TOKEN }}
38
-
39
- - name: Cache Docker Layers
40
- uses: actions/cache@v4
41
- with:
42
- path: /tmp/.buildx-cache
43
- key: "${{ runner.os }}-buildx-${{ github.sha }}"
44
- restore-keys: |
45
- ${{ runner.os }}-buildx-
46
-
47
- - name: Build Docker Image And Push To GHCR
48
- uses: docker/build-push-action@v5
49
- with:
50
- push: true
51
- context: .
52
- platforms: linux/amd64,linux/arm64
53
- file: Dockerfile
54
- tags: |
55
- ${{ env.GHCR_REPO }}:latest
56
- ${{ env.GHCR_REPO }}:${{ steps.get_docker_image_tag.outputs.tag }}
57
- ${{ env.GHCR_REPO }}:${{ github.sha }}
58
- cache-from: type=local,src=/tmp/.buildx-cache
59
- cache-to: type=local,dest=/tmp/.buildx-cache,mode=max
60
-
61
- - name: Delete Workflow Runs
62
- uses: Mattraks/delete-workflow-runs@v2
63
- with:
64
- token: ${{ secrets.GB_TOKEN }}
65
- repository: ${{ github.repository }}
66
- retain_days: 1
67
- keep_minimum_runs: 8