Skip to content

Commit

Permalink
Workflow update (#56)
Browse files Browse the repository at this point in the history
* workflow updates

* more updates

* version update
  • Loading branch information
ehsandeep authored Feb 9, 2023
1 parent 1aff4d9 commit b5e83f6
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 51 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.18
go-version: 1.19

- name: Check out code
uses: actions/checkout@v3
Expand All @@ -23,3 +23,6 @@ jobs:
- name: Example Code Tests
run: go build .
working-directory: examples/

- name: Run test
run: go test ./...
6 changes: 3 additions & 3 deletions .github/workflows/dockerhub-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ jobs:
- name: Get Github tag
id: meta
run: |
echo "::set-output name=tag::$(curl --silent --header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' --header 'content-type: application/json' \
"https://api.github.com/repos/projectdiscovery/asnmap/releases/latest" | jq -r .tag_name)"
curl --silent "https://api.github.com/repos/projectdiscovery/asnmap/releases/latest" | jq -r .tag_name | xargs -I {} echo TAG={} >> $GITHUB_OUTPUT
- name: Set up QEMU
uses: docker/setup-qemu-action@v2

Expand All @@ -37,4 +37,4 @@ jobs:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: projectdiscovery/asnmap:latest,projectdiscovery/asnmap:${{ steps.meta.outputs.tag }}
tags: projectdiscovery/asnmap:latest,projectdiscovery/asnmap:${{ steps.meta.outputs.TAG }}
3 changes: 2 additions & 1 deletion .github/workflows/lint-test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: 🙏🏻 Lint Test

on:
pull_request:
workflow_dispatch:
Expand All @@ -14,7 +15,7 @@ jobs:
- name: "Set up Go"
uses: actions/setup-go@v3
with:
go-version: 1.18
go-version: 1.19

- name: Run golangci-lint
uses: golangci/golangci-lint-action@v3.4.0
Expand Down
14 changes: 9 additions & 5 deletions .github/workflows/release-binary.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
name: 🎉 Release Binary

on:
create:
push:
tags:
- v*
- '*'
workflow_dispatch:

jobs:
Expand All @@ -17,12 +18,15 @@ jobs:
- name: "Set up Go"
uses: actions/setup-go@v3
with:
go-version: 1.18
go-version: 1.19

- name: "Create release on GitHub"
uses: goreleaser/goreleaser-action@v4
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
with:
args: "release --rm-dist"
version: latest
workdir: .
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
DISCORD_WEBHOOK_ID: "${{ secrets.DISCORD_WEBHOOK_ID }}"
DISCORD_WEBHOOK_TOKEN: "${{ secrets.DISCORD_WEBHOOK_TOKEN }}"
20 changes: 0 additions & 20 deletions .github/workflows/run-test.yml

This file was deleted.

48 changes: 29 additions & 19 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,32 @@
before:
hooks:
- go mod tidy

builds:
- binary: asnmap
id: asnmap
main: ./cmd/asnmap/
goos:
- linux
- windows
- darwin
goarch:
- amd64
- 386
- arm
- arm64
- binary: '{{ .ProjectName }}'
main: cmd/asnmap/asnmap.go

# release options (https://goreleaser.com/customization/release/)

release:
draft: true
prerelease: auto

archives:
- id: tgz
format: tar.gz
replacements:
darwin: macOS
format_overrides:
- goos: windows
format: zip
- format: zip
replacements:
darwin: macOS

checksum:
algorithm: sha256

announce:
slack:
enabled: true
channel: '#release'
username: GoReleaser
message_template: 'New Release: {{ .ProjectName }} {{.Tag}} is published! Check it out at {{ .ReleaseURL }}'

discord:
enabled: true
message_template: '**New Release: {{ .ProjectName }} {{.Tag}}** is published! Check it out at {{ .ReleaseURL }}'
4 changes: 2 additions & 2 deletions runner/banner.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ const banner = `
/ _ | / __/ |/ /_ _ ___ ____
/ __ |_\ \/ / ' \/ _ / _ \
/_/ |_/___/_/|_/_/_/_/\_,_/ .__/
/_/ v0.0.1
/_/ v1.0.0
`

// Version is the current version of mapcidr
const Version = `v0.0.1`
const Version = `v1.0.0`

// showBanner is used to show the banner to the user
func showBanner() {
Expand Down

0 comments on commit b5e83f6

Please sign in to comment.