Skip to content

Commit a7a8887

Browse files
committed
wip
1 parent 386dd7a commit a7a8887

File tree

1 file changed

+61
-25
lines changed

1 file changed

+61
-25
lines changed

.github/workflows/draft-release.yml

Lines changed: 61 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
conan_version: ${{ steps.vars.outputs.conan_version }}
1616

1717
steps:
18-
- name: Checkout code
18+
- name: Checkout conan repository
1919
uses: actions/checkout@v4
2020

2121
- name: Extract version
@@ -26,6 +26,38 @@ jobs:
2626
echo "conan_version=$VERSION" >> $GITHUB_OUTPUT
2727
echo "Version found: $VERSION"
2828
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+
2961
package:
3062
name: Package for ${{ matrix.platform }}/${{ matrix.arch }}
3163
needs: prepare
@@ -89,38 +121,42 @@ jobs:
89121
name: conan-artifacts-${{ matrix.platform }}-${{ matrix.arch }}
90122
path: dist/*
91123

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
113150

114151
# - name: Create DRAFT GitHub Release
115152
# env:
116153
# GH_TOKEN: ${{ steps.generate_token.outputs.token }}
117154
# run: |
118-
# # Create a release in draft mode
155+
# # Create a release in draft mode using the generated changelog
119156
# gh release create ${{ needs.prepare.outputs.conan_version }} \
120157
# --repo ${{ github.repository }} \
121158
# --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 \
123160
# --target ${{ github.sha }} \
124161
# --draft \
125162
# dist/*
126-

0 commit comments

Comments
 (0)