Skip to content

Commit

Permalink
all: update Docker image and built to use Informal Systems (#31)
Browse files Browse the repository at this point in the history
A search and replace of securego/gosec to informalsystems/gosec,
plus updates to the .github/workflows/*.yaml files.

Updates #26
  • Loading branch information
odeke-em committed Aug 5, 2022
1 parent 324096f commit 2c09f88
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 31 deletions.
54 changes: 32 additions & 22 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
name: Release

on:
push:
tags:
- 'v*'
release:
types: [published]

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
GO111MODULE: on

jobs:
build:
runs-on: ubuntu-latest
env:
GO111MODULE: on
permissions:
contents: read
packages: write

steps:
- name: Checkout Source
uses: actions/checkout@v2
Expand All @@ -17,22 +25,24 @@ jobs:
uses: actions/setup-go@v2
with:
go-version: 1.17.x
- name : Get release version
id: get_version
run: echo ::set-env name=RELEASE_VERSION::$(echo ${GITHUB_REF:10})
- name: Release Binaries
uses: goreleaser/goreleaser-action@v2

- name: Log in to the Container registry
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Release Docker Image
uses: elgohr/Publish-Docker-Github-Action@master
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
name: securego/gosec
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
buildargs: GO_VERSION=1.17
tags: "latest,${{ env.RELEASE_VERSION }}"
tag_names: true
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build and push Docker image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
2 changes: 1 addition & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ project_name: gosec

release:
github:
owner: securego
owner: informalsystems
name: gosec

builds:
Expand Down
5 changes: 2 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
ARG GO_VERSION
FROM golang:${GO_VERSION}-alpine AS builder
FROM golang:1.17-alpine AS builder
RUN apk add --update --no-cache ca-certificates make git curl gcc libc-dev
RUN mkdir -p /build
WORKDIR /build
COPY . /build/
RUN go mod download
RUN make build-linux

FROM golang:${GO_VERSION}-alpine
FROM golang:1.17-alpine
RUN apk add --update --no-cache ca-certificates bash git gcc libc-dev
ENV GO111MODULE on
COPY --from=builder /build/gosec /bin/gosec
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
GIT_TAG?= $(shell git describe --always --tags)
BIN = gosec
FMT_CMD = $(gofmt -s -l -w $(find . -type f -name '*.go' -not -path './vendor/*') | tee /dev/stderr)
IMAGE_REPO = securego
IMAGE_REPO = informalsystems
BUILDFLAGS := '-w -s'
CGO_ENABLED = 0
GO := GO111MODULE=on go
Expand Down
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ inputs:

runs:
using: 'docker'
image: 'docker://securego/gosec'
image: 'docker://informalsystems/gosec'
args:
- ${{ inputs.args }}

Expand Down
6 changes: 3 additions & 3 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ set -e
usage() {
this=$1
cat <<EOF
$this: download go binaries for securego/gosec
$this: download go binaries for informalsystems/gosec
Usage: $this [-b] bindir [-d] [tag]
-b sets bindir or installation directory, Defaults to ./bin
-d turns on debug logging
[tag] is a tag from
https://github.com/securego/gosec/releases
https://github.com/informalsystems/gosec/releases
If tag is missing, then the latest will be used.
Generated by godownloader
Expand Down Expand Up @@ -330,7 +330,7 @@ End of functions from https://github.com/client9/shlib
EOF

PROJECT_NAME="gosec"
OWNER=securego
OWNER=informalsystems
REPO="gosec"
BINARY=gosec
FORMAT=tar.gz
Expand Down

0 comments on commit 2c09f88

Please sign in to comment.