Skip to content

Commit

Permalink
Added updating edge release to actions
Browse files Browse the repository at this point in the history
  • Loading branch information
rezen committed Aug 8, 2020
1 parent 14c862b commit 2b2d680
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 7 deletions.
57 changes: 51 additions & 6 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
---
on:
name: Build Release
env:
RELEASE_ID: 29469484
on:
push:
branches:
- master
name: Build Release
jobs:
clear-assets:
runs-on: ubuntu-latest
steps:
- name: Delete all assets for the release
run: |
curl "https://api.github.com/repos/rezen/dnese/releases/${RELEASE_ID}/assets" \
| jq -r '.[].url' \
| xargs -I{} curl -H "Authorization: Bearer ${GITHUB_TOKEN}" -X DELETE {}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
release:
strategy:
matrix:
Expand All @@ -15,16 +27,21 @@ jobs:
- uses: actions/setup-go@v2
with:
go-version: '^1.13.1'
- name: setup env
- name: Setup env for go
run: |
echo "::set-env name=GOPATH::$(dirname $GITHUB_WORKSPACE)/go"
echo "::set-env name=GOBIN::$(dirname $GITHUB_WORKSPACE)/go/bin"
echo "::add-path::$(dirname $GITHUB_WORKSPACE)/bin"
shell: bash
- uses: actions/checkout@v2
- run: |
mkdir -p ./artifacts
- name: Get deps
run: |
mkdir -p "${GOBIN}"
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
go get .
- name: Build binary
run: |
mkdir -p ./artifacts
GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} CGO_ENABLED=0 go build -o artifacts/dnese .
sha256sum artifacts/dnese | cut -d " " -f 1 > artifacts/sha256.txt
chmod +x artifacts/dnese
Expand All @@ -35,4 +52,32 @@ jobs:
- uses: actions/upload-artifact@v2
with:
name: dnese_${{ matrix.goos }}_${{ matrix.goarch }}_sha256.txt
path: ./artifacts/sha256.txt
path: ./artifacts/sha256.txt

- name: "Creating step output for uploading bin"
run: echo "::set-output name=url::$(echo https://uploads.github.com/repos/rezen/dnese/releases/${RELEASE_ID}/assets?name=dnese_${{ matrix.goos }}_${{ matrix.goarch }})"
id: upload_url_bin

- name: Update edge assets bin
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.upload_url_bin.outputs.url }}
asset_path: ./artifacts/dnese
asset_name: dnese_${{ matrix.goos }}_${{ matrix.goarch }}
asset_content_type: application/octet-stream

- name: "Creating step output for uploading sha256"
run: echo "::set-output name=url::$(echo https://uploads.github.com/repos/rezen/dnese/releases/${RELEASE_ID}/assets?name=dnese_${{ matrix.goos }}_${{ matrix.goarch }}_sha256.txt)"
id: upload_url_sha256
- name: Update edge assets sha256
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.upload_url_sha256.outputs.url }}
asset_path: ./artifacts/sha256.txt
asset_name: dnese_${{ matrix.goos }}_${{ matrix.goarch }}_sha256.txt
asset_content_type: application/octet-stream

23 changes: 22 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,25 @@
# dnese
An amigo to help you easily serve dns queries with your answers & see what questions are being asked.

Originally built for dns poisoning for testing native/desktop apps.
Originally built for dns spoofing for testing native/desktop apps.


## Usage

```sh
dnese --help
dnese --always 127.0.0.1 --port 5300
```

You can also set the configuration options in `$HOME/.dnese.yaml` which is automatically loaded. You can also use `--config` to specify the path of your config.

**Example Config**
```yaml
---
# always: 127.0.0.1
port: 5300
resolver: 8.8.8.8:53
rules:
- pattern: .*\.hey\.com\.?$
address: 127.0.0.1
```

0 comments on commit 2b2d680

Please sign in to comment.