From a325a1d0f73400bb351c609f734f79499a7b4176 Mon Sep 17 00:00:00 2001 From: aleidk Date: Mon, 4 Nov 2024 15:39:34 -0300 Subject: [PATCH] chore: add repository config --- .forgejo/issue_template/01-feature.yml | 59 ++++++++++++++ .forgejo/issue_template/02-bug-report.yml | 93 +++++++++++++++++++++++ .forgejo/workflows/publish.yaml | 66 ++++++++++++++++ boxes/devbox/Dockerfile | 1 - 4 files changed, 218 insertions(+), 1 deletion(-) create mode 100644 .forgejo/issue_template/01-feature.yml create mode 100644 .forgejo/issue_template/02-bug-report.yml create mode 100644 .forgejo/workflows/publish.yaml diff --git a/.forgejo/issue_template/01-feature.yml b/.forgejo/issue_template/01-feature.yml new file mode 100644 index 0000000..44c69bb --- /dev/null +++ b/.forgejo/issue_template/01-feature.yml @@ -0,0 +1,59 @@ +name: Feature request +about: Request a new feature to be added +title: '[Feature]: ' +ref: 'development' +assignees: + - aleidk +labels: + - Priority/Low + - Severity/Low + - Status/Pending + - Type/Feature +body: + - type: markdown + attributes: + value: | + We appreciate your feedback on how to improve this project. Please be sure to include as much details and any resources if possible! + + - type: dropdown + attributes: + multiple: false + label: Type of Feature + default: 0 + options: + - "✨ New Feature" + - "📝 Documentation" + - "🎨 Style and UI" + - "🔨 Code Refactor" + - "⚡ Performance Improvements" + - "✅ New Test" + validations: + required: true + + - type: textarea + id: description + attributes: + label: Description + description: Give us a brief description of the feature or enhancement you would like. + placeholder: As , I want because + validations: + required: true + + - type: textarea + id: completion-criteria + attributes: + label: Completion criteria + description: Tell us what this feature needs to do to be considered completed using verificable items. + placeholder: | + - [ ] Read the configuration file using the yaml format + - [ ] Fetch data from an the json-placehoder API + - [ ] Save the data in the database + validations: + required: true + + - type: textarea + id: additional-information + attributes: + label: Additional Information + description: | + Please leave any additional information on the feature request that could be helpful! like proposed solutions, examples, links, screenshots, etc. diff --git a/.forgejo/issue_template/02-bug-report.yml b/.forgejo/issue_template/02-bug-report.yml new file mode 100644 index 0000000..0662b0b --- /dev/null +++ b/.forgejo/issue_template/02-bug-report.yml @@ -0,0 +1,93 @@ +name: Bug report +about: Something isn't working as expected +title: '[Bug]: ' +ref: 'development' +assignees: + - aleidk +labels: + - Priority/Low + - Severity/Low + - Status/Pending + - Type/Bug +body: + - type: markdown + attributes: + value: | + We appreciate your feedback on how to improve this project. Please be sure to include as much details and any resources if possible! + + - type: checkboxes + id: terms + attributes: + label: Before submitting, I checked... + options: + - label: The [issue tracker](../) in case this has been reported before + required: true + - label: The severity of the bug + required: true + validations: + required: true + + - type: textarea + id: expected + attributes: + label: "Expected behavior:" + description: A clear and concise description of what you expected to happen. Include screenshots and/or logs if relevant. + placeholder: As , I want because + validations: + required: true + + - type: textarea + id: current + attributes: + label: "Current behavior:" + description: A clear and concise description of what actually happened. Include screenshots and/or logs if relevant. + placeholder: As , I want because + validations: + required: true + + - type: textarea + id: reproduce + attributes: + label: "Steps to reproduce:" + description: Anambiguous set of steps to reproduce this bug. Include code snippets if relevant. + placeholder: | + 1. Use x argument / navigate to + 2. Fill this information + 3. Go to... + 4. See error + validations: + required: true + + - type: dropdown + attributes: + multiple: false + label: Is this a regresion? + description: Did this behaviour used to work in the previous version? + default: 0 + options: + - "I don't know" + - "This is a new feature" + - "Yes" + - "No" + validations: + required: true + + - type: textarea + id: environment + attributes: + label: "Your environment:" + description: Tell us details about the environment you experienced the bug in. A minimal/isolated enviroment to reproduce would be apreciated. + placeholder: | + - Version used: + - Browser Name and version: + - Operating System and version (desktop or mobile): + - Link to your project: + validations: + required: false + + - type: textarea + id: additional-information + attributes: + label: "Additional Information:" + description: | + Please leave any additional information on the bug that could be helpful! like proposed solutions, examples, links, screenshots, etc. diff --git a/.forgejo/workflows/publish.yaml b/.forgejo/workflows/publish.yaml new file mode 100644 index 0000000..7e90d68 --- /dev/null +++ b/.forgejo/workflows/publish.yaml @@ -0,0 +1,66 @@ +name: Publish image +on: + push: + paths: + - 'boxes/**' + workflow_dispatch: + +jobs: + generate-matrix: + name: Generate job matrices + runs-on: host + outputs: + boxes: ${{ steps.changed-files.outputs.all_changed_files }} + boxes-count: ${{ steps.changed-files.outputs.all_changed_files_count }} + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: List changed files + id: changed-files + uses: tj-actions/changed-files@v45.0.3 + with: + matrix: true + diff_relative: true + dir_names: true + dir_names_exclude_current_dir: true + dir_names_max_depth: 2 + files: boxes/** + - name: Output changes + run: | + echo 'Files changed: ${{ steps.changed-files.outputs.all_changed_files_count }}' + echo 'List: ${{ steps.changed-files.outputs.all_changed_files }}' + + create-docker-images: + needs: generate-matrix + runs-on: host + strategy: + matrix: + # box: ${{ needs.generate-matrix.outputs.boxes }} FIXME: this doesn't work yet in forgejo-runner + box: + - ["boxes", "devbox"] + if: contains(needs.generate-matrix.outputs.boxes, join(matrix.box, '/')) + steps: + - name: Print variables + run: | + echo 'Building image in context: ${{ matrix.box }}' + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + registry: git.alecodes.page + username: ${{ vars.CONTAINER_REGISTRY_USER }} + password: ${{ secrets.CONTAINER_REGISTRY_TOKEN }} + + - name: Build and push + uses: docker/build-push-action@v6 + with: + platforms: linux/amd64,linux/arm64 + push: true + context: "{{defaultContext}}:${{ join(matrix.box, '/') }}" + tags: | + git.alecodes.page/alecodes/${{ matrix.box[0] }}:latest diff --git a/boxes/devbox/Dockerfile b/boxes/devbox/Dockerfile index 9be31f0..b964e6d 100644 --- a/boxes/devbox/Dockerfile +++ b/boxes/devbox/Dockerfile @@ -32,7 +32,6 @@ RUN sh -c "$(curl -fsLS get.chezmoi.io)" -- -b /usr/local/bin && \ RUN chsh -s /bin/zsh -# Create workspace directory RUN mkdir -p /workspace WORKDIR /workspace