Skip to content
This repository was archived by the owner on Jan 28, 2022. It is now read-only.

Commit 8988c30

Browse files
author
Sergey Vilgelm
committed
Create release for tags
1 parent 4405a16 commit 8988c30

File tree

4 files changed

+49
-2
lines changed

4 files changed

+49
-2
lines changed

.github/sv-go-tools-bot.asc.gpg

4.87 KB
Binary file not shown.

.github/workflows/release.yml

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ on:
55
tags:
66
- "[0-9]+.[0-9]+.[0-9]+"
77

8+
env:
9+
GPG_KEY: "7D76B375F08A7D93584B36D766538F03CDA385C7"
10+
811
jobs:
912
release:
1013
runs-on: ubuntu-latest
@@ -18,10 +21,52 @@ jobs:
1821
run: |
1922
python -m pip install --upgrade pip
2023
pip install setuptools wheel twine
24+
- name: Prepare gpg
25+
run: |
26+
gpgconf --kill gpg-agent
27+
gpg --quiet --batch --yes --decrypt --passphrase="${{ secrets.GPG_PASSPHRASE }}" --output .github/sv-go-tools-bot.asc .github/sv-go-tools-bot.asc.gpg
28+
gpg --batch --yes --import .github/sv-go-tools-bot.asc
2129
- name: Build and publish
2230
env:
2331
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
2432
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
2533
run: |
2634
python setup.py sdist bdist_wheel
27-
twine upload dist/*
35+
twine upload --sign --identity=${GPG_KEY} dist/*
36+
- name: Set Version
37+
id: version
38+
run: echo "::set-output name=version::$(echo ${{ github.ref }} | cut -d'/' -f3)"
39+
- name: sign
40+
id: sign
41+
run: |
42+
cd dist
43+
export GPG_TTY=$(tty)
44+
TARGET="marshmallow_objects-${{ steps.version.outputs.version }}-py3-none-any.whl"
45+
gpg --pinentry-mode loopback --batch --yes --default-key ${GPG_KEY} --output "${TARGET}.sig" --detach-sig "${TARGET}"
46+
echo "::set-output name=linux::${TARGET}.sig"
47+
- name: Create release
48+
id: create_release
49+
uses: actions/create-release@v1
50+
env:
51+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
52+
with:
53+
tag_name: ${{ github.ref }}
54+
release_name: Release ${{ steps.version.outputs.version }}
55+
- name: Upload wheel
56+
uses: actions/[email protected]
57+
env:
58+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
59+
with:
60+
upload_url: ${{ steps.create_release.outputs.upload_url }}
61+
asset_path: dist/marshmallow_objects-${{ steps.version.outputs.version }}-py3-none-any.whl
62+
asset_name: marshmallow_objects-${{ steps.version.outputs.version }}-py3-none-any.whl
63+
asset_content_type: application/octet-stream
64+
- name: Upload signature
65+
uses: actions/[email protected]
66+
env:
67+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
68+
with:
69+
upload_url: ${{ steps.create_release.outputs.upload_url }}
70+
asset_path: dist/marshmallow_objects-${{ steps.version.outputs.version }}-py3-none-any.whl.sig
71+
asset_name: marshmallow_objects-${{ steps.version.outputs.version }}-py3-none-any.whl.sig
72+
asset_content_type: application/pgp-signature

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,3 +99,5 @@ ENV/
9999

100100
# mypy
101101
.mypy_cache/
102+
103+
.github/sv-go-tools-bot.asc

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ keywords = marshmallow objects models yaml json ini config parser
2121
packages = marshmallow_objects
2222

2323
[bdist_wheel]
24-
universal = 1
24+
universal = 0
2525

2626
[flake8]
2727
max-line-length = 120

0 commit comments

Comments
 (0)