-
Notifications
You must be signed in to change notification settings - Fork 48
163 lines (134 loc) · 4.32 KB
/
autorelease.yml
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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
name: Release
on:
workflow_dispatch:
branches: [master]
push:
branches: [master]
paths:
- 'VERSION'
permissions:
id-token: write
contents: write
jobs:
linux-build:
name: Linux Build
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: PDM
run: python3.12 -m pip install pdm
- name: Install libkrb5-dev
run: sudo apt-get install -y libkrb5-dev
- name: Installs dev deps and package
run : PDM_BUILD_SCM_VERSION=$(cat VERSION) pdm install --dev
- name: Build binary release
run: |
pdm run python3.12 -m nuitka --standalone --onefile --output-filename=ldeep.bin ldeep/__main__.py
mv ldeep.bin ldeep_linux-amd64
- name: Build Source Distribution
run: PDM_BUILD_SCM_VERSION=$(cat VERSION) pdm build -d sdist --no-wheel
- name: Upload Artifacts (binary)
uses: actions/upload-artifact@v4
with:
name: linux
path: ldeep_linux-amd64
- name: Upload Artifacts (sdist)
uses: actions/upload-artifact@v4
with:
name: sdist
path: sdist/*
windows-build:
name: Windows Build
runs-on: "windows-latest"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: PDM
run: python3 -m pip install pdm
- name: Installs dev deps and package
run: $env:PDM_BUILD_SCM_VERSION=gc "VERSION"; pdm install --dev
- name: Build
run: |
pdm run python3 -m nuitka --standalone --assume-yes-for-downloads --output-filename=ldeep.exe --onefile ldeep/__main__.py
mv ldeep.exe ldeep_windows-amd64.exe
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: windows
path: ldeep_windows-amd64.exe
macos-build:
name: MacOS ARM64 Build
runs-on: "macos-latest"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: PDM
run: python3.12 -m pip install pdm
- name: Installs dev deps and package
run: PDM_BUILD_SCM_VERSION=$(cat VERSION) pdm install --dev
- name: Build
run: |
pdm run python3.12 -m nuitka --standalone --onefile --output-filename=ldeep.bin ldeep/__main__.py
mv ldeep.bin ldeep_macos-arm64
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: macos
path: ldeep_macos-arm64
macos-amd-build:
name: MacOS AMD64 Build
runs-on: "macos-13"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: PDM
run: python3.12 -m pip install pdm
- name: Installs dev deps and package
run: PDM_BUILD_SCM_VERSION=$(cat VERSION) pdm install --dev
- name: Build
run: |
pdm run python3.12 -m nuitka --standalone --onefile --output-filename=ldeep.bin ldeep/__main__.py
mv ldeep.bin ldeep_macos-amd64
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: macos-amd
path: ldeep_macos-amd64
tagged-release:
needs: [linux-build, windows-build, macos-build, macos-amd-build]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get local version
run: echo "version=$(cat VERSION)" >> $GITHUB_ENV
- name: Create tag
uses: rickstaa/action-create-tag@v1
with:
tag: ${{ env.version }}
- name: Download all workflow run artifacts
uses: actions/download-artifact@v4
- name: Create the release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ env.version }}
generate_release_notes: true
body: "${{ github.event.head_commit.message }}"
files: |
linux/ldeep_linux-amd64
windows/ldeep_windows-amd64.exe
macos/ldeep_macos-arm64
macos-amd/ldeep_macos-amd64
- name: Upload to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: sdist/