-
-
Notifications
You must be signed in to change notification settings - Fork 21
94 lines (78 loc) · 2.34 KB
/
publish.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
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
name: Publish
on:
push:
tags:
- "v*.*.*"
pull_request:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v4
- name: Install poetry
run: pipx install poetry
- name: Build package
run: poetry build -vvv
- uses: actions/upload-artifact@v4
with:
name: package
path: |
README.md
pyproject.toml
dist/*
if-no-files-found: error
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
pypi:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
environment: release
needs: build
steps:
- name: Install poetry
run: pipx install poetry
- uses: actions/download-artifact@v4
with:
name: package
- run: ls dist/*
- name: Publish package
run: poetry publish
env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}
homebrew:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
environment: release
needs: publish
steps:
- uses: actions/checkout@v4
with:
repository: janw/homebrew-tap
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
- uses: actions/checkout@v4
with:
path: 'podcast-archiver'
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v6
id: gpg-import
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
git_user_signingkey: true
git_commit_gpgsign: true
git_tag_gpgsign: true
fingerprint: 2B939A343491740FE1483E5C41E311388E4BB349
- name: List keys
run: gpg -K
- name: Install poetry + poetry-brew
run: |
pipx install 'poetry>=1.7.0'
pipx inject poetry git+https://github.com/janw/poetry-brew.git
- name: Update formula
run: poetry brew -C ../podcast-archiver/ -v --output ./Formula
- name: Commit and push
run: |
git add Formula/podcast-archiver.rb
git commit -m "bump(podcast-archiver): ${{github.ref_name}}"
git push