This repository has been archived by the owner on Jan 28, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
73 lines (71 loc) · 2.8 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name: Upload Python Package
on:
push:
tags:
- "*"
env:
GPG_KEY: "7D76B375F08A7D93584B36D766538F03CDA385C7"
PYTHON: 3.8
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/[email protected]
with:
python-version: ${{ env.PYTHON }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Prepare gpg
run: |
gpgconf --kill gpg-agent
gpg --quiet --batch --yes --decrypt --passphrase="${{ secrets.GPG_PASSPHRASE }}" --output .github/sv-go-tools-bot.asc .github/sv-go-tools-bot.asc.gpg
gpg --batch --yes --import .github/sv-go-tools-bot.asc
rm .github/sv-go-tools-bot.asc
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload --sign --identity=${GPG_KEY} dist/*
- name: Set Version
id: version
run: echo "::set-output name=version::$(echo ${{ github.ref }} | cut -d'/' -f3)"
- name: sign
id: sign
run: |
cd dist
export GPG_TTY=$(tty)
TARGET="marshmallow_objects-${{ steps.version.outputs.version }}-py3-none-any.whl"
gpg --pinentry-mode loopback --batch --yes --default-key ${GPG_KEY} --output "${TARGET}.sig" --detach-sig "${TARGET}"
echo "::set-output name=linux::${TARGET}.sig"
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ steps.version.outputs.version }}
- name: Upload wheel
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: dist/marshmallow_objects-${{ steps.version.outputs.version }}-py3-none-any.whl
asset_name: marshmallow_objects-${{ steps.version.outputs.version }}-py3-none-any.whl
asset_content_type: application/octet-stream
- name: Upload signature
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: dist/marshmallow_objects-${{ steps.version.outputs.version }}-py3-none-any.whl.sig
asset_name: marshmallow_objects-${{ steps.version.outputs.version }}-py3-none-any.whl.sig
asset_content_type: application/pgp-signature