Home  Github   How release ...

How release process works in github

The release process in GitHub involves preparing and publishing a new version of your software or project, making it available to users and contributors. Here's a structured overview of how the release process typically works on GitHub:

Steps in the Release Process

  1. Versioning and Planning:

    • Semantic Versioning: Determine the version number based on Semantic Versioning (e.g., MAJOR.MINOR.PATCH).
    • Release Planning: Plan what features, bug fixes, or enhancements will be included in the release.
  2. Create a Release Branch (Optional):

    • If your project follows a branching strategy, you might create a release branch from the main development branch (main or master) to stabilize the release.
  3. Prepare Release Notes:

    • Compile release notes detailing changes, new features, bug fixes, and any breaking changes. This helps users and contributors understand what's included in the release.
  4. Draft a Release on GitHub:

    • Go to the repository on GitHub.
    • Click on the "Releases" tab and then "Draft a new release".
    • Fill in the tag version (e.g., v1.0.0), title, and description.
    • Optionally, attach files (e.g., binaries, documentation) relevant to the release.
  5. Publish the Release:

    • Once you're ready, publish the release. This makes it visible to users and contributors.
    • GitHub automatically generates a release page with the information provided, including release notes and attached files.
  6. Notify Users and Contributors:

    • Notify users and contributors about the new release. This can be done through release announcements, project documentation updates, or notifications via GitHub.
  7. Update Documentation and Examples:

    • Update project documentation, README files, and any examples to reflect changes introduced in the new release.
  8. Post-Release Tasks (Optional):

    • Depending on your project’s needs, you might perform post-release tasks such as cleaning up temporary files, updating dependencies, or closing related issues.

Best Practices

Example GitHub Release Workflow

name: Release Workflow

on:
  push:
    branches:
      - main

jobs:
  build-and-publish:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v2

      - name: Set up Java JDK
        uses: actions/setup-java@v2
        with:
          java-version: '11'

      - name: Build with Maven
        run: mvn clean package

      - name: Create Release
        id: create_release
        uses: actions/create-release@v1
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          tag_name: v1.0.0
          release_name: Release v1.0.0
          draft: false
          prerelease: false

      - name: Upload Artifact
        uses: actions/upload-release-asset@v1
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          upload_url: ${{ steps.create_release.outputs.upload_url }}
          asset_path: ./target/my-app.jar
          asset_name: my-app.jar
          asset_content_type: application/java-archive
Published on: Jun 21, 2024, 11:24 PM  
 

Comments

Add your comment