Skip to content

infra(release): draft release #1

infra(release): draft release

infra(release): draft release #1

Workflow file for this run

name: Draft Release
on:
push:
branches:
- next
permissions:
contents: write
jobs:
draft_release:
if: startsWith(github.event.head_commit.message, 'chore(release):')
runs-on: ubuntu-latest
steps:
- name: Extract release version
run: |
RELEASE_VERSION=$(echo "${{ github.event.head_commit.message }}" | cut -d ': ' -f 2)
echo "RELEASE_VERSION=$RELEASE_VERSION"
echo "RELEASE_VERSION=$RELEASE_VERSION" >> $GITHUB_ENV
PREVIOUS_VERSION=$(git describe --tags --abbrev=0)
echo "PREVIOUS_VERSION=$PREVIOUS_VERSION"
echo "PREVIOUS_VERSION=$PREVIOUS_VERSION" >> $GITHUB_ENV
- name: Release Args - Prerelease
if: contains(github.event.head_commit.message, '-')
run: |
RELEASE_ARGS="--prerelease"
echo "RELEASE_ARGS=$RELEASE_ARGS"
echo "RELEASE_ARGS=$RELEASE_ARGS" >> $GITHUB_ENV
- name: Release Args - Release
if: "!contains(github.event.head_commit.message, '-')"
run: |
RELEASE_ARGS="--latest"
echo "RELEASE_ARGS=$RELEASE_ARGS"
echo "RELEASE_ARGS=$RELEASE_ARGS" >> $GITHUB_ENV
- name: Create draft release
run: |
if
gh release create \
$RELEASE_VERSION \
--draft \
$RELEASE_ARGS \
--generate-notes \
--notes-start-tag $PREVIOUS_VERSION \
--title $RELEASE_VERSION
env:
GH_TOKEN: ${{ github.token }}