diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..6b34f56 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,43 @@ +name: Build CoreDNS utils +on: + push: + # Run pipeline for commits on branch 'master' and on 'testing/' + branches: + - master + - 'testing/**' + - 'feature/**' + - 'hotfix/**' + # Run pipeline for release tags + tags: + - 'v*.*.*' + +jobs: + # Build + build: + runs-on: [ubuntu-20.04] + steps: + - name: Check out repository code + uses: actions/checkout@v2 + - name: Run make + run: | + make + - name: Upload artifact + uses: actions/upload-artifact@v2 + with: + name: coredns-keygen + path: coredns-keygen/coredns-keygen + + # Create a release if running on tag + create-release: + needs: [build] + runs-on: [ubuntu-20.04] + # Only run on pushed tags (and explicitely ignore scheduled runs) + if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') && github.event_name != 'schedule' + steps: + - name: Collect artifacts + uses: actions/download-artifact@master + - name: Release CoreDNS utils + uses: softprops/action-gh-release@v1 + with: + files: | + coredns-keygen/coredns-keygen