2021-03-23 19:56:10 -04:00
name : "Draft new release"
on :
workflow_dispatch :
inputs :
version :
2022-04-04 06:49:02 -04:00
description : "The new version in X.Y.Z format."
2021-03-23 19:56:10 -04:00
required : true
jobs :
draft-new-release :
name : "Draft a new release"
runs-on : ubuntu-latest
steps :
2024-03-12 09:10:43 -04:00
- uses : actions/checkout@v4.1.2
2021-03-23 19:56:10 -04:00
with :
token : ${{ secrets.BOTTY_GITHUB_TOKEN }}
- name : Create release branch
run : git checkout -b release/${{ github.event.inputs.version }}
- name : Update changelog
2024-02-14 23:29:12 -05:00
uses : thomaseizinger/keep-a-changelog-new-release@2.0.0
2021-03-23 19:56:10 -04:00
with :
version : ${{ github.event.inputs.version }}
changelogPath : CHANGELOG.md
- name : Initialize mandatory git config
run : |
git config user.name "${{ secrets.BOTTY_NAME }}"
git config user.email ${{ secrets.BOTTY_EMAIL }}
- name : Bump version in Cargo.toml
uses : thomaseizinger/set-crate-version@1.0.0
with :
version : ${{ github.event.inputs.version }}
manifest : swap/Cargo.toml
- name : Update Cargo.lock
run : cargo update --workspace
- name : Commit changelog and manifest files
id : make-commit
2023-08-07 09:31:09 -04:00
env :
DPRINT_VERSION : 0.39 .1
2023-12-05 06:21:12 -05:00
RUST_TOOLCHAIN : 1.70
2021-03-23 19:56:10 -04:00
run : |
2023-08-08 03:48:44 -04:00
rustup component add rustfmt --toolchain "$RUST_TOOLCHAIN-x86_64-unknown-linux-gnu"
2023-08-07 09:31:09 -04:00
curl -fsSL https://dprint.dev/install.sh | sh -s $DPRINT_VERSION
2021-03-23 19:56:10 -04:00
/home/runner/.dprint/bin/dprint fmt
git add CHANGELOG.md Cargo.lock swap/Cargo.toml
git commit --message "Prepare release ${{ github.event.inputs.version }}"
echo "::set-output name=commit::$(git rev-parse HEAD)"
- name : Push new branch
run : git push origin release/${{ github.event.inputs.version }} --force
- name : Create pull request
2023-07-31 07:09:36 -04:00
uses : thomaseizinger/create-pull-request@1.3.1
2021-03-23 19:56:10 -04:00
with :
GITHUB_TOKEN : ${{ secrets.BOTTY_GITHUB_TOKEN }}
head : release/${{ github.event.inputs.version }}
base : master
title : Release version ${{ github.event.inputs.version }}
reviewers : ${{ github.actor }}
body : |
Hi @${{ github.actor }}!
This PR was created in response to a manual trigger of the release workflow here : https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}.
I've updated the changelog and bumped the versions in the manifest files in this commit : ${{ steps.make-commit.outputs.commit }}.
Merging this PR will create a GitHub release and upload any assets that are created as part of the release build.