-
Notifications
You must be signed in to change notification settings - Fork 1
126 lines (120 loc) · 3.61 KB
/
Copy pathrelease.yml
File metadata and controls
126 lines (120 loc) · 3.61 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
name: Release
on:
push:
tags:
- "v[0-9]*"
permissions:
contents: read
jobs:
build:
name: Build (${{ matrix.target }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: macos-latest
target: aarch64-apple-darwin
- os: macos-latest
target: x86_64-apple-darwin
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
- os: ubuntu-latest
target: aarch64-unknown-linux-gnu
- os: windows-latest
target: x86_64-pc-windows-msvc
steps:
- uses: actions/checkout@v4
- uses: PyO3/maturin-action@v1
with:
command: build
args: --release --out dist --target ${{ matrix.target }}
- uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.target }}
path: dist/*.whl
- uses: actions/upload-artifact@v4
with:
name: bin-${{ matrix.target }}
path: target/${{ matrix.target }}/release/glyphspack${{ matrix.os == 'windows-latest' && '.exe' || '' }}
sdist:
name: Build sdist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: PyO3/maturin-action@v1
with:
command: sdist
args: --out dist
- uses: actions/upload-artifact@v4
with:
name: sdist
path: dist/*.tar.gz
pypi:
name: Publish to PyPI
runs-on: ubuntu-latest
needs: [build, sdist]
environment: pypi
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v4
with:
pattern: wheels-*
merge-multiple: true
path: dist
- uses: actions/download-artifact@v4
with:
name: sdist
path: dist
- uses: pypa/gh-action-pypi-publish@release/v1
github-release:
name: GitHub Release
runs-on: macos-latest
needs: [build]
permissions:
contents: write
steps:
- uses: actions/download-artifact@v4
with:
name: bin-aarch64-apple-darwin
path: bin/aarch64-apple-darwin
- uses: actions/download-artifact@v4
with:
name: bin-x86_64-apple-darwin
path: bin/x86_64-apple-darwin
- uses: actions/download-artifact@v4
with:
name: bin-x86_64-unknown-linux-gnu
path: bin/x86_64-unknown-linux-gnu
- uses: actions/download-artifact@v4
with:
name: bin-aarch64-unknown-linux-gnu
path: bin/aarch64-unknown-linux-gnu
- uses: actions/download-artifact@v4
with:
name: bin-x86_64-pc-windows-msvc
path: bin/x86_64-pc-windows-msvc
- name: Create macOS universal binary
run: |
lipo -create \
bin/aarch64-apple-darwin/glyphspack \
bin/x86_64-apple-darwin/glyphspack \
-output glyphspack-macos
- name: Prepare release assets
run: |
cp bin/x86_64-unknown-linux-gnu/glyphspack glyphspack-linux-x86_64
cp bin/aarch64-unknown-linux-gnu/glyphspack glyphspack-linux-arm64
cp bin/x86_64-pc-windows-msvc/glyphspack.exe glyphspack-windows-x86_64.exe
- name: Create release
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release create "${{ github.ref_name }}" \
--repo "${{ github.repository }}" \
--title "glyphspack ${GITHUB_REF_NAME#v}" \
--generate-notes \
glyphspack-macos \
glyphspack-linux-x86_64 \
glyphspack-linux-arm64 \
glyphspack-windows-x86_64.exe