Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Release-Please for Simpler Releases #4

Open
1 task
jjfrench opened this issue Aug 8, 2022 · 0 comments
Open
1 task

Implement Release-Please for Simpler Releases #4

jjfrench opened this issue Aug 8, 2022 · 0 comments
Assignees
Labels
documentation Improvements or additions to documentation enhancement New feature or request

Comments

@jjfrench
Copy link
Collaborator

jjfrench commented Aug 8, 2022

Description

Release-Please automates CHANGELOG generation, Github releases, and version bumps. Using standardized commit messages following conventional-commit, a release-please github action workflow will generate PR's and tags when new features and fixes are committed to specified branches.

Links

Release-Please documentation
Conventional Commits documentation
#266 Create Unit Tests/File Restructuring for maap-documentation-examples Repository

Example

A straightforward workflow to generate tags for major.minor.patch versions as well as updated the CHANGELOG and README.

release-main.yml

on:
  push:
    branches:
      - main
name: release-please
jobs:
  release-please:
    runs-on: ubuntu-latest
    steps:
      - uses: google-github-actions/release-please-action@v3
        with:
          release-type: node
          package-name: release-please-action
          changelog-types: '
            [
              {"type":"feat","section":"Features","hidden":false},
              {"type":"fix","section":"Bug Fixes","hidden":false},
              {"type":"chore","section":"Miscellaneous","hidden":false}
            ]'
          extra-files: |
            README.md
      - uses: actions/checkout@v2
      - name: tag major and minor versions
        if: ${{ steps.release.outputs.release_created }}
        run: |
          git config user.name github-actions[bot]
          git config user.email 41898282+github-actions[bot]@users.noreply.github.com
          git remote add gh-token "https://${{ secrets.GITHUB_TOKEN }}@github.com/google-github-actions/release-please-action.git"

          git tag -d v${{ steps.release.outputs.major }} || true
          git tag -d v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} || true
          git tag -d v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}.${{ steps.release.outputs.patch }} || true

          git push origin :v${{ steps.release.outputs.major }} || true
          git push origin :v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} || true
          git push origin :v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}.${{ steps.release.outputs.patch }} || true

          git tag -a v${{ steps.release.outputs.major }} -m "Release v${{ steps.release.outputs.major }}"
          git tag -a v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} -m "Release v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}"
          git tag -a v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}.${{ steps.release.outputs.patch }} -m "Release v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}.${{ steps.release.outputs.patch }}"

          git push origin v${{ steps.release.outputs.major }}
          git push origin v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}
          git push origin v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}.${{ steps.release.outputs.patch }}

Conventional commit message example

fix: Fix for unresolved file path. Bumps Version 0.0.1

Acceptance Criteria

  • Implement a Release-Please workflow that works with the repository's branching strategy
@jjfrench jjfrench added documentation Improvements or additions to documentation enhancement New feature or request labels Aug 8, 2022
@jjfrench jjfrench self-assigned this Aug 8, 2022
@chuckwondo chuckwondo transferred this issue from MAAP-Project/maap-documentation-examples Oct 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant