1
1
name : release
2
2
3
3
on :
4
- release :
5
- types :
6
- - published
4
+ workflow_dispatch :
5
+ inputs :
6
+ version :
7
+ description : ' Version tag'
8
+ required : true
7
9
8
10
jobs :
9
11
build :
10
- name : Build and publish new release
12
+ name : Publish new release
11
13
runs-on : " ubuntu-latest"
12
14
13
15
steps :
14
- - uses : actions/checkout@v3
16
+ - uses : actions/checkout@v4
15
17
16
18
- uses : astral-sh/setup-uv@v5
17
19
18
20
- name : Check that versions match
19
- id : version
20
21
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 . )
23
24
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; }
26
26
27
27
- name : Build package
28
28
run : |
@@ -43,19 +43,19 @@ jobs:
43
43
password : ${{ secrets.PYPI_PROD_TOKEN }}
44
44
skip_existing : false
45
45
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