-
Notifications
You must be signed in to change notification settings - Fork 1
58 lines (48 loc) · 1.43 KB
/
publish.yml
File metadata and controls
58 lines (48 loc) · 1.43 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
name: Publish Release
on:
release:
types: [created]
jobs:
merge:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Git
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
- name: Merge main into stable
run: |
git checkout origin/stable
git merge -m "build: merge latest main branch" origin/main
git push origin HEAD:stable
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
pypi-publish:
name: Upload release to PyPI
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/apmodel
permissions:
id-token: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup PDM
uses: pdm-project/setup-pdm@v4
- name: Set PDM_BUILD_SCM_VERSION
run: echo "PDM_BUILD_SCM_VERSION=${GITHUB_REF##*/}" >> $GITHUB_ENV
- name: Display PDM_BUILD_SCM_VERSION
run: echo "PDM_BUILD_SCM_VERSION is $PDM_BUILD_SCM_VERSION"
- name: Build Package
run: |
uv sync --locked
uv build
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1