@@ -8,7 +8,7 @@ on: [ push, pull_request ]
8
8
jobs :
9
9
build-sdist :
10
10
name : Build SDist
11
- runs-on : ubuntu-latest
11
+ runs-on : ubuntu-22.04
12
12
13
13
steps :
14
14
- uses : actions/checkout@v4
@@ -42,15 +42,17 @@ jobs:
42
42
- name : Upload SDist
43
43
uses : actions/upload-artifact@v4
44
44
with :
45
+ name : wheel-sdist
45
46
path : dist/*.tar.gz
47
+ compression-level : 0 # already compressed
46
48
47
49
build-wheels :
48
50
name : Build Wheels on ${{ matrix.os }}
49
51
runs-on : ${{ matrix.os }}
50
52
strategy :
51
53
matrix :
52
54
# macos-13 is an intel runner, macos-14 is apple silicon
53
- os : [ubuntu-latest , windows-latest, macos-13, macos-14]
55
+ os : [ ubuntu-22.04 , windows-latest, macos-13, macos-14 ]
54
56
linux_arch : [ 'x86_64' ] # [suffix, mac, windows, linux] arch names
55
57
56
58
steps :
71
73
- name : Install QEMU
72
74
# install QEMU if building for linux
73
75
uses : docker/setup-qemu-action@v2
74
- if : runner.os == 'linux'
76
+ if : runner.os == 'linux'
75
77
with :
76
78
platforms : arm64
77
79
@@ -83,57 +85,63 @@ jobs:
83
85
- name : Upload Wheels
84
86
uses : actions/upload-artifact@v4
85
87
with :
88
+ name : wheels-${{ matrix.os }}
86
89
path : ./wheelhouse/*.whl
90
+ compression-level : 0 # already compressed
87
91
88
- publish :
89
- name : Publish to PyPI and Github
90
- needs : [ build-wheels, build-sdist ]
92
+ publish-pypi :
93
+ name : Deploy to PyPI
91
94
if : github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
92
- runs-on : ubuntu-latest
93
-
95
+ needs : [ build-wheels, build-sdist ]
96
+ runs-on : ubuntu-22.04
97
+ environment :
98
+ name : Publish
99
+ url : https://pypi.org/project/quicktex/${{ github.ref_name }}
100
+ permissions :
101
+ id-token : write
94
102
steps :
95
- - uses : actions/checkout@v4 # just need the changelog
96
-
97
- - name : Set up Python
98
- uses : actions/setup-python@v5.1.1
103
+ - name : Download Artifacts
104
+ uses : actions/download-artifact@v4
99
105
with :
100
- python-version : ' 3.13'
106
+ merge-multiple : true
107
+ pattern : wheel*
108
+ path : dist
101
109
102
- - name : Install dependencies
103
- run : |
104
- python -m pip install --upgrade pip
105
- python -m pip install yaclog
110
+ - name : Publish to PyPI
111
+ uses : pypa/gh-action-pypi-publish@release/v1
106
112
107
- - name : Get version name and body
108
- run : |
109
- echo "VERSION_TILE=Version $(yaclog show -n)" >> $GITHUB_ENV
110
- echo "$(yaclog show -mb)" >> RELEASE.md
113
+ publish-github :
114
+ name : Deploy to Github
115
+ if : github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
116
+ needs : [ build-wheels, build-sdist ]
117
+ runs-on : ubuntu-22.04
118
+ environment :
119
+ name : Publish
120
+ url : https://github.com/${{ github.repository }}/releases/tag/${{ github.ref_name }}
121
+ permissions :
122
+ contents : write
123
+ steps :
124
+ - uses : actions/checkout@v4
111
125
112
126
- name : Download Artifacts
113
127
uses : actions/download-artifact@v4
114
128
with :
115
- name : artifact
129
+ merge-multiple : true
130
+ pattern : wheel*
116
131
path : dist
117
132
118
133
- name : List artifacts
119
134
run : ls -l dist
120
135
121
- - name : Publish to Test PyPI
122
- uses : pypa/gh-action-pypi-publish@release/v1
123
- with :
124
- password : ${{ secrets.TEST_PYPI_API_TOKEN }}
125
- repository_url : https://test.pypi.org/legacy/
126
-
127
- - name : Publish to PyPI
128
- uses : pypa/gh-action-pypi-publish@release/v1
129
- with :
130
- password : ${{ secrets.PYPI_API_TOKEN }}
136
+ - name : Get Changelog Information
137
+ id : yaclog-show
138
+ uses : drewcassidy/yaclog@1.5.0
131
139
132
140
- name : Publish to Github
133
- uses : softprops/action-gh-release@v1
134
- with :
135
- files : dist/*
136
- name : ${{ env.VERSION_TITLE }}
137
- body_path : RELEASE.md
141
+ run : >
142
+ gh release create ${{ github.ref_name }}
143
+ --notes-file "${{ steps.yaclog-show.outputs.body-file }}"
144
+ --title " ${{ steps.yaclog-show.outputs.name }}"
145
+ dist/*
138
146
env :
139
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
147
+ GH_TOKEN : ${{ github.token }}
0 commit comments