@@ -16,16 +16,18 @@ jobs:
16
16
id-token : write
17
17
steps :
18
18
- uses : actions/checkout@v4
19
+ with :
20
+ ref : ${{ github.ref }}
21
+ - uses : orbit-online/git-release@v1
22
+ id : tag
19
23
- name : Set up Python
20
24
uses : actions/setup-python@v5
21
25
with :
22
26
python-version : ' 3.11'
23
27
- name : Install dependencies
24
28
run : .devcontainer/post.sh
25
29
- name : Set version
26
- run : poetry version ${REF/#refs\/tags\/v/}
27
- env :
28
- REF : ${{ github.ref }}
30
+ run : poetry version ${{ steps.tag.outputs.tag }}
29
31
- name : Build
30
32
run : poetry build
31
33
- name : Publish package distributions to PyPI
@@ -36,47 +38,33 @@ jobs:
36
38
runs-on : ubuntu-latest
37
39
environment : release
38
40
steps :
39
- - name : Determine version
40
- id : version
41
- run : printf "tag=%s\n" "${REF#refs\/tags\/}" >> $GITHUB_OUTPUT
42
- env :
43
- REF : ${{ github.ref }}
44
41
- uses : actions/checkout@v4
45
42
with :
46
- ref : ${{ steps.version.outputs.tag }}
43
+ ref : ${{ github.ref }}
44
+ - uses : orbit-online/git-release@v1
45
+ id : tag
47
46
- name : Set up Python
48
47
uses : actions/setup-python@v5
49
48
with :
50
49
python-version : ' 3.11'
51
- - name : Create release tarball
50
+ - name : Create release assets
51
+ id : assets
52
52
run : |
53
53
.devcontainer/post.sh
54
- poetry version ${{ steps.version .outputs.tag }}
54
+ poetry version ${{ steps.tag .outputs.tag }}
55
55
poetry install
56
+ version=$(.venv/bin/docopt.sh --version)
57
+ printf "version=%s\n" "$version" >> $GITHUB_OUTPUT
58
+
56
59
mkdir dist
60
+ cp README.adoc LICENSE dist/
57
61
.venv/bin/docopt.sh generate-library >dist/docopt-lib.sh
58
- cd dist
59
62
printf '{
60
63
"name": "docopt-lib.sh",
61
- "version": "${{ steps.version.outputs.tag }}"
62
- }' >upkg.json
63
- tar -czf ../docopt-lib.sh-${{ steps.version.outputs.tag }}.tar.gz *
64
- - name : Get release notes from tag
65
- id : tag-message
66
- run : |
67
- eof="$(openssl rand -hex 8)"
68
- msg=$(git tag -l --format='%(contents)' "${{ steps.version.outputs.tag }}")
69
- msg=${msg%%'-----BEGIN'*}
70
- printf "message<<%s\n%s\n%s\n" "$eof" "$msg" "$eof" >> $GITHUB_OUTPUT
71
- env:
72
- REF: ${{ github.ref }}
73
- - name: Create Release
74
- uses: ncipollo/release-action@v1
64
+ "version": "%s"
65
+ }' "$version" >dist/upkg.json
66
+ - uses : orbit-online/upkg-release@v1
75
67
with :
76
- name: ${{ steps.version.outputs.tag }}
77
- body: ${{ steps.tag-message.outputs.message }}
78
- draft: false
79
- prerelease: false
80
- artifacts: docopt-lib.sh-${{ steps.version.outputs.tag }}.tar.gz
81
- artifactErrorsFailBuild: true
82
- artifactContentType: application/gzip
68
+ working-directory : dist
69
+ version : ${{ steps.assets.outputs.version }}
70
+ paths : docopt-lib.sh README.adoc LICENSE
0 commit comments