웹 풀사이클 데브코스 TIL [Day 79] - 오픈소스 프로젝트 만들어보기

JaeKyung Hwang·2024년 3월 20일
0
post-thumbnail

2024.03.19(화)

보통 오픈소스는 organization을 만들고 그 하위에 프로젝트를 만듦

  • 오른쪽 위 프로필 > Your organizations > New organization
  • 새로 만든 organization에서 repository 생성

🛡️main branch에 대한 안전 장치 설정

  • Repository에서 Settings > Branches > Add branch protection rule

📝문서 템플릿 및 README 작성

  • Issue 템플릿의 경우 repository에서 Settings > General의 Features 항목에서 몇 가지 기본 양식들을 제공
  1. issue 또는 PR을 위한 단일 템플릿 만들기

    • Repository root에 .github 폴더 생성
    • 하위에 issue_template.md, pull_request_template.md 생성
  2. template query parameter를 사용해 issue 또는 PR의 본문을 채울 템플릿 만들기

    • .github 폴더에 ISSUE_TEMPLATE 또는 PULL_REQUEST_TEMPLATE 서브 폴더 생성 후 하위에 issue_template.md, pull_request_template.md 각각 생성

    • query parameter 참고 자료

    • 이런 식으로 템플릿 문서 상단에 작성하면 되는 것 같다.

      ---
      name: Tracking issue
      about: Use this template for tracking new features.
      title: "[DATE]: [FEATURE NAME]"
      labels: tracking issue, needs triage
      assignees: octocat
      ---
      
      # Description
          ⁝

🤖PR 관리를 위한 Github Actions 설정

🚀Github Actions

GitHub에서 제공하는 빌드, 테스트, 및 배포 파이프라인을 자동화할 수 있는 CI/CD 서비스

🛤️워크플로(workflow)

  • 하나 이상의 작업을 실행하는 구성 가능한 자동화된 프로세스

  • .github/workflows 폴더에 YAML 파일을 사용하여 정의 (파일명은 자유!)

  • Repository에는 여러 워크플로가 있을 수 있으며, 각 워크플로는 다른 작업 세트를 수행할 수 있음

  • 워크플로 구문(workflow syntax)

  • 예제

    # Optional - "Actions" 탭에서 표시될 워크플로우명 (지정하지 않으면 파일명이 사용됨)
    name: learn-github-actions
    
    # 워크플로우 실행 트리거
    # 이 예시에서 사용된 `push` 이벤트는 변경사항을 push하거나 PR을 merge할 때마다 워크플로우 실행이 트리거됨
    # 더 많은 이벤트는 https://docs.github.com/ko/actions/using-workflows/events-that-trigger-workflows 참고
    on: [push]
    
    # `learn-github-actions` 워크플로우에서 실행되는 모든 작업을 그룹화, 즉 작업 정의
    jobs:
    
    # Defines a job named `check-bats-version`. The child keys will define properties of the job.
      check-bats-version:
    
    # Configures the job to run on the latest version of an Ubuntu Linux runner. This means that the job will execute on a fresh virtual machine hosted by GitHub. For syntax examples using other runners, see "[AUTOTITLE](/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on)"
        runs-on: ubuntu-latest
    
    # Groups together all the steps that run in the `check-bats-version` job. Each item nested under this section is a separate action or shell script.
        steps:
    
    # The `uses` keyword specifies that this step will run `v4` of the `actions/checkout` action. This is an action that checks out your repository onto the runner, allowing you to run scripts or other actions against your code (such as build and test tools). You should use the checkout action any time your workflow will use the repository's code.
          - uses: actions/checkout@v4
    
    # This step uses the `actions/setup-node@v4` action to install the specified version of the Node.js. (This example uses version 14.) This puts both the `node` and `npm` commands in your `PATH`.
          - uses: actions/setup-node@v4
            with:
              node-version: '14'
    
    # The `run` keyword tells the job to execute a command on the runner. In this case, you are using `npm` to install the `bats` software testing package.
          - run: npm install -g bats
    
    # Finally, you'll run the `bats` command with a parameter that outputs the software version.
          - run: bats -v
profile
이것저것 관심 많은 개발자👩‍💻

0개의 댓글