Skip to content

Draft new release

Draft new release #25

name: "Draft new release"
on:
workflow_dispatch:
inputs:
version:
jobs:
draft-new-release:
name: "Draft a new release"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
- name: extract cpuid flags
id: extract-cpuid-flags
run: echo "flags=$(grep '^flags' /proc/cpuinfo | head -n1 | shasum)" >> $GITHUB_OUTPUT
- uses: Swatinem/rust-cache@v2
with:
key: ${{steps.extract-cpuid-flags.outputs.flags }}
- name: Install cargo-edit
uses: actions-rs/[email protected]
with:
crate: cargo-edit
version: latest
- name: Bump new version in TOML files
run: |
OLD_VERSION=$(cargo pkgid | cut -d# -f2 | cut -d: -f2)
echo "OLD=$OLD_VERSION" >> $GITHUB_ENV
cargo set-version ${{github.event.inputs.version}}
NEW_VERSION=$(cargo pkgid | cut -d# -f2 | cut -d: -f2)
echo "NEW=$NEW_VERSION" >> $GITHUB_ENV
- name: Create release branch
run: git checkout -b release/${{ env.NEW }}
- name: Initialize mandatory git config
run: |
git config user.name "GitHub actions"
git config user.email [email protected]
- name: Updating tremor-script dependency
run: .github/scripts/bump.sh ${{ env.OLD }} ${{ env.NEW }}
- run: cargo check
- name: Commit changelog and manifest files
id: make-commit
run: |
git commit -sa -m "Prepare release ${{ env.NEW }}"
echo "::set-output name=commit::$(git rev-parse HEAD)"
- name: Push new branch
run: git push origin release/${{ env.NEW }}
- name: Create pull request
run: |
gh pr create -B main --title "Release-v${{ env.NEW }}" --body "Yay release" --label "Release"
env:
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}