Skip to content

test release workflow #7

test release workflow

test release workflow #7

Workflow file for this run

name: Create draft release
on:
pull_request:
branches:
- test_next
jobs:
draft_release:
name: Draft release
if: startsWith(github.head_ref, 'release/')
runs-on: ubuntu-latest
steps:
- name: Checkout files
uses: actions/checkout@v4
with:
fetch-tags: true
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
- name: Fetch history and git
run: |
git fetch --prune --unshallow --tags
- name: Install
run: npm ci
- name: Build and add dist files
run: |
rm -rf dist/
npm run build:content
git add package* dist/
- name: Parse changelog
id: get_changelog
run: echo "changelog=$(npm run changelog)" >> "$GITHUB_OUTPUT"
# https://stackoverflow.com/questions/59191913/how-do-i-get-the-output-of-a-specific-step-in-github-actions
- name: Determine version bump
id: determine_bump
run: |
echo ${{ steps.get_changelog.outputs.changelog }}
echo "isMajor=${{ contains(steps.get_changelog.outputs.changelog, '!:') }}" >> "$GITHUB_OUTPUT"
echo "isMinor=${{ contains(steps.get_changelog.outputs.changelog, 'feat') && !steps.determine_bump.isMajor }}" >> "$GITHUB_OUTPUT"
- name: Increment versionß
id: bump_version
run: |
npm version ${{ (steps.determine_bump.outputs.isMajor=='true' && 'major') || (steps.determine_bump.outputs.isMinor=='true' && 'minor') || 'patch' }} --force -m "chore(release): Bumps version to v%s and updates dist files"
echo updatedVersion=$(node -p "require('./package.json').version") >> "$GITHUB_OUTPUT"
- name: Build notes
id: build_notes
uses: mikepenz/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
owner: Laboratoria
# fromTag: v7.1.0
# toTag: v7.6.0
- name: Make release draft
id: release_draft
run: |
echo ${{ steps.version_tag_release_draft.outputs.new_tag }}
# echo ${{ steps.build_notes.outputs.changelog }}
# run: |
# gh release create ${{ steps.version_tag_release_draft.outputs.new_tag }} \
# --repo="$GITHUB_REPOSITORY" \
# --title="${GITHUB_REPOSITORY#*/} ${{ steps.version_tag_release_draft.outputs.new_tag }}" \
# --notes ${{steps.build_notes.outputs.changelog}} \
# --draft