@@ -2,14 +2,12 @@ name: Create Release PR
22
33on :
44 schedule :
5- # Run every 3 weeks on Monday at 8:00 AM UTC
6- # Note: GitHub Actions doesn't support "every 3 weeks" directly,
7- # so we use a workaround by running weekly and checking if it's been 3 weeks
5+ # Run weekly on Monday at 8:00 AM UTC
86 - cron : ' 0 8 * * 1'
97 workflow_dispatch :
108 inputs :
119 version :
12- description : ' Version type to release, either "minor " (default) or "patch" for just a bugfix release '
10+ description : ' Version type to release, either "patch " (default) or "minor" '
1311 required : false
1412 type : string
1513
@@ -38,39 +36,10 @@ jobs:
3836 - name : Mark git checkout as safe
3937 run : git config --global --add safe.directory "$GITHUB_WORKSPACE"
4038
41- - name : Check if it's time for a release
42- id : check_schedule
43- run : |
44- # For manual workflow dispatch, always proceed
45- if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
46- echo "should_release=true" >> $GITHUB_OUTPUT
47- exit 0
48- fi
49-
50- START_DATE="2026-01-05" # start of a 3 week sprint
51- START_TIMESTAMP=$(date -d "$START_DATE" +%s)
52- CURRENT_TIMESTAMP=$(date +%s)
53- # Add 12 hour buffer (43200 seconds) to account for scheduling delays
54- ADJUSTED_TIMESTAMP=$((CURRENT_TIMESTAMP + 43200))
55- DAYS_SINCE_START=$(( (ADJUSTED_TIMESTAMP - START_TIMESTAMP) / 86400 ))
56- WEEKS_SINCE_START=$(( DAYS_SINCE_START / 7 ))
57-
58- echo "Days since start date ($START_DATE): $DAYS_SINCE_START"
59- echo "Weeks since start date: $WEEKS_SINCE_START"
60-
61- # Release every 3 weeks
62- if [ $WEEKS_SINCE_START -gt 0 ] && [ $((WEEKS_SINCE_START % 3)) -eq 0 ]; then
63- echo "should_release=true" >> $GITHUB_OUTPUT
64- else
65- echo "should_release=false" >> $GITHUB_OUTPUT
66- fi
67-
6839 - name : Install deps
69- if : steps.check_schedule.outputs.should_release == 'true'
7040 run : ./ci/installdeps.sh
7141
7242 - name : Import GPG key
73- if : steps.check_schedule.outputs.should_release == 'true'
7443 uses : crazy-max/ghaction-import-gpg@v7
7544 with :
7645 gpg_private_key : ${{ secrets.GPG_PRIVATE_KEY }}
@@ -81,24 +50,21 @@ jobs:
8150
8251 - name : Generate release changes
8352 id : create_commit
84- if : steps.check_schedule.outputs.should_release == 'true'
8553 env :
8654 INPUT_VERSION : ${{ github.event.inputs.version }}
8755 run : |
8856 dnf -y install go-md2man
8957 cargo install cargo-edit
9058
91- # Default to bumping a minor
92- cargo set-version --manifest-path crates/lib/Cargo.toml --package bootc-lib --bump ${INPUT_VERSION:-minor }
59+ # Default to bumping a patch
60+ cargo set-version --manifest-path crates/lib/Cargo.toml --package bootc-lib --bump ${INPUT_VERSION:-patch }
9361 VERSION=$(cargo read-manifest --manifest-path crates/lib/Cargo.toml | jq -r '.version')
9462
9563 # Set internal crate versions to match the bootc release version
9664 cargo set-version --manifest-path crates/utils/Cargo.toml --package bootc-internal-utils "$VERSION"
9765 cargo set-version --manifest-path crates/mount/Cargo.toml --package bootc-internal-mount "$VERSION"
9866 cargo set-version --manifest-path crates/blockdev/Cargo.toml --package bootc-internal-blockdev "$VERSION"
9967
100- cargo update --workspace
101- cargo xtask update-generated
10268 echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
10369
10470 - name : Create Pull Request
0 commit comments