diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 0000000..d9cf4b6 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,38 @@ +name: Bug Report +description: File a bug report here +title: "[BUG]: " +labels: ["action: investigate"] +assignees: [] +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to fill out this bug report 🤗 + Make sure there aren't any open/closed issues for this topic 😃 + + - type: textarea + id: bug-description + attributes: + label: Description of the bug + description: Give us a brief description of what happened and what should have happened + validations: + required: true + + - type: textarea + id: steps-to-reproduce + attributes: + label: Steps To Reproduce + description: Steps to reproduce the behavior. + placeholder: | + 1. Go to '...' + 2. Click on '...' + 3. Scroll down to '...' + 4. See error + validations: + required: true + - type: textarea + id: additional-information + attributes: + label: Additional Information + description: | + Provide any additional information such as logs, screenshots, likes, scenarios in which the bug occurs so that it facilitates resolving the issue. diff --git a/.github/ISSUE_TEMPLATE/enhancement_request.yml b/.github/ISSUE_TEMPLATE/enhancement_request.yml new file mode 100644 index 0000000..1b9f2c0 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/enhancement_request.yml @@ -0,0 +1,23 @@ +name: Enhancement Request +description: Request a new enhancement +title: "[ENHANCEMENT]: " +labels: ["action: triage"] +body: + - type: markdown + attributes: + value: | + Please make sure this feature request hasn't been already submitted by someone by looking through other open/closed issues + + - type: textarea + id: description + attributes: + label: Description + description: Give us a brief description of the feature or enhancement you would like + validations: + required: true + + - type: textarea + id: additional-information + attributes: + label: Additional Information + description: Give us some additional information on the feature request like proposed solutions, links, screenshots, etc. diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml new file mode 100644 index 0000000..917205b --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -0,0 +1,23 @@ +name: Feature Request +description: Request a new feature or enhancement +title: "[FEAT]: " +labels: ["action: triage"] +body: + - type: markdown + attributes: + value: | + Please make sure this feature request hasn't been already submitted by someone by looking through other open/closed issues + + - type: textarea + id: description + attributes: + label: Description + description: Give us a brief description of the feature or enhancement you would like + validations: + required: true + + - type: textarea + id: additional-information + attributes: + label: Additional Information + description: Give us some additional information on the feature request like proposed solutions, links, screenshots, etc. diff --git a/.github/workflows/go/main.yml b/.github/workflows/go/main.yml new file mode 100644 index 0000000..ceb77d4 --- /dev/null +++ b/.github/workflows/go/main.yml @@ -0,0 +1,43 @@ +on: + workflow_call: + inputs: + main-file: + required: false + type: string + default: main.go + skip-build: + required: false + type: boolean + default: false + skip-release: + required: false + type: boolean + default: false + skip-package: + required: false + type: boolean + default: false +jobs: + build: + if: ${{ !inputs.skip-build }} + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-go@v3 + with: + go-version: 1.19 + cache: true + run: go build ${{ inputs.main-file }} + + release: + if: ${{ !inputs.skip-release && github.ref == 'refs/heads/main' }} + uses: morty-faas/.github/.github/workflows/release-drafter.yml@main + + package: + if: ${{ !inputs.skip-package && github.ref == 'refs/heads/main' || contains(github.ref, 'refs/tags/') }} + uses: morty-faas/.github/.github/workflows/package-image.yml@main + needs: build + with: + artifact-id: build + artifact-download: true + artifact-download-dir: dist diff --git a/.github/workflows/package-image.yml b/.github/workflows/package-image.yml new file mode 100644 index 0000000..41fb47c --- /dev/null +++ b/.github/workflows/package-image.yml @@ -0,0 +1,58 @@ +on: + workflow_call: + inputs: + artifact-download: + required: false + type: boolean + default: false + artifact-id: + required: false + type: string + artifact-download-dir: + required: false + type: string + dockerfile-path: + required: false + type: string + docker-metadata-flavor: + required: false + type: string + +jobs: + package-image: + runs-on: ubuntu-22.04 + permissions: + contents: read + packages: write + steps: + - uses: actions/checkout@v3 + + - name: Download artifacts + if: ${{ inputs.artifact-download }} + uses: actions/download-artifact@v3 + with: + name: ${{ inputs.artifact-id }} + path: ${{ inputs.artifact-download-dir }} + + - name: Log in to the Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, label) for Docker + id: meta + uses: docker/metadata-action@v4 + with: + images: ghcr.io/${{ github.repository }} + flavor: ${{ inputs.docker-metadata-flavor }} + + - name: Build an push image + uses: docker/build-push-action@v3 + with: + context: . + file: ${{ inputs.dockerfile-path }} + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/pr-title-checker.yml b/.github/workflows/pr-title-checker.yml new file mode 100644 index 0000000..3026b70 --- /dev/null +++ b/.github/workflows/pr-title-checker.yml @@ -0,0 +1,12 @@ +on: + workflow_call: + +jobs: + title-checker: + name: Check PR title + runs-on: ubuntu-22.04 + + steps: + - uses: aslafy-z/conventional-pr-title-action@v3 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml new file mode 100644 index 0000000..40621b1 --- /dev/null +++ b/.github/workflows/release-drafter.yml @@ -0,0 +1,12 @@ +on: + workflow_call: + +jobs: + release-drafter: + permissions: + contents: write + runs-on: ubuntu-22.04 + steps: + - uses: release-drafter/release-drafter@v5 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}