-
-
Notifications
You must be signed in to change notification settings - Fork 12
66 lines (57 loc) · 2 KB
/
manual-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
# Match release tags on master branch
name: Manual-Release
on:
workflow_dispatch:
inputs:
pre_release:
description: 'This is a pre-release'
default: true
type: boolean
jobs:
release:
runs-on: ubuntu-latest
name: Build release package
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@master
name: Setup Python 3.8
with:
python-version: 3.8
- name: Install dependencies
run: python -m pip install -U poetry
- name: Build Package
id: build_package
run: |
rm -rf dist
poetry build
cd dist
echo "source=$(ls *.tar.gz)" >> $GITHUB_OUTPUT
echo "wheel=$(ls *.whl)" >> $GITHUB_OUTPUT
echo "version=$(poetry version -s)" >> $GITHUB_OUTPUT
- name: Create a Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.build_package.outputs.version }}
release_name: Release ${{ steps.build_package.outputs.version }}
prerelease: ${{ inputs.pre_release }}
- name: Attach Release 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.build_package.outputs.wheel }}
asset_name: ${{ steps.build_package.outputs.wheel }}
asset_content_type: application/x-pywheel+zip
- name: Attach Release Source
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.build_package.outputs.source }}
asset_name: ${{ steps.build_package.outputs.source }}
asset_content_type: application/x-tar+gzip