Skip to content

Commit cdac7f6

Browse files
committed
github actions: Create consistency between version names
1 parent bd2958f commit cdac7f6

File tree

1 file changed

+21
-33
lines changed

1 file changed

+21
-33
lines changed

.github/workflows/release.yaml

+21-33
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,18 @@ jobs:
1616
id-token: write
1717
steps:
1818
- uses: actions/checkout@v4
19+
with:
20+
ref: ${{ github.ref }}
21+
- uses: orbit-online/git-release@v1
22+
id: tag
1923
- name: Set up Python
2024
uses: actions/setup-python@v5
2125
with:
2226
python-version: '3.11'
2327
- name: Install dependencies
2428
run: .devcontainer/post.sh
2529
- 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 }}
2931
- name: Build
3032
run: poetry build
3133
- name: Publish package distributions to PyPI
@@ -36,47 +38,33 @@ jobs:
3638
runs-on: ubuntu-latest
3739
environment: release
3840
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 }}
4441
- uses: actions/checkout@v4
4542
with:
46-
ref: ${{ steps.version.outputs.tag }}
43+
ref: ${{ github.ref }}
44+
- uses: orbit-online/git-release@v1
45+
id: tag
4746
- name: Set up Python
4847
uses: actions/setup-python@v5
4948
with:
5049
python-version: '3.11'
51-
- name: Create release tarball
50+
- name: Create release assets
51+
id: assets
5252
run: |
5353
.devcontainer/post.sh
54-
poetry version ${{ steps.version.outputs.tag }}
54+
poetry version ${{ steps.tag.outputs.tag }}
5555
poetry install
56+
version=$(.venv/bin/docopt.sh --version)
57+
printf "version=%s\n" "$version" >> $GITHUB_OUTPUT
58+
5659
mkdir dist
60+
cp README.adoc LICENSE dist/
5761
.venv/bin/docopt.sh generate-library >dist/docopt-lib.sh
58-
cd dist
5962
printf '{
6063
"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
7567
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

Comments
 (0)