diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index e28402c..a050bc2 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -2,13 +2,13 @@ name: CI
on:
push:
branches:
- - master
+ - main
tags:
- '*.*.*' # semver, will override latest
- '*-preview' # preview, won't override latest
pull_request:
branches:
- - master
+ - main
workflow_dispatch: # Allow manual trigger
jobs:
@@ -118,11 +118,13 @@ jobs:
- name: Docker login
uses: docker/login-action@v3
with:
- username: ${{ secrets.DOCKER_USERNAME }}
- password: ${{ secrets.DOCKER_PASSWORD }}
+ registry: ghcr.io
+ username: ${{ github.actor }}
+ password: ${{ secrets.GH_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
+
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
@@ -132,8 +134,7 @@ jobs:
run: make VERSION=${{ steps.extract_ref.outputs.GIT_REF }} deploy-docker
- name: Deploy on GitHub releases
- uses: softprops/action-gh-release@v1
+ uses: softprops/action-gh-release@v2
with:
files: build/smocker.tar.gz
- env:
- GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
+ token: ${{ secrets.GH_TOKEN }}
diff --git a/.gitignore b/.gitignore
index 5bf8af4..fe121a1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -7,5 +7,4 @@ node_modules/
sessions/
smocker
smocker.test
-vendor/
yarn-error.log
diff --git a/Dockerfile b/Dockerfile
index 1fafbb5..38ee85e 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,8 +1,9 @@
-FROM golang:1.18-alpine AS build-backend
+ARG GO_VERSION=1.22
+FROM golang:${GO_VERSION}-alpine AS build-backend
RUN apk add --no-cache make
ARG VERSION=snapshot
ARG COMMIT
-WORKDIR /go/src/github.com/Thiht/smocker
+WORKDIR /go/src/smocker
COPY go.mod go.sum ./
RUN go mod download
COPY Makefile main.go ./
@@ -13,5 +14,5 @@ FROM alpine
WORKDIR /opt
EXPOSE 8080 8081
COPY build/client client/
-COPY --from=build-backend /go/src/github.com/Thiht/smocker/build/* /opt/
+COPY --from=build-backend /go/src/smocker/build/* /opt/
CMD ["/opt/smocker"]
diff --git a/Makefile b/Makefile
index c82d4c4..3b2a60a 100644
--- a/Makefile
+++ b/Makefile
@@ -15,8 +15,7 @@ ifeq ($(RELEASE), 1)
endif
GO_LDFLAGS:=-ldflags="$(GO_LDFLAGS)"
-DOCKER_ACCOUNT?=thiht
-DOCKER_IMAGE=$(DOCKER_ACCOUNT)/$(APPNAME)
+DOCKER_IMAGE=ghcr.io/smocker-dev/smocker
# See: https://docs.docker.com/engine/reference/commandline/tag/#extended-description
# A tag name must be valid ASCII and may contain lowercase and uppercase letters, digits, underscores, periods and dashes.
@@ -63,7 +62,7 @@ start: $(REFLEX)
.PHONY: build
build:
- go build $(GO_LDFLAGS) -o ./build/$(APPNAME)
+ go build -trimpath $(GO_LDFLAGS) -o ./build/$(APPNAME)
.PHONY: lint
lint: $(GOLANGCILINT)
diff --git a/README.md b/README.md
index 092ce27..6c627c0 100644
--- a/README.md
+++ b/README.md
@@ -2,11 +2,11 @@
-[![CI](https://github.com/Thiht/smocker/actions/workflows/main.yml/badge.svg)](https://github.com/Thiht/smocker/actions/workflows/main.yml)
-[![Docker Repository](https://img.shields.io/badge/docker-thiht%2Fsmocker-blue?logo=docker)](https://hub.docker.com/r/thiht/smocker)
-[![Github Release](https://img.shields.io/github/v/release/Thiht/smocker.svg?logo=github)](https://github.com/Thiht/smocker/releases/latest)
-[![Go Report Card](https://goreportcard.com/badge/github.com/Thiht/smocker)](https://goreportcard.com/report/github.com/Thiht/smocker)
-[![License](https://img.shields.io/github/license/Thiht/smocker?logo=open-source-initiative)](https://github.com/Thiht/smocker/blob/master/LICENSE)
+[![CI](https://github.com/smocker-dev/smocker/actions/workflows/main.yml/badge.svg)](https://github.com/smocker-dev/smocker/actions/workflows/main.yml)
+
+[![Github Release](https://img.shields.io/github/v/release/smocker-dev/smocker.svg?logo=github)](https://github.com/smocker-dev/smocker/releases/latest)
+[![Go Report Card](https://goreportcard.com/badge/github.com/smocker-dev/smocker)](https://goreportcard.com/report/github.com/smocker-dev/smocker)
+[![License](https://img.shields.io/github/license/smocker-dev/smocker?logo=open-source-initiative)](https://github.com/smocker-dev/smocker/blob/main/LICENSE)
**Smocker** (server mock) is a simple and efficient HTTP mock server.
@@ -40,7 +40,7 @@ docker run -d \
-p 8080:8080 \
-p 8081:8081 \
--name smocker \
- thiht/smocker
+ ghcr.io/smocker-dev/smocker
```
### Manual Deployment
@@ -48,7 +48,7 @@ docker run -d \
```sh
# This will be the deployment folder for the Smocker instance
mkdir -p /opt/smocker && cd /opt/smocker
-wget -P /tmp https://github.com/Thiht/smocker/releases/latest/download/smocker.tar.gz
+wget -P /tmp https://github.com/smocker-dev/smocker/releases/latest/download/smocker.tar.gz
tar xf /tmp/smocker.tar.gz
nohup ./smocker -mock-server-listen-port=8080 -config-listen-port=8081 &
```
diff --git a/client/components/App.tsx b/client/components/App.tsx
index e937ac9..359abba 100644
--- a/client/components/App.tsx
+++ b/client/components/App.tsx
@@ -47,7 +47,7 @@ const App = () => (
Smocker version {window.version} – MIT Licensed