forked from platzky/platzky
-
Notifications
You must be signed in to change notification settings - Fork 1
109 lines (90 loc) · 2.85 KB
/
Copy pathrelease.yml
File metadata and controls
109 lines (90 loc) · 2.85 KB
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
name: Semantic Release
on:
push:
branches:
- main
- next
permissions:
contents: read
id-token: write
jobs:
tests:
uses: ./.github/workflows/tests.yml
release:
runs-on: ubuntu-latest
needs: tests
outputs:
released: ${{ steps.release.outputs.released }}
tag: ${{ steps.release.outputs.tag }}
concurrency:
group: ${{ github.workflow }}-release-${{ github.ref_name }}
cancel-in-progress: false
permissions:
contents: write
issues: write
pull-requests: write
steps:
- name: Generate bot app token
id: generate_token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.MY_RELEASER_ID }}
private-key: ${{ secrets.MY_RELEASER_PRIVATE_KEY }}
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ steps.generate_token.outputs.token }}
fetch-depth: 0
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry
poetry install
- name: Action | Semantic Version Release
id: release
uses: python-semantic-release/python-semantic-release@4d4cb0ab842247caea1963132c242c62aab1e4d5
with:
github_token: ${{ steps.generate_token.outputs.token }}
git_committer_name: "semantic-release"
git_committer_email: "semantic-release@users.noreply.github.com"
build: false
- name: Build package
if: steps.release.outputs.released == 'true'
run: poetry build
- name: Publish | Upload to GitHub Release Assets
uses: python-semantic-release/publish-action@ae6462adc12bd3d1738070d784b65b5189b955a9
if: steps.release.outputs.released == 'true'
with:
github_token: ${{ steps.generate_token.outputs.token }}
tag: ${{ steps.release.outputs.tag }}
- name: Upload | Distribution Artifacts
uses: actions/upload-artifact@v4
if: steps.release.outputs.released == 'true'
with:
name: distribution-artifacts
path: dist
if-no-files-found: error
deploy:
runs-on: ubuntu-latest
needs: release
if: ${{ needs.release.outputs.released == 'true' }}
environment:
name: pypi
url: https://pypi.org/p/platzky
permissions:
contents: read
id-token: write
steps:
- name: Setup | Download Build Artifacts
uses: actions/download-artifact@v4
with:
name: distribution-artifacts
path: dist
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e
with:
packages-dir: dist