-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
295 additions
and
131 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,27 +41,13 @@ jobs: | |
automatic_release_tag: latest | ||
files: | | ||
dist/* | ||
build-docker: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Login to DockerHub | ||
uses: docker/login-action@v3 | ||
with: | ||
- name: Setup ko | ||
uses: ko-build/[email protected] | ||
env: | ||
KO_DOCKER_REPO: docker.io/vaalacat/frp-panel | ||
- env: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- name: Build and push | ||
uses: docker/build-push-action@v3 | ||
with: | ||
context: . | ||
file: ./Dockerfile.standalone | ||
push: true | ||
platforms: linux/amd64,linux/arm64 | ||
tags: vaalacat/frp-panel:latest | ||
run: | | ||
echo "${password}" | ko login docker.io --username ${username} --password-stdin | ||
ko build ./cmd/frpp --bare |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,32 +42,14 @@ jobs: | |
automatic_release_tag: ${{ steps.get_version.outputs.VERSION }} | ||
files: | | ||
dist/* | ||
build-docker: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Get version | ||
id: get_version | ||
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Get git tag history | ||
run: git fetch -a | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Login to DockerHub | ||
uses: docker/login-action@v3 | ||
with: | ||
- name: Setup ko | ||
uses: ko-build/[email protected] | ||
env: | ||
KO_DOCKER_REPO: docker.io/vaalacat/frp-panel | ||
- name: Build image with ko | ||
env: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- name: Build and push | ||
uses: docker/build-push-action@v3 | ||
with: | ||
context: . | ||
file: ./Dockerfile.standalone | ||
push: true | ||
platforms: linux/amd64,linux/arm64 | ||
tags: vaalacat/frp-panel:${{ steps.get_version.outputs.VERSION }} | ||
run: | | ||
echo "${password}" | ko login docker.io --username ${username} --password-stdin | ||
ko build ./cmd/frpp --bare -t ${{ steps.get_version.outputs.VERSION }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
defaultBaseImage: alpine | ||
|
||
builds: | ||
- id: frpp | ||
dir: . | ||
main: ./cmd/frpp | ||
ldflags: | ||
- -s -w | ||
- -X github.com/VaalaCat/frp-panel/conf.buildDate={{.Date}} | ||
- -X github.com/VaalaCat/frp-panel/conf.gitCommit={{.Git.FullCommit}} | ||
- -X github.com/VaalaCat/frp-panel/conf.gitVersion={{.Git.Tag}} | ||
- -X github.com/VaalaCat/frp-panel/conf.gitBranch={{.Git.Branch}} | ||
|
||
defaultPlatforms: | ||
- linux/arm64 | ||
- linux/amd64 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,5 +14,6 @@ func main() { | |
conf.InitConfig() | ||
rpc.InitRPCClients() | ||
|
||
setMasterCommandIfNonePresent() | ||
rootCmd.Execute() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package utils | ||
|
||
import ( | ||
"os" | ||
"path/filepath" | ||
) | ||
|
||
func EnsureDirectoryExists(filePath string) error { | ||
directory := filepath.Dir(filePath) | ||
|
||
if _, err := os.Stat(directory); os.IsNotExist(err) { | ||
err = os.MkdirAll(directory, os.ModePerm) | ||
if err != nil { | ||
return err | ||
} | ||
} | ||
return nil | ||
} |
Oops, something went wrong.