- 
          
 - 
                Notifications
    
You must be signed in to change notification settings  - Fork 268
 
chore: Automate release process with melos-action #1230
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
          
     Merged
      
      
    
  
     Merged
                    Changes from 17 commits
      Commits
    
    
            Show all changes
          
          
            18 commits
          
        
        Select commit
          Hold shift + click to select a range
      
      8a85ad5
              
                chore: setup release-please
              
              
                grdsdev ae6466c
              
                test
              
              
                grdsdev b64fe93
              
                chore: add extra files
              
              
                grdsdev 94838fb
              
                chore: set correct bootstrap-sha value
              
              
                grdsdev 3b3a183
              
                chore: set bootstrap-sha
              
              
                grdsdev 98ac10f
              
                chore: use last-release-sha
              
              
                grdsdev fa3091c
              
                chore: use last-release-sha
              
              
                grdsdev dd7fee8
              
                fix sha
              
              
                grdsdev c355fba
              
                chore: proper setup linked versions
              
              
                grdsdev 1969be3
              
                chore: remove condition:
              
              
                grdsdev fddb1c8
              
                remove flutter version
              
              
                grdsdev 93e7f92
              
                chore: setup release automation using melos action
              
              
                grdsdev 2a2ad2d
              
                chore: test release workflow
              
              
                grdsdev 6808abb
              
                remove specific version channels
              
              
                grdsdev 0a5e363
              
                chore: use workflow dispatch only
              
              
                grdsdev 3b244d8
              
                fix typo
              
              
                grdsdev f3f9384
              
                revert melos.yaml
              
              
                grdsdev dd028bf
              
                chore: enable GitHub Release creation in workflow
              
              
                grdsdev File filter
Filter by extension
Conversations
          Failed to load comments.   
        
        
          
      Loading
        
  Jump to
        
          Jump to file
        
      
      
          Failed to load files.   
        
        
          
      Loading
        
  Diff view
Diff view
There are no files selected for viewing
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| name: Prepare Release | ||
| 
     | 
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| prerelease: | ||
| description: 'Version as prerelease' | ||
| required: false | ||
| default: false | ||
| type: boolean | ||
| graduate: | ||
| description: 'Graduate prereleases to stable' | ||
| required: false | ||
| default: false | ||
| type: boolean | ||
| 
     | 
||
| permissions: | ||
| contents: write | ||
| pull-requests: write | ||
| 
     | 
||
| jobs: | ||
| prepare-release: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
| token: ${{ secrets.GITHUB_TOKEN }} | ||
| 
     | 
||
| - name: Setup Flutter | ||
| uses: subosito/flutter-action@v2 | ||
| 
     | 
||
| - name: Setup Melos | ||
| uses: bluefireteam/melos-action@v3 | ||
| with: | ||
| run-versioning: ${{ inputs.prerelease == false }} | ||
| run-versioning-prerelease: ${{ inputs.prerelease == true }} | ||
| run-versioning-graduate: ${{ inputs.graduate == true }} | ||
| publish-dry-run: true | ||
| create-pr: true | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| name: Publish Packages | ||
| 
     | 
||
| on: | ||
| workflow_dispatch: | ||
| 
     | 
||
| permissions: | ||
| contents: write | ||
| id-token: write | ||
| 
     | 
||
| jobs: | ||
| publish-packages: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| 
     | 
||
| - name: Setup Flutter | ||
| uses: subosito/flutter-action@v2 | ||
| 
     | 
||
| - name: Publish to pub.dev | ||
| uses: bluefireteam/melos-action@v3 | ||
| with: | ||
| publish: true | ||
| 
     | 
||
| # - name: Create GitHub Release | ||
| # uses: softprops/action-gh-release@v1 | ||
| # with: | ||
| # tag_name: ${{ github.ref_name }} | ||
| # name: Release ${{ github.ref_name }} | ||
| # body: | | ||
| # ## Package Release | ||
| 
     | 
||
| # Released package: ${{ github.ref_name }} | ||
| 
     | 
||
| # See the package CHANGELOG for detailed changes. | ||
| 
     | 
||
| # --- | ||
| # *This release was created automatically by the Publish Packages workflow.* | ||
| # draft: false | ||
| # prerelease: false | ||
| # env: | ||
| # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| name: Create Release Tags | ||
| 
     | 
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| 
     | 
||
| permissions: | ||
| contents: write | ||
| actions: write | ||
| 
     | 
||
| jobs: | ||
| create-tags: | ||
| if: ${{ contains(github.event.head_commit.message, 'chore(release):') }} | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
| 
     | 
||
| - name: Setup Flutter | ||
| uses: subosito/flutter-action@v2 | ||
| 
     | 
||
| - name: Setup Melos | ||
| uses: bluefireteam/melos-action@v3 | ||
| with: | ||
| tag: true | ||
| - run: | | ||
| melos exec -c 1 --no-published --no-private --order-dependents -- \ | ||
| gh workflow run release-publish.yml \ | ||
| --ref \$MELOS_PACKAGE_NAME-v\$MELOS_PACKAGE_VERSION | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | 
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the plan with this block? Do we want GitHub releases as well or only tags?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uncommented.
I didn't test this whole workflow yet, lets get it merged and try to create a release using it