Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

publish action #1

Merged
merged 1 commit into from
Feb 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions .github/ISSUE_TEMPLATE/feature_request.md

This file was deleted.

26 changes: 0 additions & 26 deletions .github/ISSUE_TEMPLATE/issue-report.md

This file was deleted.

37 changes: 0 additions & 37 deletions .github/dependabot.yml

This file was deleted.

30 changes: 0 additions & 30 deletions .github/workflows/build-test.yml

This file was deleted.

38 changes: 0 additions & 38 deletions .github/workflows/codeql-analysis.yml

This file was deleted.

34 changes: 0 additions & 34 deletions .github/workflows/dockerhub-push.yml

This file was deleted.

19 changes: 0 additions & 19 deletions .github/workflows/lint-test.yml

This file was deleted.

28 changes: 28 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: publish

on:
push:
branches:
- main

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v2
with:
push: true
tags: ghcr.io/surface-security/${{ github.event.repository.name }}:${{ github.run_number }},ghcr.io/surface-security/${{ github.event.repository.name }}:latest
29 changes: 29 additions & 0 deletions .github/workflows/publish_dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: publish dev

on:
push:
branches:
- dev
- dev-*

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v2
with:
push: true
tags: ghcr.io/surface-security/${{ github.event.repository.name }}:${{ github.ref_name }}
30 changes: 0 additions & 30 deletions .github/workflows/release-binary.yml

This file was deleted.

19 changes: 6 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
# Go parameters
GOCMD=go
GOBUILD=$(GOCMD) build
GOMOD=$(GOCMD) mod
GOTEST=$(GOCMD) test
GOGET=$(GOCMD) get

all: build
all: test

build:
$(GOBUILD) -v -ldflags="-extldflags=-static" -o "httpx" cmd/httpx/httpx.go
test:
$(GOTEST) -v ./...
tidy:
$(GOMOD) tidy
docker build -t tmp-$(notdir $(CURDIR)) .

test: build
test/run.sh tmp-$(notdir $(CURDIR))
38 changes: 0 additions & 38 deletions build.sh

This file was deleted.

11 changes: 2 additions & 9 deletions test/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,14 @@ set -e
cd $(dirname $0)
cd ..

./build.sh nopush

if [ -e '.git' ]; then
NAME=$(basename $(cat .git/config| grep '/scanners/' | tr -d ' ') | sed -e 's/\.git$//g')
else
# fingers crossed name is the same as repo
NAME=$(basename $(pwd))
fi
NAME=${1}

rm -fr test/output

docker run --rm \
-v $(pwd)/test/input:/input:ro \
-v $(pwd)/test/output:/output \
test/${NAME}:dev \
${NAME} \
"$@" \
/input/input.txt

Expand Down