diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..e211579 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,31 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: '' +assignees: '' + +--- + + + +**Environmental Info:** + +**Hauler Version:** + +**System CPU architecture, OS, and Version:** + + +**Describe the bug:** + + +**Steps To Reproduce:** + +**Expected behavior:** + + +**Actual behavior:** + + +**Additional context / logs:** + diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..ada5359 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,23 @@ +* **Please check if the PR fulfills these requirements** +- [ ] The commit message follows our guidelines +- [ ] Tests for the changes have been added (for bug fixes / features) +- [ ] Docs have been added / updated (for bug fixes / features) + + +* **What kind of change does this PR introduce?** (Bug fix, feature, docs update, ...) + + + +* **What is the current behavior?** (You can also link to an open issue here) + + + +* **What is the new behavior (if this is a feature change)?** + + + +* **Does this PR introduce a breaking change?** (What changes might users need to make in their application due to this PR?) + + + +* **Other information**: \ No newline at end of file diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..417b46e --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,78 @@ +name: CI + +on: + workflow_dispatch: + +jobs: + + test: + strategy: + matrix: + go-version: [1.15.x, 1.16.x] + os: [ubuntu-latest, macos-latest] + runs-on: ${{ matrix.os }} + steps: + - name: Install Go + uses: actions/setup-go@v2 + with: + go-version: ${{ matrix.go-version }} + - name: Checkout code + uses: actions/checkout@v2 + - name: Test + run: go test ./... + - name: Run vet & lint + run: | + go vet . + golint . + + create-release: + runs-on: ubuntu-latest + if: startsWith(github.ref, 'refs/tags/') + outputs: + upload_url: ${{ steps.goreleaser.outputs.upload_url }} + steps: + - name: Download release notes utility + env: + GH_REL_URL: https://github.com/buchanae/github-release-notes/releases/download/0.2.0/github-release-notes-linux-amd64-0.2.0.tar.gz + run: cd /tmp && curl -sSL ${GH_REL_URL} | tar xz && sudo mv github-release-notes /usr/local/bin/ + - name: Generate release notes + run: | + echo 'CHANGELOG' > /tmp/release.txt + github-release-notes -org rancherfederal -repo toolkit -since-latest-release -include-author >> /tmp/release.txt + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Run GoReleaser + id: goreleaser + uses: goreleaser/goreleaser-action@v1 + with: + version: latest + args: release --release-notes=/tmp/release.txt --skip-validate + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Upload assets + uses: actions/upload-artifact@v2 + with: + name: hauler + path: dist/* + + create-artifacts: + runs-on: ubuntu-latest + needs: create-release + steps: + - name: Download Hauler binary + id: download + uses: actions/download-artifact@v2 + - name: Run Hauler package + run: | + echo "Running hauler" + - name: Upload default package to Release + id: upload-release-asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ needs,create-release.outputs.upload_url }} + asset_path: ${{github.workspace}}/bundle.tar.gz + asset_name: bundle.tar.gz + asset_content_type: application/gzip + \ No newline at end of file diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 0000000..0e39142 --- /dev/null +++ b/.goreleaser.yml @@ -0,0 +1,50 @@ +project_name: hauler +before: + hooks: + - go mod tidy + - go generate ./... +builds: + - <<: &build_defaults + binary: hauler + main: ./cmd/ + ldflags: + - -s -w -X main.VERSION={{ .Version }} + env: + - CGO_ENABLED=0 + id: linux + goos: + - linux + goarch: + - amd64 + - arm64 + - arm + goarm: + - 7 + - <<: *build_defaults + id: darwin + goos: + - darwin + goarch: + - amd64 + - arm64 + - <<: *build_defaults + id: windows + goos: + - windows +archives: + - name_template: "{{ .Binary }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}" + id: nix + builds: [linux, darwin] + format: tar.gz + files: + - none* +checksum: + name_template: 'checksums.txt' +snapshot: + name_template: "{{ .Tag }}-next" +changelog: + sort: asc + filters: + exclude: + - '^docs:' + - '^test:'