Create Release PR #61
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
| name: Create Release PR | |
| on: | |
| schedule: | |
| # Run weekly on Monday at 8:00 AM UTC | |
| - cron: '0 8 * * 1' | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: 'Version type to release, either "patch" (default) or "minor"' | |
| required: false | |
| type: string | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| create-release-pr: | |
| runs-on: ubuntu-latest | |
| container: quay.io/coreos-assembler/fcos-buildroot:testing-devel | |
| steps: | |
| - uses: actions/create-github-app-token@v3 | |
| id: app-token | |
| with: | |
| app-id: ${{ secrets.APP_ID }} | |
| private-key: ${{ secrets.APP_PRIVATE_KEY }} | |
| - name: Checkout repository | |
| uses: actions/checkout@v7 | |
| with: | |
| fetch-depth: 0 | |
| token: ${{ steps.app-token.outputs.token }} | |
| persist-credentials: false | |
| - name: Mark git checkout as safe | |
| run: git config --global --add safe.directory "$GITHUB_WORKSPACE" | |
| - name: Install deps | |
| run: ./ci/installdeps.sh | |
| - name: Import GPG key | |
| uses: crazy-max/ghaction-import-gpg@v7 | |
| with: | |
| gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} | |
| passphrase: ${{ secrets.GPG_PASSPHRASE }} | |
| git_user_signingkey: true | |
| git_commit_gpgsign: true | |
| git_tag_gpgsign: true | |
| - name: Generate release changes | |
| id: create_commit | |
| env: | |
| INPUT_VERSION: ${{ github.event.inputs.version }} | |
| run: | | |
| dnf -y install go-md2man | |
| cargo install cargo-edit | |
| # Default to bumping a patch | |
| cargo set-version --manifest-path crates/lib/Cargo.toml --package bootc-lib --bump ${INPUT_VERSION:-patch} | |
| VERSION=$(cargo read-manifest --manifest-path crates/lib/Cargo.toml | jq -r '.version') | |
| # Set internal crate versions to match the bootc release version | |
| cargo set-version --manifest-path crates/utils/Cargo.toml --package bootc-internal-utils "$VERSION" | |
| cargo set-version --manifest-path crates/mount/Cargo.toml --package bootc-internal-mount "$VERSION" | |
| cargo set-version --manifest-path crates/blockdev/Cargo.toml --package bootc-internal-blockdev "$VERSION" | |
| echo "VERSION=$VERSION" >> $GITHUB_OUTPUT | |
| - name: Create Pull Request | |
| uses: peter-evans/create-pull-request@v8 | |
| env: | |
| VERSION: ${{ steps.create_commit.outputs.VERSION }} | |
| with: | |
| token: ${{ steps.app-token.outputs.token }} | |
| signoff: true | |
| sign-commits: true | |
| title: "Release ${{ env.VERSION }}" | |
| commit-message: "Release ${{ env.VERSION }}" | |
| branch: "release-${{ env.VERSION }}" | |
| delete-branch: true | |
| labels: release | |
| body: | | |
| ## Release ${{ env.VERSION }} | |
| This is an automated release PR created by the scheduled release workflow. | |
| ### Release Process | |
| 1. Review the changes in this PR | |
| 2. Ensure all tests pass | |
| 3. Merge the PR | |
| 4. The release tag will be automatically created and signed when this PR is merged | |
| The release workflow will automatically trigger when the tag is pushed. |