@@ -22,15 +22,22 @@ jobs:
22
22
runs-on : ubuntu-latest
23
23
container : quay.io/coreos-assembler/fcos-buildroot:testing-devel
24
24
steps :
25
+ - uses : actions/create-github-app-token@v2
26
+ id : app-token
27
+ with :
28
+ app-id : ${{ secrets.APP_ID }}
29
+ private-key : ${{ secrets.APP_PRIVATE_KEY }}
30
+
25
31
- name : Checkout repository
26
32
uses : actions/checkout@v4
27
33
with :
28
34
fetch-depth : 0
29
- token : ${{ secrets.GITHUB_TOKEN }}
30
-
35
+ token : ${{ steps.app-token.outputs.token }}
36
+ persist-credentials : false
37
+
31
38
- name : Mark git checkout as safe
32
39
run : git config --global --add safe.directory "$GITHUB_WORKSPACE"
33
-
40
+
34
41
- name : Check if it's time for a release
35
42
id : check_schedule
36
43
run : |
@@ -39,29 +46,29 @@ jobs:
39
46
echo "should_release=true" >> $GITHUB_OUTPUT
40
47
exit 0
41
48
fi
42
-
49
+
43
50
START_DATE="2025-08-04" # start of a 3 week sprint
44
51
START_TIMESTAMP=$(date -d "$START_DATE" +%s)
45
52
CURRENT_TIMESTAMP=$(date +%s)
46
53
# Add 12 hour buffer (43200 seconds) to account for scheduling delays
47
54
ADJUSTED_TIMESTAMP=$((CURRENT_TIMESTAMP + 43200))
48
55
DAYS_SINCE_START=$(( (ADJUSTED_TIMESTAMP - START_TIMESTAMP) / 86400 ))
49
56
WEEKS_SINCE_START=$(( DAYS_SINCE_START / 7 ))
50
-
57
+
51
58
echo "Days since start date ($START_DATE): $DAYS_SINCE_START"
52
59
echo "Weeks since start date: $WEEKS_SINCE_START"
53
-
60
+
54
61
# Release every 3 weeks
55
62
if [ $WEEKS_SINCE_START -gt 0 ] && [ $((WEEKS_SINCE_START % 3)) -eq 0 ]; then
56
63
echo "should_release=true" >> $GITHUB_OUTPUT
57
64
else
58
65
echo "should_release=false" >> $GITHUB_OUTPUT
59
66
fi
60
-
67
+
61
68
- name : Install deps
62
69
if : steps.check_schedule.outputs.should_release == 'true'
63
70
run : ./ci/installdeps.sh
64
-
71
+
65
72
- name : Import GPG key
66
73
if : steps.check_schedule.outputs.should_release == 'true'
67
74
uses : crazy-max/ghaction-import-gpg@v6
71
78
git_user_signingkey : true
72
79
git_commit_gpgsign : true
73
80
git_tag_gpgsign : true
74
-
75
- - name : Create release commit
81
+
82
+ - name : Generate release changes
76
83
id : create_commit
77
84
if : steps.check_schedule.outputs.should_release == 'true'
78
85
env :
@@ -98,64 +105,31 @@ jobs:
98
105
99
106
cargo update --workspace
100
107
cargo xtask update-generated
101
- git commit -am "Release $VERSION"
102
108
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
103
-
104
- - name : Create release branch
105
- if : steps.check_schedule.outputs.should_release == 'true'
106
- id : create_branch
107
- env :
108
- VERSION : ${{ steps.create_commit.outputs.VERSION }}
109
- run : |
110
- BRANCH_NAME="release-${VERSION}"
111
- git checkout -b "$BRANCH_NAME"
112
- echo "branch_name=$BRANCH_NAME" >> $GITHUB_OUTPUT
113
-
114
- - name : Push branch
115
- if : steps.check_schedule.outputs.should_release == 'true'
116
- env :
117
- BRANCH_NAME : ${{ steps.create_branch.outputs.branch_name }}
118
- run : |
119
- git push origin "${BRANCH_NAME}"
120
-
109
+
121
110
- name : Create Pull Request
122
- if : steps.check_schedule.outputs.should_release == 'true'
123
- uses : actions/github-script@v7
111
+ uses : peter-evans/create-pull-request@v7
124
112
env :
125
113
VERSION : ${{ steps.create_commit.outputs.VERSION }}
126
- BRANCH_NAME : ${{ steps.create_branch.outputs.branch_name }}
127
114
with :
128
- script : |
129
- const version = process.env.VERSION;
130
- const branchName = process.env.BRANCH_NAME;
131
-
132
- const { data: pr } = await github.rest.pulls.create({
133
- owner: context.repo.owner,
134
- repo: context.repo.repo,
135
- title: `Release ${version}`,
136
- body: `## Release ${version}
137
-
115
+ token : ${{ steps.app-token.outputs.token }}
116
+ signoff : true
117
+ sign-commits : true
118
+ title : " Release ${{ env.VERSION }}"
119
+ commit-message : " Release ${{ env.VERSION }}"
120
+ branch : " release-${{ env.VERSION }}"
121
+ delete-branch : true
122
+ labels : release
123
+ body : |
124
+ ## Release ${{ env.VERSION }}
125
+
138
126
This is an automated release PR created by the scheduled release workflow.
139
-
127
+
140
128
### Release Process
141
-
129
+
142
130
1. Review the changes in this PR
143
131
2. Ensure all tests pass
144
132
3. Merge the PR
145
133
4. The release tag will be automatically created and signed when this PR is merged
146
-
147
- The release workflow will automatically trigger when the tag is pushed.`,
148
- head: branchName,
149
- base: 'main',
150
- draft: false
151
- });
152
-
153
- // Add the release label
154
- await github.rest.issues.addLabels({
155
- owner: context.repo.owner,
156
- repo: context.repo.repo,
157
- issue_number: pr.number,
158
- labels: ['release']
159
- });
160
-
161
- console.log(`Created PR #${pr.number}: ${pr.html_url}`);
134
+
135
+ The release workflow will automatically trigger when the tag is pushed.
0 commit comments