diff --git a/.ansible/playbook.yml b/.ansible/playbook.yml index 33eb5af..3dc2f41 100644 --- a/.ansible/playbook.yml +++ b/.ansible/playbook.yml @@ -5,23 +5,23 @@ tasks: - name: Copy build to remote ansible.builtin.copy: - src: ../build/sour.is-paste + src: ../sour.is-paste dest: /usr/local/bin/sour.is-paste mode: u=rwx,g=rx,o=rx - owner: root + owner: root group: root - name: Copy build to remote ansible.builtin.copy: src: sour.is-paste.service dest: /etc/systemd/system/sour.is-paste.service - mode: u=r,g=r,o=r - owner: root + mode: u=r,g=r,o=r + owner: root group: root - name: Restart service systemd: - name: sour.is-paste - enabled: true + name: sour.is-paste + enabled: true daemon_reload: true state: restarted diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index 14b07e5..fe8b38f 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -2,19 +2,15 @@ name: Deploy on: push: - branches: [ "main", "master" ] + branches: [ "master" ] release: types: [ published ] jobs: deploy: runs-on: ubuntu-latest - steps: + steps: - uses: actions/checkout@v3 - with: - fetch-depth: 0 - fetch-tags: true - - run: apt-get update && apt-get -y install ansible - name: Set up Go @@ -22,15 +18,17 @@ jobs: with: go-version: 1.21.1 - - name: Build - run: go build -ldflags "-s -w" -o ./build/sour.is-paste ./cmd/paste + - name: Install + run: go install -ldflags "-s -w" go.sour.is/paste/cmd/paste@latest + + - run: mv $(go env GOPATH)/bin/paste sour.is-paste - name: Compress uses: https://git.sour.is/actions/ghaction-upx@v2.4.0 with: version: latest files: | - ./build/sour.is-paste + ./sour.is-paste args: -fq - name: Deploy diff --git a/Makefile b/Makefile index 5939b03..a64f313 100644 --- a/Makefile +++ b/Makefile @@ -37,7 +37,7 @@ run: $(BINARY): $(SOURCE) $(ROUTE_ASSET) $(DOCS_ASSET) go build -v \ -ldflags "-X main.AppVersion=$(VERSION) -X main.AppBuild=$(DATE)" \ - "sour.is/x/paste/cmd/paste" + "go.sour.is/paste/cmd/paste" clean-ui: rm -rf $(ROUTE_ASSET) $(DOCS_ASSET) @@ -47,12 +47,12 @@ $(ROUTE_ASSET): rm -rf build ../public; \ npm i; npm run build; \ cp -r build ../public - go generate "sour.is/x/paste/src/routes" + go generate "go.sour.is/paste/src/routes" $(DOCS_ASSET): echo "$$DUMMY_BINDATA" > src/docs/bindata.go - go generate "sour.is/x/paste/cmd/paste" - go generate "sour.is/x/paste/src/docs" + go generate "go.sour.is/paste/cmd/paste" + go generate "go.sour.is/paste/src/docs" deploy: $(SOURCE) $(ROUTE_ASSET) cd debian && make diff --git a/cmd/paste/main.go b/cmd/paste/main.go index 2fb0a92..210afd0 100644 --- a/cmd/paste/main.go +++ b/cmd/paste/main.go @@ -24,15 +24,15 @@ // // // swagger:meta -package main // import "sour.is/x/paste/cmd/paste" +package main // import "go.sour.is/paste/cmd/paste" import ( "os" "os/signal" "syscall" - _ "sour.is/x/paste/src/docs" - _ "sour.is/x/paste/src/routes" + _ "go.sour.is/paste/src/docs" + _ "go.sour.is/paste/src/routes" "sour.is/x/toolbox/httpsrv" "sour.is/x/toolbox/log" ) diff --git a/debian/Makefile b/debian/Makefile index 6e7b660..a52bfe1 100644 --- a/debian/Makefile +++ b/debian/Makefile @@ -25,7 +25,7 @@ build: export BUILD="BUILD/$(NAME)_$(VERSION)"; \ env GOOS=linux GOARCH=amd64 go build -v -o $${BUILD}/opt/sour.is/bin/paste \ -ldflags "-X main.AppVersion=$(VERSION) -X main.AppBuild=$(DATE)"\ - sour.is/x/paste/cmd/paste && \ + go.sour.is/paste/cmd/paste && \ dpkg -b $${BUILD} copy: diff --git a/go.mod b/go.mod index 068af89..72ee10f 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module sour.is/x/paste +module go.sour.is/paste go 1.14 diff --git a/src/pkg/promise/promise.go b/src/pkg/promise/promise.go index 34531ad..d1f5fe8 100644 --- a/src/pkg/promise/promise.go +++ b/src/pkg/promise/promise.go @@ -7,7 +7,7 @@ import ( "time" "go.uber.org/ratelimit" - "sour.is/x/paste/src/pkg/cache" + "go.sour.is/paste/src/pkg/cache" "sour.is/x/toolbox/log" ) diff --git a/src/routes/artifact.go b/src/routes/artifact.go index adaa86a..7721f28 100644 --- a/src/routes/artifact.go +++ b/src/routes/artifact.go @@ -14,7 +14,7 @@ import ( "strings" "github.com/gorilla/mux" - "sour.is/x/paste/src/pkg/readutil" + "go.sour.is/paste/src/pkg/readutil" "sour.is/x/toolbox/httpsrv" "sour.is/x/toolbox/log" diff --git a/src/routes/identity.go b/src/routes/identity.go index a30bb9c..77fee9a 100644 --- a/src/routes/identity.go +++ b/src/routes/identity.go @@ -21,8 +21,8 @@ import ( "github.com/tv42/zbase32" "golang.org/x/crypto/openpgp/armor" - "sour.is/x/paste/src/pkg/cache" - "sour.is/x/paste/src/pkg/promise" + "go.sour.is/paste/src/pkg/cache" + "go.sour.is/paste/src/pkg/promise" "sour.is/x/toolbox/httpsrv" "sour.is/x/toolbox/log" ) diff --git a/src/routes/image.go b/src/routes/image.go index 8854cb3..dda753e 100644 --- a/src/routes/image.go +++ b/src/routes/image.go @@ -16,7 +16,7 @@ import ( "sour.is/x/toolbox/httpsrv" "sour.is/x/toolbox/log" - "sour.is/x/paste/src/pkg/readutil" + "go.sour.is/paste/src/pkg/readutil" ) func init() { diff --git a/src/routes/paste.go b/src/routes/paste.go index c38a647..23da254 100644 --- a/src/routes/paste.go +++ b/src/routes/paste.go @@ -17,7 +17,7 @@ import ( "github.com/gorilla/mux" "golang.org/x/sys/unix" - "sour.is/x/paste/src/pkg/readutil" + "go.sour.is/paste/src/pkg/readutil" "sour.is/x/toolbox/httpsrv" "sour.is/x/toolbox/log"