4
4
5
5
jobs :
6
6
build :
7
+ name : >-
8
+ Build and Package 📦
7
9
if : ${{ startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/release' }}
8
10
strategy :
9
11
matrix :
@@ -76,16 +78,16 @@ jobs:
76
78
build/*.app/**/*
77
79
overwrite : true
78
80
79
- publish-to-testpypi :
80
- name : Publish Python 🐍 distribution 📦 to TestPyPI
81
+ publish-to-pypi :
82
+ name : >-
83
+ Publish Python 🐍 distribution 📦 to PyPI
84
+ if : startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
81
85
needs :
82
86
- build
83
87
runs-on : ubuntu-latest
84
-
85
88
environment :
86
- name : testpypi
87
- url : https://test.pypi.org/p/ytm2spt
88
-
89
+ name : pypi
90
+ url : https://pypi.org/p/ytm2spt
89
91
permissions :
90
92
id-token : write # IMPORTANT: mandatory for trusted publishing
91
93
@@ -95,15 +97,15 @@ jobs:
95
97
with :
96
98
name : python-package-distributions
97
99
path : dist/
98
- - name : Publish distribution 📦 to TestPyPI
100
+ - name : Publish distribution 📦 to PyPI
99
101
uses : pypa/gh-action-pypi-publish@release/v1
100
- with :
101
- repository-url : https://test.pypi.org/legacy/
102
-
102
+
103
103
release :
104
+ name : >-
105
+ Create a GitHub Release 🚀
104
106
needs :
105
107
- build
106
- - publish-to-testpypi
108
+ - publish-to-pypi
107
109
runs-on : ubuntu-latest
108
110
109
111
permissions :
@@ -134,25 +136,25 @@ jobs:
134
136
- name : Zip Windows Executable
135
137
run : |
136
138
cd *windows-build
137
- zip -9 ytm2spt-${{ github.ref_name }}- windows.zip *-installer.exe
139
+ zip -9 ytm2spt-windows.zip *-installer.exe
138
140
139
141
- name : Zip Linux Executable
140
142
run : |
141
143
cd *linux-build
142
- tar -cavf ytm2spt-${{ github.ref_name }}- linux.tar.gz *.bin
144
+ tar -cavf ytm2spt-linux.tar.gz *.bin
143
145
144
146
- name : Zip MacOS Executable
145
147
run : |
146
148
cd *macos-build
147
- zip -r -9 ytm2spt-${{ github.ref_name }}- macos.zip *.app
149
+ zip -r -9 ytm2spt-macos.zip *.app
148
150
149
151
- name : GitHub Release
150
152
uses : softprops/action-gh-release@v2
151
153
with :
152
154
draft : true
153
155
generate_release_notes : true
154
156
files : |
155
- *build/ytm2spt-${{ github.ref_name }}- windows.zip
156
- *build/ytm2spt-${{ github.ref_name }}- linux.tar.gz
157
- *build/ytm2spt-${{ github.ref_name }}- macos.zip
157
+ *build/ytm2spt-windows.zip
158
+ *build/ytm2spt-linux.tar.gz
159
+ *build/ytm2spt-macos.zip
158
160
dist/*
0 commit comments