mirror of
https://github.com/Kaelio/ktx.git
synced 2026-06-10 08:05:14 +02:00
ci: simplify ktx release flow
This commit is contained in:
parent
7110aa6f5c
commit
bbd9568287
14 changed files with 98 additions and 510 deletions
40
.github/workflows/release.yml
vendored
40
.github/workflows/release.yml
vendored
|
|
@ -7,10 +7,10 @@ on:
|
|||
description: "Release kind: rc publishes to next, stable publishes to latest"
|
||||
required: true
|
||||
type: choice
|
||||
default: "rc"
|
||||
default: "stable"
|
||||
options:
|
||||
- rc
|
||||
- stable
|
||||
- rc
|
||||
force_release:
|
||||
description: "Force a patch release even if semantic-release finds no releasable commits"
|
||||
required: false
|
||||
|
|
@ -20,7 +20,7 @@ on:
|
|||
description: "Create the release and publish @kaelio/ktx to npm instead of running a dry-run"
|
||||
required: true
|
||||
type: boolean
|
||||
default: false
|
||||
default: true
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
|
@ -69,20 +69,6 @@ jobs:
|
|||
- name: Install Python dependencies
|
||||
run: uv sync --all-packages
|
||||
|
||||
- name: Prepare first stable release floor
|
||||
if: ${{ inputs.release_kind == 'stable' }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
|
||||
stable_tags="$(git tag --merged HEAD --list 'v[0-9]*.[0-9]*.[0-9]*' | grep -v '-' || true)"
|
||||
if [ -n "${stable_tags}" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
root_commit="$(git rev-list --max-parents=0 HEAD | tail -n 1)"
|
||||
git tag v0.0.0 "${root_commit}"
|
||||
echo "KTX_STABLE_RELEASE_FLOOR_TAG=v0.0.0" >> "${GITHUB_ENV}"
|
||||
|
||||
- name: Prepare next prerelease branch
|
||||
if: ${{ inputs.release_kind == 'rc' }}
|
||||
run: |
|
||||
|
|
@ -104,6 +90,26 @@ jobs:
|
|||
env:
|
||||
KTX_PRERELEASE_BRANCH: next
|
||||
|
||||
- name: Prepare npm package root for release verification
|
||||
run: |
|
||||
set -euo pipefail
|
||||
|
||||
mkdir -p dist/public-npm-package
|
||||
node --input-type=module <<'EOF'
|
||||
import { writeFile } from 'node:fs/promises';
|
||||
|
||||
const packageJson = {
|
||||
name: '@kaelio/ktx',
|
||||
version: '0.0.0',
|
||||
private: false
|
||||
};
|
||||
|
||||
await writeFile(
|
||||
'dist/public-npm-package/package.json',
|
||||
`${JSON.stringify(packageJson, null, 2)}\n`
|
||||
);
|
||||
EOF
|
||||
|
||||
- name: Dry-run semantic release
|
||||
if: ${{ !inputs.publish_live }}
|
||||
run: |
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue