-
Notifications
You must be signed in to change notification settings - Fork 10
83 lines (73 loc) · 2.52 KB
/
release-please.yml
File metadata and controls
83 lines (73 loc) · 2.52 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
name: Release Please
on:
push:
branches:
- master
permissions:
contents: write
pull-requests: write
jobs:
release-please:
runs-on: ubuntu-latest
outputs:
release_created: ${{ steps.release.outputs.release_created }}
tag_name: ${{ steps.release.outputs.tag_name }}
version: ${{ steps.release.outputs.version }}
steps:
- uses: google-github-actions/release-please-action@v4
id: release
with:
release-type: python
package-name: filepattern
# If a release was created, update version files and create a follow-up commit
- name: Checkout code
if: ${{ steps.release.outputs.release_created }}
uses: actions/checkout@v4
with:
ref: ${{ steps.release.outputs.tag_name }}
- name: Set up Python
if: ${{ steps.release.outputs.release_created }}
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install setuptools-scm
if: ${{ steps.release.outputs.release_created }}
run: pip install setuptools-scm
- name: Update version files
if: ${{ steps.release.outputs.release_created }}
run: |
python scripts/update_versions.py --version ${{ steps.release.outputs.version }}
echo "Updated version files to ${{ steps.release.outputs.version }}"
- name: Upload .version file as release asset
if: ${{ steps.release.outputs.release_created }}
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release upload ${{ steps.release.outputs.tag_name }} .version --clobber
trigger-publish:
needs: release-please
if: ${{ needs.release-please.outputs.release_created }}
runs-on: ubuntu-latest
permissions:
actions: write
steps:
- name: Trigger PyPI publish
uses: actions/github-script@v7
with:
script: |
github.rest.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: 'publish_pypi.yml',
ref: '${{ needs.release-please.outputs.tag_name }}'
})
- name: Trigger Maven publish
uses: actions/github-script@v7
with:
script: |
github.rest.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: 'publish_maven.yml',
ref: '${{ needs.release-please.outputs.tag_name }}'
})