diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e788fdc..aea1f30 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,3 +29,26 @@ jobs: args: release --rm-dist env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - + name: Log in to the Container registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + - + name: Build and push image + id: docker_build + uses: docker/build-push-action@v3 + with: + context: . + platforms: linux/amd64 + push: true + tags: | + ghcr.io/juev/starred:latest + - + name: Image digest + run: echo ${{ steps.docker_build.outputs.digest }} diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 228f884..74ae9c1 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -9,12 +9,13 @@ builds: - windows - darwin archives: - - replacements: - darwin: Darwin - linux: Linux - windows: Windows - 386: i386 - amd64: x86_64 + - + format: binary + name_template: >- + {{ .ProjectName }}- + {{- .Os }}- + {{- if eq .Arch "amd64" }}amd64 + {{- else }}{{ .Arch }}{{ end }} checksum: name_template: 'checksums.txt' snapshot: diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..a420c1f --- /dev/null +++ b/Dockerfile @@ -0,0 +1,19 @@ +FROM bash:latest + +ARG TARGETARCH="amd64" +ARG TARGETOS="linux" +ARG TARGETPLATFORM="linux/amd64" + +ARG USER_UID=1001 + +ADD https://github.com/juev/starred/releases/latest/download/starred-linux-amd64 /usr/local/bin/starred + +RUN set -eux; \ + \ + apk add --no-cache curl; \ + rm -rf /var/cache/apk; \ + \ + adduser -D runner -u $USER_UID; \ + chmod +rx /usr/local/bin/starred; + +USER runner \ No newline at end of file