Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
pkieltyka committed Feb 13, 2024
1 parent c211f99 commit b75c73b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ jobs:
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Docker build
run: |
docker build --build-arg VERSION=${GITHUB_REF##*/} -t ghcr.io/goware/jwtutil:${GITHUB_REF##*/} -t ghcr.io/goware/jwtutil:latest .
docker buildx build --platform="linux/amd64,linux/arm64" --build-arg VERSION=${GITHUB_REF##*/} -t ghcr.io/goware/jwtutil:${GITHUB_REF##*/} -t ghcr.io/goware/jwtutil:latest .
docker push ghcr.io/goware/jwtutil:${GITHUB_REF##*/}
docker push ghcr.io/goware/jwtutil:latest
7 changes: 5 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
# -----------------------------------------------------------------
# Builder
# -----------------------------------------------------------------
FROM golang:1.22.0-alpine3.19 as builder
FROM --platform=$BUILDPLATFORM golang:1.22.0-alpine3.19 as builder

ARG VERSION
ARG TARGETOS
ARG TARGETARCH

RUN apk add --update git

ADD ./ /src

WORKDIR /src
RUN go build -ldflags="-s -w -X github.com/goware/jwtutil.VERSION=${VERSION}" -o /usr/bin/jwtutil .
RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -ldflags="-s -w -X main.VERSION=${VERSION}" -o /usr/bin/jwtutil .

# -----------------------------------------------------------------
# Runner
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ jwtutil

`go install github.com/goware/jwtutil@latest`

or

`docker run ghcr.io/goware/jwtutil`

## Usage

Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"github.com/lestrrat-go/jwx/v2/jwt"
)

var VERSION = "v0.5.0"
var VERSION = ""

var (
flags = flag.NewFlagSet("jwtutil", flag.ExitOnError)
Expand Down

0 comments on commit b75c73b

Please sign in to comment.