From b5c0e5ec3d99ec4d754c6722cbe15d49f7a11fed Mon Sep 17 00:00:00 2001 From: verse91 Date: Sun, 10 May 2026 01:25:24 +0700 Subject: [PATCH] feat: issue template and release ci/cd --- .github/ISSUE_TEMPLATE/BugReport.yml | 51 +++++++++++++++ .github/ISSUE_TEMPLATE/NewFeature.yml | 36 +++++++++++ .github/ISSUE_TEMPLATE/README.md | 17 +++++ .github/workflows/release.yml | 91 +++++++++++++++++++++++++++ 4 files changed, 195 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/BugReport.yml create mode 100644 .github/ISSUE_TEMPLATE/NewFeature.yml create mode 100644 .github/ISSUE_TEMPLATE/README.md create mode 100644 .github/workflows/release.yml diff --git a/.github/ISSUE_TEMPLATE/BugReport.yml b/.github/ISSUE_TEMPLATE/BugReport.yml new file mode 100644 index 0000000..c6dbede --- /dev/null +++ b/.github/ISSUE_TEMPLATE/BugReport.yml @@ -0,0 +1,51 @@ +name: Bug Report +description: Report a bug +labels: ["bug"] +body: + - type: markdown + attributes: + value: | + Please fill out the sections below to help everyone identify and fix the bug + - type: textarea + id: description + attributes: + label: Describe your issue + placeholder: When I click here this happens + validations: + required: true + - type: textarea + id: steps + attributes: + label: Steps to reproduce + placeholder: | + 1. Enhance this function + 2. Refactor this + 3. Refactor that + validations: + required: true + - type: textarea + id: expected + attributes: + label: What was the expected result? + placeholder: I expected this to happen + - type: textarea + id: screenshots + attributes: + label: Put here any screenshots or videos (optional) + - type: textarea + id: deviceinfo + attributes: + label: Your OS and Browser (optional) + placeholder: | + - OS: Windows 10 + - Browser: Chrome 90.0 + - type: dropdown + id: assign + attributes: + label: "Would you like to work on this issue?" + options: + - "Yes" + - type: markdown + attributes: + value: | + Thanks for reporting this issue! We will get back to you as soon as possible. \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/NewFeature.yml b/.github/ISSUE_TEMPLATE/NewFeature.yml new file mode 100644 index 0000000..e284c58 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/NewFeature.yml @@ -0,0 +1,36 @@ +name: New feature +description: Suggest or request a new feature +labels: ["enhancement"] +body: + - type: markdown + attributes: + value: | + Please fill out the sections below to properly describe the new feature you are suggesting. + - type: textarea + id: description + attributes: + label: Describe the feature + placeholder: A feature X that allows to do Y + validations: + required: true + - type: textarea + id: rationale + attributes: + label: It should be implemented because + placeholder: It will allow to do Y that is needed for Z + - type: textarea + id: context + attributes: + label: Additional context + placeholder: | + Add any other context or screenshots about the feature request here. + - type: dropdown + id: assign + attributes: + label: "Would you like to work on this issue?" + options: + - "Yes" + - type: markdown + attributes: + value: | + Thanks for your suggestion! Let's see together if it can be implemented. \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/README.md b/.github/ISSUE_TEMPLATE/README.md new file mode 100644 index 0000000..d3c7471 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/README.md @@ -0,0 +1,17 @@ +# Issues template + +I created this template to help you report bugs or suggest new features more easily without having to manually write them. + +If you have any questions, please submit a Pull Request (PR) or open Issues. + +If you can improve my issues template, please open a PR. + + +image +
You can choose one of these three
+ +image +
Bug Report
+ +image +
New Feature
\ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..bf2b7fe --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,91 @@ +name: Release + +on: + push: + branches: + - main + tags: + - 'v*' + pull_request: + branches: [ '**' ] + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + contents: write + +jobs: + quality-and-release: + name: Quality & Release + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Go + uses: actions/setup-go@v5 + with: + go-version: '1.24' + cache: true + + - name: Run Linter + uses: golangci/golangci-lint-action@v6 + with: + version: latest + + - name: Run Tests + run: go test -v ./... + + - name: Build Binaries + if: startsWith(github.ref, 'refs/tags/v') + run: | + mkdir -p dist + platforms=("linux/amd64" "linux/arm64" "darwin/amd64" "darwin/arm64") + for platform in "${platforms[@]}"; do + os_arch=(${platform//\// }) + GOOS=${os_arch[0]} + GOARCH=${os_arch[1]} + output_name="iris" + [ "$GOOS" == "windows" ] && output_name="iris.exe" + + echo "Building $GOOS/$GOARCH..." + GOOS=$GOOS GOARCH=$GOARCH go build \ + -ldflags="-s -w -X github.com/versenilvis/iris/root.Version=${{ github.ref_name }}" \ + -trimpath -o "dist/$output_name" main.go + + cd dist + tar -czf "iris_${GOOS}_${GOARCH}.tar.gz" "$output_name" + rm "$output_name" + cd .. + done + + - name: Prepare Release Notes + if: startsWith(github.ref, 'refs/tags/v') + run: | + # Generate standard GitHub release notes + GEN_NOTES=$(gh api repos/${{ github.repository }}/releases/generate-notes -f tag_name=${{ github.ref_name }} --jq .body) + + echo "RELEASE_BODY<> $GITHUB_ENV + echo "$GEN_NOTES" >> $GITHUB_ENV + echo "" >> $GITHUB_ENV + echo "## Installation" >> $GITHUB_ENV + echo "\`\`\`bash" >> $GITHUB_ENV + echo "curl -sS https://raw.githubusercontent.com/versenilvis/iris/main/scripts/install.sh | sudo sh" >> $GITHUB_ENV + echo "\`\`\`" >> $GITHUB_ENV + echo "EOF" >> $GITHUB_ENV + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Create GitHub Release + if: startsWith(github.ref, 'refs/tags/v') + uses: softprops/action-gh-release@v1 + with: + name: ${{ github.ref_name }} + body: ${{ env.RELEASE_BODY }} + files: dist/*.tar.gz + generate_release_notes: false + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}