-
Notifications
You must be signed in to change notification settings - Fork 105
74 lines (62 loc) · 1.78 KB
/
build_publish.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: Build & Publish
on:
push:
tags:
- 'v\d+\.\d+\.[0-9a-z]+' # e.g. v1.0.0 or v20.15.10b5
jobs:
build:
name: Build Release
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install build
- name: Build artifacts
run: |
python -m build
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: wheelstorage
path: ./dist/*
if-no-files-found: error
retention-days: 30
publish:
name: Publish Release
needs: build
runs-on: ubuntu-latest
steps:
- name: Get date & flat tag
id: date_tag
run: |
export DATE=$(TZ=America/Sao_Paulo date +'%Y-%b-%-d')
echo $DATE
export FLAT_TAG=$(echo ${GITHUB_REF##*/} | sed 's/[v.]//g')
echo $FLAT_TAG
echo ::set-output name=TODAY::$DATE
echo ::set-output name=VERSION::$FLAT_TAG
shell: bash
- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: wheelstorage
path: dist
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
body: '[Release Notes](https://github.com/googlefonts/fontbakery/blob/main/CHANGELOG.md#${{ steps.date_tag.outputs.VERSION }}-${{ steps.date_tag.outputs.TODAY }})'
token: ${{ secrets.GITHUB_TOKEN }}
prerelease: true
files: ./dist/*.tar.gz