-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (72 loc) · 2.59 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
74
name: release
on:
push:
tags:
- '*'
jobs:
build:
name: Upload Release Assets
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v1
with:
python-version: 3.8
- name: Parse version
id: version
run: echo ::set-output name=version::${GITHUB_REF/refs\/tags\/v}
- name: Install Poetry
run: |
python -m pip install --upgrade pip
pip install poetry
- name: Install python packages
run: poetry install
- name: Build package
run: poetry build
- name: Copy build files to generic names
id: file_names
run: |
cp dist/shot-${{ steps.version.outputs.version }}.tar.gz dist/shot.tar.gz
cp dist/shot-${{ steps.version.outputs.version }}-py3-none-any.whl dist/shot-py3-none-any.whl
echo ::set-output name=tar_file::shot.tar.gz
echo ::set-output name=wheel_file::shot-py3-none-any.whl
- name: Generate SHAs
id: sha
run: |
echo ::set-output name=tar_sha::$(shasum -a 256 dist/${{ steps.file_names.outputs.tar_file }})
echo ::set-output name=wheel_sha::$(shasum -a 256 dist/${{ steps.file_names.outputs.wheel_file }})
- 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 ${{ github.ref }}
draft: true
prerelease: true
body: |
SHA256 checksums
- ${{ steps.sha.outputs.tar_sha }}
- ${{ steps.sha.outputs.wheel_sha }}
- name: Upload tar.gz to Release
id: upload-tar
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: dist/${{ steps.file_names.outputs.tar_file }}
asset_name: ${{ steps.file_names.outputs.tar_file }}
asset_content_type: application/tar+gz
- name: Upload wheel to Release
id: 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/${{ steps.file_names.outputs.wheel_file }}
asset_name: ${{ steps.file_names.outputs.wheel_file }}
asset_content_type: application/x-pywheel+zip