diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml new file mode 100644 index 0000000..ec6855b --- /dev/null +++ b/.gitea/workflows/build.yaml @@ -0,0 +1,29 @@ +name: build +run-name: ${{ gitea.actor }} is building. +on: [push] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: docker buildx setup + uses: docker/setup-buildx-action@v3 + - name: login to container registry + uses: docker/login-action@v3 + with: + registry: git.hl.srp.life + username: ${{ gitea.repository_owner }} + password: ${{ secrets.ACTIONS_KEY }} + - name: checkout code + uses: actions/checkout@v4 + - name: build and push to registry + uses: docker/build-push-action@v6 + with: + context: . + file: ./Dockerfile + platforms: | + linux/amd64 + linux/arm64 + push: true + tags: | + ${{ gitea.repository }}:dev diff --git a/.gitea/workflows/test.yaml b/.gitea/workflows/test.yaml new file mode 100644 index 0000000..67fefbc --- /dev/null +++ b/.gitea/workflows/test.yaml @@ -0,0 +1,22 @@ +name: test +run-name: ${{ gitea.actor }} is testing. +on: [push] + +jobs: + test: + runs-on: ubuntu-latest + steps: + - name: checkout code + uses: actions/checkout@v4 + - name: setup go 1.23.1 and fetch deps + uses: actions/setup-go@v5 + with: + go-version: '1.23.1' + cache-dependency-path: go.sum + - name: do the actual test thing + run: go test -json > testresults-1.23.1.json + - name: upload test results + uses: christopherhx/gitea-upload-artifact@v4 + with: + name: go-results-1.23.1 + path: testresults-1.23.1.json \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..ccf4e9b --- /dev/null +++ b/Dockerfile @@ -0,0 +1,10 @@ +FROM golang:1.23 +WORKDIR /app + +COPY . ./ +RUN go mod download + +RUN CGO_ENABLED=0 GOOS=linux go build -o /bingo + +EXPOSE 3005 +CMD [ "/bingo", "run" ] diff --git a/README.md b/README.md index 25041d6..2fddcb6 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ # bingo A lightweight {paste,file}bin alternative written in Golang. +![test status](https://git.hl.srp.life/srp/bingo/actions/workflows/test.yaml/badge.svg) ![build status](https://git.hl.srp.life/srp/bingo/actions/workflows/build.yaml/badge.svg) Overall goal is to create a service that works well as a single-user self-hosted instance, which can trivially upload files/text. diff --git a/cmd/run.go b/cmd/run.go index cbcffe8..053c950 100755 --- a/cmd/run.go +++ b/cmd/run.go @@ -22,7 +22,7 @@ import ( "log" "time" - "git.sr.ht/~seraphimrp/bingo/routes" + "git.hl.srp.life/srp/bingo/routes" "github.com/briandowns/spinner" "github.com/dgraph-io/badger/v4" "github.com/gofiber/fiber/v2" diff --git a/go.mod b/go.mod index 30fbd20..3e6d518 100755 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module git.sr.ht/~seraphimrp/bingo +module git.hl.srp.life/srp/bingo go 1.23.1 diff --git a/main.go b/main.go index 27e5545..c93bb95 100644 --- a/main.go +++ b/main.go @@ -16,7 +16,7 @@ package main -import "git.sr.ht/~seraphimrp/bingo/cmd" +import "git.hl.srp.life/srp/bingo/cmd" func main() { cmd.Execute()