-
Notifications
You must be signed in to change notification settings - Fork 2
100 lines (92 loc) · 2.25 KB
/
release.yml
File metadata and controls
100 lines (92 loc) · 2.25 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
# vim: set tabstop=2 softtabstop=2 shiftwidth=2 expandtab:
name: Create a release and deploy to PyPi
on:
push:
tags:
- v*.*.*
- v*.*.*.dev*
- v*.*.*.post*
jobs:
test:
uses: ./.github/workflows/test.yml
secrets: inherit
build:
name: Build wheel
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.13"
cache: "pip"
- run: python -m pip install build
- run: python -m build .
- uses: actions/upload-artifact@v4
with:
name: package
path: dist/*.*
merge-into-stable:
name: Update stable branch to point to this release
runs-on: ubuntu-latest
needs: [build]
if: "!contains(github.ref, 'dev')"
permissions: write-all
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: stable
- name: Merge tag into stable
run: |
TAG="${{github.ref}}" # /ref/tags/v0.0.0
git merge "${TAG:10}"
git push
deploy:
name: Upload built wheel and source package to PyPi
runs-on: ubuntu-latest
needs: [build]
environment:
name: pypi
url: https://pypi.org/p/cartogram
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v4
with:
name: package
path: dist/
- uses: pypa/gh-action-pypi-publish@release/v1
with:
skip-existing: true
release:
name: Create a new release
runs-on: ubuntu-latest
needs: [deploy]
if: "!contains(github.ref, 'dev')"
permissions:
contents: write
steps:
- uses: actions/download-artifact@v4
with:
name: package
path: dist/
- uses: softprops/action-gh-release@v2
with:
files: dist/*
prerelease:
name: Create a new pre-release
runs-on: ubuntu-latest
needs: [deploy]
if: contains(github.ref, 'dev')
permissions:
contents: write
steps:
- uses: actions/download-artifact@v4
with:
name: package
path: dist/
- uses: softprops/action-gh-release@v2
with:
files: dist/*
prerelease: true