|
15 | 15 | conan_version: ${{ steps.vars.outputs.conan_version }} |
16 | 16 |
|
17 | 17 | steps: |
18 | | - - name: Checkout code |
| 18 | + - name: Checkout conan repository |
19 | 19 | uses: actions/checkout@v4 |
20 | 20 |
|
21 | 21 | - name: Extract version |
|
26 | 26 | echo "conan_version=$VERSION" >> $GITHUB_OUTPUT |
27 | 27 | echo "Version found: $VERSION" |
28 | 28 |
|
| 29 | + - name: Generate Read-Only App Token |
| 30 | + id: generate_token |
| 31 | + uses: actions/create-github-app-token@v2 |
| 32 | + with: |
| 33 | + app-id: ${{ secrets.GH_APP_RELEASE_ID }} |
| 34 | + private-key: ${{ secrets.GH_APP_RELEASE_PRIVATE_KEY }} |
| 35 | + permission-contents: read |
| 36 | + owner: conan-io |
| 37 | + repositories: | |
| 38 | + conan |
| 39 | + release-tools |
| 40 | +
|
| 41 | + - name: Checkout release-tools repository |
| 42 | + uses: actions/checkout@v4 |
| 43 | + with: |
| 44 | + repository: conan-io/release-tools |
| 45 | + token: ${{ steps.generate_token.outputs.token }} |
| 46 | + path: release-tools |
| 47 | + |
| 48 | + - name: Get Changelog |
| 49 | + env: |
| 50 | + GH_TOKEN: ${{ steps.generate_token.outputs.token }} |
| 51 | + run: | |
| 52 | + pip install PyGithub |
| 53 | + python3 release-tools/release/get_changelog.py ${{ steps.vars.outputs.conan_version }} --format=md |
| 54 | +
|
| 55 | + - name: Upload changelog artifact |
| 56 | + uses: actions/upload-artifact@v4 |
| 57 | + with: |
| 58 | + name: release-notes |
| 59 | + path: release-notes-${{ steps.vars.outputs.conan_version }}.md |
| 60 | + |
29 | 61 | package: |
30 | 62 | name: Package for ${{ matrix.platform }}/${{ matrix.arch }} |
31 | 63 | needs: prepare |
@@ -89,38 +121,42 @@ jobs: |
89 | 121 | name: conan-artifacts-${{ matrix.platform }}-${{ matrix.arch }} |
90 | 122 | path: dist/* |
91 | 123 |
|
92 | | - # # Job to create a DRAFT release (only for release branches) |
93 | | - # create-draft: |
94 | | - # name: Create Draft Release |
95 | | - # needs: [prepare, package] |
96 | | - # runs-on: ubuntu-latest |
97 | | - # # This job only runs for branches like 'release/2.X' |
98 | | - # if: startsWith(github.ref_name, 'release/2.') |
99 | | - # steps: |
100 | | - # - name: Generate Write-Access App Token |
101 | | - # id: generate_token |
102 | | - # uses: actions/create-github-app-token@v2 |
103 | | - # with: |
104 | | - # app-id: ${{ secrets.GH_APP_RELEASE_ID }} |
105 | | - # private-key: ${{ secrets.GH_APP_RELEASE_PRIVATE_KEY }} |
106 | | - # permission-contents: write |
107 | | - |
108 | | - # - name: Download all packages |
109 | | - # uses: actions/download-artifact@v4 |
110 | | - # with: |
111 | | - # name: conan-artifacts |
112 | | - # path: dist |
| 124 | + # Job to create a DRAFT release (only for release branches) |
| 125 | + create-draft: |
| 126 | + name: Create Draft Release |
| 127 | + needs: [prepare, package] |
| 128 | + runs-on: ubuntu-latest |
| 129 | + # This job only runs for branches like 'release/2.X' |
| 130 | + # if: startsWith(github.ref_name, 'release/2.') # uncomment later, now for testing |
| 131 | + steps: |
| 132 | + - name: Generate Write-Access App Token |
| 133 | + id: generate_token |
| 134 | + uses: actions/create-github-app-token@v2 |
| 135 | + with: |
| 136 | + app-id: ${{ secrets.GH_APP_RELEASE_ID }} |
| 137 | + private-key: ${{ secrets.GH_APP_RELEASE_PRIVATE_KEY }} |
| 138 | + permission-contents: read # change to write for the real one |
| 139 | + |
| 140 | + - name: Download all packages |
| 141 | + uses: actions/download-artifact@v4 |
| 142 | + with: |
| 143 | + name: conan-artifacts-* |
| 144 | + path: dist |
| 145 | + |
| 146 | + - name: Download changelog |
| 147 | + uses: actions/download-artifact@v4 |
| 148 | + with: |
| 149 | + name: release-notes |
113 | 150 |
|
114 | 151 | # - name: Create DRAFT GitHub Release |
115 | 152 | # env: |
116 | 153 | # GH_TOKEN: ${{ steps.generate_token.outputs.token }} |
117 | 154 | # run: | |
118 | | - # # Create a release in draft mode |
| 155 | + # # Create a release in draft mode using the generated changelog |
119 | 156 | # gh release create ${{ needs.prepare.outputs.conan_version }} \ |
120 | 157 | # --repo ${{ github.repository }} \ |
121 | 158 | # --title "Conan ${{ needs.prepare.outputs.conan_version }}" \ |
122 | | - # --notes "Release draft for version ${{ needs.prepare.outputs.conan_version }}. Please review and publish." \ |
| 159 | + # --notes-file release-notes-${{ needs.prepare.outputs.conan_version }}.md \ |
123 | 160 | # --target ${{ github.sha }} \ |
124 | 161 | # --draft \ |
125 | 162 | # dist/* |
126 | | - |
|
0 commit comments