@@ -31,23 +31,19 @@ jobs:
31
31
run : twine check dist/*
32
32
33
33
- name : Upload package artifacts
34
- uses : actions/upload-artifact@master
34
+ uses : actions/upload-artifact@v4
35
35
with :
36
36
name : package-artifacts
37
37
path : dist/
38
38
39
39
- name : Publish package to PyPI
40
- uses : pypa/gh-action-pypi-publish@master
40
+ uses : pypa/gh-action-pypi-publish@release/v1
41
41
with :
42
- user : __token__
43
42
password : ${{ secrets.test_pypi_password }}
44
- repository_url : https://test.pypi.org/legacy/
43
+ repository-url : https://test.pypi.org/legacy/
45
44
46
- # Sleep for some seconds to give Test PyPI time to update the search index
47
- - name : Sleep for 120 seconds
48
- uses : jakejarvis/wait-action@master
49
- with :
50
- time : ' 120s'
45
+ - name : Sleep for 120 seconds to give Test PyPI time to update the search index
46
+ run : sleep 120
51
47
52
48
verify-test-pypi :
53
49
name : Install from Test PyPI
@@ -63,16 +59,13 @@ jobs:
63
59
with :
64
60
python-version : " 3.x"
65
61
66
- - name : Get release version
67
- id : release_version
68
- run : |
69
- echo ::set-output name=number::${GITHUB_REF#refs/*/}
70
- echo ${{ steps.release_version.outputs.number }}
71
-
72
- - name : Install torch-lr-finder ${{ steps.release_version.outputs.number }} from Test PyPI
62
+ - name : Install torch-lr-finder ${{ github.ref_name }} from Test PyPI
73
63
run : |
74
64
python -m pip install --upgrade pip
75
- pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple torch-lr-finder==${{ steps.release_version.outputs.number }}
65
+ pip install \
66
+ --index-url https://test.pypi.org/simple/ \
67
+ --extra-index-url https://pypi.org/simple \
68
+ torch-lr-finder==${{ github.ref_name }}
76
69
77
70
release :
78
71
name : Create Release
@@ -83,43 +76,14 @@ jobs:
83
76
- name : Checkout repository
84
77
uses : actions/checkout@v4
85
78
86
- # We need the whole history so we can later generate the release notes from the commit logs
87
- - name : Fetch all history for all tags and branches
88
- run : git fetch --prune --unshallow
89
-
90
- # Generate draft release notes by taking the commit logs between this release and the previous
91
- - name : Generate draft release notes
92
- id : release_notes
93
- run : |
94
- # Get the whole commit log with a pretty and easy to post-process format
95
- notes="$(git log --pretty=format:' -%d%Creset %s' --abbrev-commit)"
96
-
97
- # Get commit logs between this tag and the previous one
98
- notes="$(awk '/tag: v/ { flag=!flag; count+=1; next } flag && count < 2 {print}' <<< "$notes")"
99
-
100
- # Remove all merge commits for a cleaner log
101
- notes="$(sed '/Merge pull request #/d' <<< "$notes")"
102
-
103
- # Some weird string replacements to escape special characters...blame GitHub
104
- # for this https://github.community/t5/GitHub-Actions/set-output-Truncates-Multiline-Strings/td-p/37870
105
- notes="${notes//'%'/'%25'}"
106
- notes="${notes//$'\n'/'%0A'}"
107
- notes="${notes//$'\r'/'%0D'}"
108
-
109
- echo "::set-output name=content::$notes"
110
-
111
79
- name : Create draft release
112
- uses : actions/create-release@master
80
+ run : |
81
+ gh release create ${{ github.ref_name }} \
82
+ --title "Release ${{ github.ref_name }}" \
83
+ --generate-notes \
84
+ --draft
113
85
env :
114
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
115
- with :
116
- tag_name : ${{ github.ref }}
117
- release_name : Release ${{ github.ref }}
118
- body : |
119
- Release notes:
120
- ${{ steps.release_notes.outputs.content }}
121
- draft : true
122
- prerelease : false
86
+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
123
87
124
88
deploy-pypi :
125
89
name : Deploy to PyPI
@@ -128,13 +92,12 @@ jobs:
128
92
129
93
steps :
130
94
- name : Download package artifacts
131
- uses : actions/download-artifact@master
95
+ uses : actions/download-artifact@v4
132
96
with :
133
97
name : package-artifacts
134
98
path : dist/
135
99
136
100
- name : Publish package to PyPI
137
- uses : pypa/gh-action-pypi-publish@master
101
+ uses : pypa/gh-action-pypi-publish@release/v1
138
102
with :
139
- user : __token__
140
103
password : ${{ secrets.pypi_password }}
0 commit comments