-
Notifications
You must be signed in to change notification settings - Fork 32
66 lines (66 loc) · 2.14 KB
/
release.yaml
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
---
name: release
on:
push:
tags: v[0-9]+.[0-9]+.[0-9]+
jobs:
inspect:
runs-on: ubuntu-latest
container: python:3.10
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Get the version from the tag.
id: get_version
run: echo ::set-output name=version::${GITHUB_REF:11}
shell: bash
# see https://github.com/actions/runner-images/issues/6775
# newer versions of Git check ownership of multi-user repositories
# and will fail if one attempts to run Git in the checkout.
- name: Workaround dubious ownership Git security check
id: workaround_dubious_ownership
run: git config --global --add safe.directory /__w/site-generator/site-generator
- name: Get the release notes from the previous release to this one.
id: release_tool
run: python ./.github/release_notes.py
outputs:
version: ${{ steps.get_version.outputs.version }}
release_notes: ${{ steps.release_tool.outputs.release_notes }}
github_release:
runs-on: ubuntu-latest
needs: inspect
steps:
- name: Create the GitHub release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
tag_name: v${{ needs.inspect.outputs.version }}
release_name: aip-site-generator ${{ needs.inspect.outputs.version }}
body: ${{ needs.inspect.outputs.release_notes }}
draft: false
prerelease: false
pypi_release:
runs-on: ubuntu-latest
container: python:3.10
needs:
- inspect
- github_release
steps:
- uses: actions/checkout@v3
- name: Install twine.
run: pip install twine
- name: Set the version number.
run: |
cat > VERSION <<EOF
${{ needs.inspect.outputs.version }}
EOF
- name: Create a source distribution.
run: python setup.py sdist
- name: Upload to PyPI.
run: twine upload dist/*
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
TWINE_NON_INTERACTIVE: 1