From 6ffc544ede21ccb72b84f8e5609fd7aeedfaecce Mon Sep 17 00:00:00 2001 From: Pc Date: Sat, 6 Apr 2024 01:27:58 +0330 Subject: [PATCH] chore: Revert ci workflow --- .github/release-drafter.yml | 111 ++++++++++++++++++ .github/workflows/ci.yml | 53 +++++++++ .github/workflows/release-drafter-labeler.yml | 21 ++++ .github/workflows/release-drafter.yml | 19 +++ 4 files changed, 204 insertions(+) create mode 100644 .github/release-drafter.yml create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/release-drafter-labeler.yml create mode 100644 .github/workflows/release-drafter.yml diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml new file mode 100644 index 0000000..610efe0 --- /dev/null +++ b/.github/release-drafter.yml @@ -0,0 +1,111 @@ +# https://johanneskonings.dev/github/2021/02/28/github_automatic_releases_and-changelog/ +# https://tiagomichaelsousa.dev/articles/stop-writing-your-changelogs-manually +# https://github.com/release-drafter/release-drafter/issues/551 +# https://github.com/release-drafter/release-drafter/pull/1013 +# https://github.com/release-drafter/release-drafter/issues/139 +# https://github.com/atk4/data/blob/develop/.github/release-drafter.yml + +# This release drafter follows the conventions from https://keepachangelog.com, https://common-changelog.org/ +# https://www.conventionalcommits.org + +name-template: 'v$RESOLVED_VERSION' +tag-template: 'v$RESOLVED_VERSION' +template: | + ## What Changed ๐Ÿ‘€ + $CHANGES + **Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...v$RESOLVED_VERSION +categories: + - title: ๐Ÿš€ Features + labels: + - feature + - title: ๐Ÿ› Bug Fixes + labels: + - fix + - bug + - title: ๐Ÿงช Test + labels: + - test + - title: ๐Ÿ‘ท CI + labels: + - ci + - title: โ™ป๏ธ Changes + labels: + - changed + - enhancement + - refactor + - title: โ›”๏ธ Deprecated + labels: + - deprecated + - title: ๐Ÿ” Security + labels: + - security + - title: ๐Ÿ“„ Documentation + labels: + - docs + - documentation + - title: ๐Ÿงฉ Dependency Updates + labels: + - deps + - dependencies + - title: ๐Ÿงฐ Maintenance + label: 'chore' + - title: ๐Ÿ“ Other changes +## putting no labels pr to `Other Changes` category with no label - https://github.com/release-drafter/release-drafter/issues/139#issuecomment-480473934 + +# https://www.trywilco.com/post/wilco-ci-cd-github-heroku +# https://github.com/release-drafter/release-drafter#autolabeler +# https://github.com/fuxingloh/multi-labeler + +# Using regex for defining rules - https://regexr.com/ - https://regex101.com/ +autolabeler: + - label: 'chore' + branch: + - '/(chore)\/.*/' + - label: 'security' + branch: + - '/(security)\/.*/' + - label: 'refactor' + branch: + - '/(refactor)\/.*/' + - label: 'docs' + branch: + - '/(docs)\/.*/' + - label: 'ci' + branch: + - '/(ci)\/.*/' + - label: 'test' + branch: + - '/(test)\/.*/' + - label: 'bug' + branch: + - '/(fix)\/.*/' + - label: 'feature' + branch: + - '/(feat)\/.*/' + - label: 'minor' + branch: + - '/(feat)\/.*/' + - label: 'patch' + branch: + - '/(fix)\/.*/' + body: + - '/JIRA-[0-9]{1,4}/' + +change-template: '- $TITLE (#$NUMBER)' +exclude-contributors: + - 'meysamhadeli' +change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks. +version-resolver: + major: + labels: + - major + minor: + labels: + - minor + patch: + labels: + - patch + default: patch + +exclude-labels: + - skip-changelog diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..ca61ad8 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,53 @@ +# This workflow will build a golang project +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go + +name: CI + +on: + push: + branches: [ "main" , "develop"] + paths-ignore: + - "README.md" + - "CHANGELOG.md" + pull_request: + branches: [ "main" , "develop" ] + +jobs: + + ci: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Set up Go + uses: actions/setup-go@v3 + with: + go-version: 1.21 + + - name: pkg build + working-directory: ./internal/pkg + run: go build -v ./... + + - name: identity_service build + working-directory: ./internal/services/identity_service + run: go build -v ./... + + - name: product_service build + working-directory: ./internal/services/product_service + run: go build -v ./... + + - name: inventory_service build + working-directory: ./internal/services/inventory_service + run: go build -v ./... + + - name: product_service test + working-directory: ./internal/services/product_service + run: go test -v ./... + + - name: identity_service test + working-directory: ./internal/services/identity_service + run: go test -v ./... + + - name: inventory_service test + working-directory: ./internal/services/inventory_service + run: go test -v ./... diff --git a/.github/workflows/release-drafter-labeler.yml b/.github/workflows/release-drafter-labeler.yml new file mode 100644 index 0000000..960bec7 --- /dev/null +++ b/.github/workflows/release-drafter-labeler.yml @@ -0,0 +1,21 @@ +name: Release Drafter Auto Labeler + +on: + pull_request: + types: + - opened + - synchronize + - reopened + - labeled + - unlabeled + +jobs: + auto-labeler: + runs-on: ubuntu-latest + steps: + - uses: release-drafter/release-drafter@v5 + with: + config-name: release-drafter.yml + disable-releaser: true # only run auto-labeler for PRs + 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..435365f --- /dev/null +++ b/.github/workflows/release-drafter.yml @@ -0,0 +1,19 @@ + # https://johanneskonings.dev/github/2021/02/28/github_automatic_releases_and-changelog/ + # https://tiagomichaelsousa.dev/articles/stop-writing-your-changelogs-manually + name: Release Drafter + + on: + push: + branches: + - main + + jobs: + update_release_draft: + name: Release drafter + runs-on: ubuntu-latest + + steps: + - name: Update Release Draft + uses: release-drafter/release-drafter@v5 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}