Skip to content

Commit 15bc049

Browse files
fix: Update release_build.yaml
1 parent bbd303f commit 15bc049

File tree

1 file changed

+8
-7
lines changed
  • repo_scaffold/templates/template-python/{{cookiecutter.project_slug}}/.github/workflows

1 file changed

+8
-7
lines changed

repo_scaffold/templates/template-python/{{cookiecutter.project_slug}}/.github/workflows/release_build.yaml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,26 @@
11
name: release-build
22

33
on:
4-
release:
5-
types: [published]
6-
branches:
7-
- main
8-
- master
4+
push:
5+
tags:
6+
- '[0-9]+.[0-9]+.[0-9]+' # 匹配类似 1.0.0, 2.1.3 等格式的标签
97
workflow_dispatch:
108
inputs:
119
version:
1210
description: 'Version to release (e.g. 1.0.0)'
1311
required: true
1412
type: string
1513

14+
1615
permissions:
1716
contents: write # 用于创建 release
1817
id-token: write # 用于发布到 PyPI
1918

2019
jobs:
21-
build:
20+
release-build:
2221
runs-on: ubuntu-latest
22+
permissions:
23+
contents: write # 用于创建 GitHub Release
2324
steps:
2425
- uses: actions/checkout@v4
2526

@@ -28,7 +29,7 @@ jobs:
2829
with:
2930
export-env: true
3031
env:
31-
{% raw %}OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}{% endraw %}
32+
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
3233
PERSONAL_ACCESS_TOKEN: op://shawndengdev/github_access_token/credential
3334
PYPI_TOKEN: op://shawndengdev/pypi_token/credential
3435

0 commit comments

Comments
 (0)