Skip to content

Commit ad8e5c6

Browse files
committed
Update release workflow
1 parent 132ac55 commit ad8e5c6

File tree

1 file changed

+26
-26
lines changed

1 file changed

+26
-26
lines changed

.github/workflows/release.yml

+26-26
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
name: release
22

33
on:
4-
release:
5-
types:
6-
- published
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: 'Version tag'
8+
required: true
79

810
jobs:
911
build:
10-
name: Build and publish new release
12+
name: Publish new release
1113
runs-on: "ubuntu-latest"
1214

1315
steps:
14-
- uses: actions/checkout@v3
16+
- uses: actions/checkout@v4
1517

1618
- uses: astral-sh/setup-uv@v5
1719

1820
- name: Check that versions match
19-
id: version
2021
run: |
21-
echo "Release tag: [${{ github.event.release.tag_name }}]"
22-
PACKAGE_VERSION=$(uv run python -c "import reprexlite; print(reprexlite.__version__)")
22+
echo "Input version tag: [${{ github.event.inputs.version }}] "
23+
PACKAGE_VERSION=$(uv run python -m vspect read .)
2324
echo "Package version: [$PACKAGE_VERSION]"
24-
[ ${{ github.event.release.tag_name }} == "v$PACKAGE_VERSION" ] || { exit 1; }
25-
echo "::set-output name=major_minor_version::v${PACKAGE_VERSION%.*}"
25+
[[ ${{ github.event.inputs.version }} == "v$PACKAGE_VERSION" ]] || { exit 1; }
2626
2727
- name: Build package
2828
run: |
@@ -43,19 +43,19 @@ jobs:
4343
password: ${{ secrets.PYPI_PROD_TOKEN }}
4444
skip_existing: false
4545

46-
# - name: Deploy docs to gh-pages
47-
# working-directory: docs
48-
# run: |
49-
# git fetch origin gh-pages --depth=1
50-
# git config user.name github-actions[bot]
51-
# git config user.email 41898282+github-actions[bot]@users.noreply.github.com
52-
# # Rename old stable version
53-
# mike list -j | jq
54-
# OLD_STABLE=$(mike list -j | jq -r '.[] | select(.aliases | index("stable")) | .title' | awk '{print $1;}')
55-
# echo $OLD_STABLE
56-
# mike retitle stable $OLD_STABLE
57-
# # Deploy new version as stable
58-
# mike deploy --push --update-aliases --no-redirect \
59-
# ${{ steps.version.outputs.major_minor_version }} \
60-
# stable \
61-
# --title="${{ github.event.release.tag_name }} (stable)"
46+
- id: extract-changelog
47+
uses: sean0x42/markdown-extract@v2.1.0
48+
with:
49+
file: CHANGELOG.md
50+
pattern: ${{ github.event.inputs.version }}
51+
52+
- name: Write output to file
53+
run: |
54+
printf '${{ steps.extract-changelog.outputs.markdown }}' > __CHANGELOG-extracted.md
55+
56+
- uses: ncipollo/release-action@v1
57+
with:
58+
tag: ${{ github.event.inputs.version }}
59+
commit: main
60+
artifacts: "dist/*.whl,dist/*.tar.gz"
61+
bodyFile: "__CHANGELOG-extracted.md"

0 commit comments

Comments
 (0)